| 1 | package Net::Braintree::Transaction; | ||||||||||
| 2 | 1 | ▶ | use Net::Braintree::Transaction::CreatedUsing; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use Net::Braintree::Transaction::EscrowStatus; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use Net::Braintree::Transaction::Source; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use Net::Braintree::Transaction::Status; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use Net::Braintree::Transaction::Type; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | extends "Net::Braintree::ResultObject"; | |||||||||
| 10 | 1 | my $meta = __PACKAGE__->meta; | |||||||||
| 11 | |||||||||||
| 12 | 0 | ▶ | sub BUILD { | ||||||||
|
Subroutine
BUILD: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||
| 13 | 0 | my ($self, $attributes) = @_; | |||||||||
| 14 | 0 | my $sub_objects = { 'disputes' => 'Net::Braintree::Dispute'}; | |||||||||
| 15 | 0 | $meta->add_attribute('subscription', is => 'rw'); | |||||||||
| 16 | 0 | ▶ | $self->subscription(Net::Braintree::Subscription->new($attributes->{subscription})) if ref($attributes->{subscription}) eq 'HASH'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | 0 | delete($attributes->{subscription}); | |||||||||
| 18 | 0 | $meta->add_attribute('disbursement_details', is => 'rw'); | |||||||||
| 19 | 0 | ▶ | $self->disbursement_details(Net::Braintree::DisbursementDetails->new($attributes->{disbursement_details})) if ref($attributes->{disbursement_details}) eq 'HASH'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | 0 | delete($attributes->{disbursement_details}); | |||||||||
| 21 | |||||||||||
| 22 | 0 | $meta->add_attribute('paypal_details', is => 'rw'); | |||||||||
| 23 | 0 | ▶ | $self->paypal_details(Net::Braintree::PayPalDetails->new($attributes->{paypal})) if ref($attributes->{paypal}) eq 'HASH'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | 0 | delete($attributes->{paypal}); | |||||||||
| 25 | |||||||||||
| 26 | 0 | $self->setup_sub_objects($self, $attributes, $sub_objects); | |||||||||
| 27 | 0 | $self->set_attributes_from_hash($self, $attributes); | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 0 | ▶ | sub sale { | ||||||||
|
Subroutine
sale: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 31 | 0 | my ($class, $params) = @_; | |||||||||
| 32 | 0 | $class->create($params, 'sale'); | |||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 0 | ▶ | sub credit { | ||||||||
|
Subroutine
credit: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 36 | 0 | my ($class, $params) = @_; | |||||||||
| 37 | 0 | $class->create($params, 'credit'); | |||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | 0 | ▶ | sub submit_for_settlement { | ||||||||
|
Subroutine
submit_for_settlement: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 41 | 0 | my ($class, $id, $amount) = @_; | |||||||||
| 42 | 0 | my $params = {}; | |||||||||
| 43 | 0 | ▶ | $params->{'amount'} = $amount if $amount; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 44 | 0 | $class->gateway->transaction->submit_for_settlement($id, $params); | |||||||||
| 45 | } | ||||||||||
| 46 | |||||||||||
| 47 | 0 | ▶ | sub void { | ||||||||
|
Subroutine
void: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 48 | 0 | my ($class, $id) = @_; | |||||||||
| 49 | 0 | $class->gateway->transaction->void($id); | |||||||||
| 50 | } | ||||||||||
| 51 | |||||||||||
| 52 | 0 | ▶ | sub refund { | ||||||||
|
Subroutine
refund: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 53 | 0 | my ($class, $id, $amount) = @_; | |||||||||
| 54 | 0 | my $params = {}; | |||||||||
| 55 | 0 | ▶ | $params->{'amount'} = $amount if $amount; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 56 | 0 | $class->gateway->transaction->refund($id, $params); | |||||||||
| 57 | } | ||||||||||
| 58 | |||||||||||
| 59 | 0 | ▶ | sub create { | ||||||||
|
Subroutine
create: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 60 | 0 | my ($class, $params, $type) = @_; | |||||||||
| 61 | 0 | $params->{'type'} = $type; | |||||||||
| 62 | 0 | $class->gateway->transaction->create($params); | |||||||||
| 63 | } | ||||||||||
| 64 | |||||||||||
| 65 | 0 | ▶ | sub find { | ||||||||
|
Subroutine
find: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 66 | 0 | my ($class, $id) = @_; | |||||||||
| 67 | 0 | $class->gateway->transaction->find($id); | |||||||||
| 68 | } | ||||||||||
| 69 | |||||||||||
| 70 | 0 | ▶ | sub search { | ||||||||
|
Subroutine
search: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 71 | 0 | my ($class, $block) = @_; | |||||||||
| 72 | 0 | $class->gateway->transaction->search($block); | |||||||||
| 73 | } | ||||||||||
| 74 | |||||||||||
| 75 | 0 | ▶ | sub hold_in_escrow { | ||||||||
|
Subroutine
hold_in_escrow: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 76 | 0 | my ($class, $id) = @_; | |||||||||
| 77 | 0 | $class->gateway->transaction->hold_in_escrow($id); | |||||||||
| 78 | } | ||||||||||
| 79 | |||||||||||
| 80 | 0 | ▶ | sub release_from_escrow { | ||||||||
|
Subroutine
release_from_escrow: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 81 | 0 | my ($class, $id) = @_; | |||||||||
| 82 | 0 | $class->gateway->transaction->release_from_escrow($id); | |||||||||
| 83 | } | ||||||||||
| 84 | |||||||||||
| 85 | 0 | ▶ | sub cancel_release { | ||||||||
|
Subroutine
cancel_release: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 86 | 0 | my ($class, $id) = @_; | |||||||||
| 87 | 0 | $class->gateway->transaction->cancel_release($id); | |||||||||
| 88 | } | ||||||||||
| 89 | |||||||||||
| 90 | 0 | ▶ | sub all { | ||||||||
|
Subroutine
all: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 91 | 0 | my $class = shift; | |||||||||
| 92 | 0 | $class->gateway->transaction->all; | |||||||||
| 93 | } | ||||||||||
| 94 | |||||||||||
| 95 | 0 | ▶ | sub clone_transaction { | ||||||||
|
Subroutine
clone_transaction: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 96 | 0 | my ($class, $id, $params) = @_; | |||||||||
| 97 | 0 | $class->gateway->transaction->clone_transaction($id, $params); | |||||||||
| 98 | } | ||||||||||
| 99 | |||||||||||
| 100 | 0 | ▶ | sub gateway { | ||||||||
|
Subroutine
gateway: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 101 | 0 | Net::Braintree->configuration->gateway; | |||||||||
| 102 | } | ||||||||||
| 103 | |||||||||||
| 104 | 0 | ▶ | sub is_disbursed { | ||||||||
|
Subroutine
is_disbursed: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 105 | 0 | my $self = shift; | |||||||||
| 106 | 0 | $self->disbursement_details->is_valid(); | |||||||||
| 107 | }; | ||||||||||
| 108 | |||||||||||
| 109 | 1 | 1; | |||||||||