| 1 | # vim: sw=4 ts=4 ft=perl | ||||||||||
| 2 | |||||||||||
| 3 | package WebService::Braintree::Result; | ||||||||||
| 4 | 22 | $WebService::Braintree::Result::VERSION = '1.7'; | |||||||||
| 5 | 22 | ▶ | use 5.010_001; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 22 | ▶ | use strictures 1; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | =head1 NAME | ||||||||||
| 9 | |||||||||||
| 10 | WebService::Braintree::Result | ||||||||||
| 11 | |||||||||||
| 12 | =head1 PURPOSE | ||||||||||
| 13 | |||||||||||
| 14 | This class represents a result from the Braintree API with no validation errors. | ||||||||||
| 15 | |||||||||||
| 16 | This class is a sibling class to L<WebService::Braintree::PaymentMethodResult>. | ||||||||||
| 17 | |||||||||||
| 18 | =cut | ||||||||||
| 19 | |||||||||||
| 20 | 22 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 21 | |||||||||||
| 22 | 22 | ▶ | use WebService::Braintree::Types qw( | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 23 | AddOn | ||||||||||
| 24 | Address | ||||||||||
| 25 | ApplePayCard | ||||||||||
| 26 | ApplePayOptions | ||||||||||
| 27 | CreditCard | ||||||||||
| 28 | CreditCardVerification | ||||||||||
| 29 | Customer | ||||||||||
| 30 | Discount | ||||||||||
| 31 | Dispute | ||||||||||
| 32 | Dispute_Evidence | ||||||||||
| 33 | DocumentUpload | ||||||||||
| 34 | EuropeBankAccount | ||||||||||
| 35 | IdealPayment | ||||||||||
| 36 | Merchant | ||||||||||
| 37 | MerchantAccount | ||||||||||
| 38 | PaymentMethodNonce | ||||||||||
| 39 | PayPalAccount | ||||||||||
| 40 | SettlementBatchSummary | ||||||||||
| 41 | Subscription | ||||||||||
| 42 | Transaction | ||||||||||
| 43 | UsBankAccount | ||||||||||
| 44 | 22 | ); | |||||||||
| 45 | |||||||||||
| 46 | =head1 METHODS | ||||||||||
| 47 | |||||||||||
| 48 | =cut | ||||||||||
| 49 | |||||||||||
| 50 | =head2 Possible objects | ||||||||||
| 51 | |||||||||||
| 52 | These are the possible objects that are returnable by this object. If this | ||||||||||
| 53 | result does not have anything for that method, it will return undef. | ||||||||||
| 54 | |||||||||||
| 55 | =over 4 | ||||||||||
| 56 | |||||||||||
| 57 | =item L<add_on|WebService::Braintree::_::AddOn> | ||||||||||
| 58 | |||||||||||
| 59 | =item L<address|WebService::Braintree::_::Address> | ||||||||||
| 60 | |||||||||||
| 61 | =item L<apple_pay_card|WebService::Braintree::_::ApplePayCard> | ||||||||||
| 62 | |||||||||||
| 63 | =item L<apple_pay_options|WebService::Braintree::_::ApplePayOptions> | ||||||||||
| 64 | |||||||||||
| 65 | =item L<credit_card|WebService::Braintree::_::CreditCard> | ||||||||||
| 66 | |||||||||||
| 67 | =item L<credit_card_verification|WebService::Braintree::_::CreditCardVerification> | ||||||||||
| 68 | |||||||||||
| 69 | =item L<customer|WebService::Braintree::_::Customer> | ||||||||||
| 70 | |||||||||||
| 71 | =item L<dispute|WebService::Braintree::_::Dispute> | ||||||||||
| 72 | |||||||||||
| 73 | =item L<discount|WebService::Braintree::_::Discount> | ||||||||||
| 74 | |||||||||||
| 75 | =item L<document_upload|WebService::Braintree::_::DocumentUpload> | ||||||||||
| 76 | |||||||||||
| 77 | =item L<europe_bank_account|WebService::Braintree::_::EuropeBankAccount> | ||||||||||
| 78 | |||||||||||
| 79 | =item L<evidence|WebService::Braintree::_::Dispute::Evidence> | ||||||||||
| 80 | |||||||||||
| 81 | =item L<ideal_payment|WebService::Braintree::_::IdealPayment> | ||||||||||
| 82 | |||||||||||
| 83 | =item L<merchant|WebService::Braintree::_::Merchant> | ||||||||||
| 84 | |||||||||||
| 85 | =item L<merchant_account|WebService::Braintree::_::MerchantAccount> | ||||||||||
| 86 | |||||||||||
| 87 | =item L<payment_method_nonce|WebService::Braintree::_::PaymentMethodNonce> | ||||||||||
| 88 | |||||||||||
| 89 | =item L<paypal_account|WebService::Braintree::_::PayPalAccount> | ||||||||||
| 90 | |||||||||||
| 91 | =item L<settlement_batch_summary|WebService::Braintree::_::SettlementBatchSummary> | ||||||||||
| 92 | |||||||||||
| 93 | =item L<subscription|WebService::Braintree::_::Subscription> | ||||||||||
| 94 | |||||||||||
| 95 | =item L<transaction|WebService::Braintree::_::Transaction> | ||||||||||
| 96 | |||||||||||
| 97 | =item L<us_bank_account|WebService::Braintree::_::UsBankAccount> | ||||||||||
| 98 | |||||||||||
| 99 | =item L<verification|WebService::Braintree::_::CreditCardVerification> | ||||||||||
| 100 | |||||||||||
| 101 | =back | ||||||||||
| 102 | |||||||||||
| 103 | =cut | ||||||||||
| 104 | |||||||||||
| 105 | 22 | my $response_objects = { | |||||||||
| 106 | add_on => AddOn, | ||||||||||
| 107 | address => Address, | ||||||||||
| 108 | apple_pay_card => ApplePayCard, | ||||||||||
| 109 | apple_pay_options => ApplePayOptions, | ||||||||||
| 110 | credit_card => CreditCard, | ||||||||||
| 111 | credit_card_verification => CreditCardVerification, | ||||||||||
| 112 | customer => Customer, | ||||||||||
| 113 | discount => Discount, | ||||||||||
| 114 | dispute => Dispute, | ||||||||||
| 115 | document_upload => DocumentUpload, | ||||||||||
| 116 | europe_bank_account => EuropeBankAccount, | ||||||||||
| 117 | evidence => Dispute_Evidence, | ||||||||||
| 118 | ideal_payment => IdealPayment, | ||||||||||
| 119 | merchant => Merchant, | ||||||||||
| 120 | merchant_account => MerchantAccount, | ||||||||||
| 121 | payment_method_nonce => PaymentMethodNonce, | ||||||||||
| 122 | paypal_account => PayPalAccount, | ||||||||||
| 123 | settlement_batch_summary => SettlementBatchSummary, | ||||||||||
| 124 | subscription => Subscription, | ||||||||||
| 125 | transaction => Transaction, | ||||||||||
| 126 | us_bank_account => UsBankAccount, | ||||||||||
| 127 | verification => CreditCardVerification, | ||||||||||
| 128 | }; | ||||||||||
| 129 | |||||||||||
| 130 | =head2 response | ||||||||||
| 131 | |||||||||||
| 132 | This is the actual response received from Braintree. | ||||||||||
| 133 | |||||||||||
| 134 | =cut | ||||||||||
| 135 | |||||||||||
| 136 | 22 | has response => ( is => 'ro' ); | |||||||||
| 137 | |||||||||||
| 138 | 22 | ▶ | while (my ($method, $type) = each %$response_objects) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 139 | 484 | has $method => ( | |||||||||
| 140 | is => 'ro', | ||||||||||
| 141 | isa => $type, | ||||||||||
| 142 | coerce => 1, | ||||||||||
| 143 | ); | ||||||||||
| 144 | } | ||||||||||
| 145 | |||||||||||
| 146 | =head2 is_success | ||||||||||
| 147 | |||||||||||
| 148 | This always returns true. | ||||||||||
| 149 | |||||||||||
| 150 | =cut | ||||||||||
| 151 | |||||||||||
| 152 | 0 | ▶ | sub is_success { 1 } | ||||||||
|
Subroutine
is_success: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 153 | |||||||||||
| 154 | 22 | __PACKAGE__->meta->make_immutable; | |||||||||
| 155 | |||||||||||
| 156 | 22 | 1; | |||||||||
| 157 | __END__ | ||||||||||