« lib/WebService/Braintree/TransparentRedirect/QueryString.pm
↑ Summary
lib/WebService/Braintree/PaymentMethodNonceGateway.pm »
| 1 | # vim: sw=4 ts=4 ft=perl | ||||||||||
| 2 | |||||||||||
| 3 | package WebService::Braintree::_::Transaction; | ||||||||||
| 4 | 22 | $WebService::Braintree::_::Transaction::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::_::Transaction | ||||||||||
| 11 | |||||||||||
| 12 | =head1 PURPOSE | ||||||||||
| 13 | |||||||||||
| 14 | This class represents a transaction. | ||||||||||
| 15 | |||||||||||
| 16 | This class will only be created as part of a L<response|WebService::Braintree::Result> or L<error response|WebService::Braintree::ErrorResult>. | ||||||||||
| 17 | |||||||||||
| 18 | =cut | ||||||||||
| 19 | |||||||||||
| 20 | 22 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 21 | 22 | ▶ | use MooX::Aliases; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 22 | |||||||||||
| 23 | 22 | extends 'WebService::Braintree::_'; | |||||||||
| 24 | |||||||||||
| 25 | 22 | ▶ | use Types::Standard qw(ArrayRef Undef); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 26 | 22 | ▶ | use WebService::Braintree::Types qw( | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 27 | AddOn | ||||||||||
| 28 | AuthorizationAdjustment | ||||||||||
| 29 | Descriptor | ||||||||||
| 30 | Discount | ||||||||||
| 31 | Dispute | ||||||||||
| 32 | ThreeDSecureInfo | ||||||||||
| 33 | Transaction_AddressDetail | ||||||||||
| 34 | Transaction_AmexExpressCheckoutDetail | ||||||||||
| 35 | Transaction_AndroidPayDetail | ||||||||||
| 36 | Transaction_ApplePayDetail | ||||||||||
| 37 | Transaction_CoinbaseDetail | ||||||||||
| 38 | Transaction_CreditCardDetail | ||||||||||
| 39 | Transaction_CustomerDetail | ||||||||||
| 40 | Transaction_DisbursementDetail | ||||||||||
| 41 | Transaction_FacilitatedDetail | ||||||||||
| 42 | Transaction_FacilitatorDetail | ||||||||||
| 43 | Transaction_IdealPaymentDetail | ||||||||||
| 44 | Transaction_MasterpassCardDetail | ||||||||||
| 45 | Transaction_PayPalDetail | ||||||||||
| 46 | Transaction_RiskData | ||||||||||
| 47 | Transaction_StatusDetail | ||||||||||
| 48 | Transaction_SubscriptionDetail | ||||||||||
| 49 | Transaction_UsBankAccountDetail | ||||||||||
| 50 | Transaction_VenmoAccountDetail | ||||||||||
| 51 | Transaction_VisaCheckoutCardDetail | ||||||||||
| 52 | 22 | ); | |||||||||
| 53 | |||||||||||
| 54 | =head2 add_ons() | ||||||||||
| 55 | |||||||||||
| 56 | This returns the transaction's add-ons (if any). This will be an arrayref | ||||||||||
| 57 | of L<WebService::Braintree::_::AddOn/>. | ||||||||||
| 58 | |||||||||||
| 59 | =cut | ||||||||||
| 60 | |||||||||||
| 61 | 22 | has add_ons => ( | |||||||||
| 62 | is => 'ro', | ||||||||||
| 63 | isa => ArrayRef[AddOn], | ||||||||||
| 64 | coerce => 1, | ||||||||||
| 65 | ); | ||||||||||
| 66 | |||||||||||
| 67 | =head2 additional_processor_response() | ||||||||||
| 68 | |||||||||||
| 69 | This is the additional processor response for this transaction. | ||||||||||
| 70 | |||||||||||
| 71 | =cut | ||||||||||
| 72 | |||||||||||
| 73 | 22 | has additional_processor_response => ( | |||||||||
| 74 | is => 'ro', | ||||||||||
| 75 | ); | ||||||||||
| 76 | |||||||||||
| 77 | =head2 amex_express_checkout() | ||||||||||
| 78 | |||||||||||
| 79 | This returns the transaction's AMEX express checkout details (if any). This will be an object of type L<WebService::Braintree::_::Transaction::AmexExpressCheckoutDetail/>. | ||||||||||
| 80 | |||||||||||
| 81 | C<< amex_express_checkout_details() >> is an alias to this attribute. | ||||||||||
| 82 | |||||||||||
| 83 | =cut | ||||||||||
| 84 | |||||||||||
| 85 | 22 | has amex_express_checkout => ( | |||||||||
| 86 | is => 'ro', | ||||||||||
| 87 | isa => Transaction_AmexExpressCheckoutDetail, | ||||||||||
| 88 | coerce => 1, | ||||||||||
| 89 | alias => 'amex_express_checkout_details', | ||||||||||
| 90 | ); | ||||||||||
| 91 | |||||||||||
| 92 | =head2 amount() | ||||||||||
| 93 | |||||||||||
| 94 | This is the amount for this transaction. | ||||||||||
| 95 | |||||||||||
| 96 | =cut | ||||||||||
| 97 | |||||||||||
| 98 | # Coerce to "big_decimal" | ||||||||||
| 99 | 22 | has amount => ( | |||||||||
| 100 | is => 'ro', | ||||||||||
| 101 | ); | ||||||||||
| 102 | |||||||||||
| 103 | =head2 android_pay() | ||||||||||
| 104 | |||||||||||
| 105 | This returns the transaction's AndroidPay details (if any). This will be an object of type L<WebService::Braintree::_::Transaction::AndroidPayDetail/>. | ||||||||||
| 106 | |||||||||||
| 107 | C<< android_pay_details() >> is an alias to this attribute. | ||||||||||
| 108 | |||||||||||
| 109 | =cut | ||||||||||
| 110 | |||||||||||
| 111 | 22 | has android_pay => ( | |||||||||
| 112 | is => 'ro', | ||||||||||
| 113 | isa => Transaction_AndroidPayDetail, | ||||||||||
| 114 | coerce => 1, | ||||||||||
| 115 | alias => 'android_pay_details', | ||||||||||
| 116 | ); | ||||||||||
| 117 | |||||||||||
| 118 | =head2 apple_pay() | ||||||||||
| 119 | |||||||||||
| 120 | This returns the transaction's ApplePay details (if any). This will be an object of type L<WebService::Braintree::_::Transaction::ApplePayDetail/>. | ||||||||||
| 121 | |||||||||||
| 122 | C<< apple_pay_details() >> is an alias to this attribute. | ||||||||||
| 123 | |||||||||||
| 124 | =cut | ||||||||||
| 125 | |||||||||||
| 126 | 22 | has apple_pay => ( | |||||||||
| 127 | is => 'ro', | ||||||||||
| 128 | isa => Transaction_ApplePayDetail, | ||||||||||
| 129 | coerce => 1, | ||||||||||
| 130 | alias => 'apple_pay_details', | ||||||||||
| 131 | ); | ||||||||||
| 132 | |||||||||||
| 133 | =head2 authorization_adjustments() | ||||||||||
| 134 | |||||||||||
| 135 | This returns the transaction's authorization adjustments (if any). This will be an arrayref | ||||||||||
| 136 | of L<WebService::Braintree::_::AuthorizationAdjustment/>. | ||||||||||
| 137 | |||||||||||
| 138 | =cut | ||||||||||
| 139 | |||||||||||
| 140 | 22 | has authorization_adjustments => ( | |||||||||
| 141 | is => 'ro', | ||||||||||
| 142 | isa => ArrayRef[AuthorizationAdjustment], | ||||||||||
| 143 | coerce => 1, | ||||||||||
| 144 | ); | ||||||||||
| 145 | |||||||||||
| 146 | =head2 authorized_transaction_id() | ||||||||||
| 147 | |||||||||||
| 148 | This is the authorized transaction id for this transaction. | ||||||||||
| 149 | |||||||||||
| 150 | =cut | ||||||||||
| 151 | |||||||||||
| 152 | 22 | has authorized_transaction_id => ( | |||||||||
| 153 | is => 'ro', | ||||||||||
| 154 | ); | ||||||||||
| 155 | |||||||||||
| 156 | =head2 avs_error_response_code() | ||||||||||
| 157 | |||||||||||
| 158 | This is the avs error response code for this transaction. | ||||||||||
| 159 | |||||||||||
| 160 | =cut | ||||||||||
| 161 | |||||||||||
| 162 | 22 | has avs_error_response_code => ( | |||||||||
| 163 | is => 'ro', | ||||||||||
| 164 | ); | ||||||||||
| 165 | |||||||||||
| 166 | =head2 avs_postal_code_response_code() | ||||||||||
| 167 | |||||||||||
| 168 | This is the avs postal code response code for this transaction. | ||||||||||
| 169 | |||||||||||
| 170 | =cut | ||||||||||
| 171 | |||||||||||
| 172 | 22 | has avs_postal_code_response_code => ( | |||||||||
| 173 | is => 'ro', | ||||||||||
| 174 | ); | ||||||||||
| 175 | |||||||||||
| 176 | =head2 avs_street_address_response_code() | ||||||||||
| 177 | |||||||||||
| 178 | This is the avs street address response code for this transaction. | ||||||||||
| 179 | |||||||||||
| 180 | =cut | ||||||||||
| 181 | |||||||||||
| 182 | 22 | has avs_street_address_response_code => ( | |||||||||
| 183 | is => 'ro', | ||||||||||
| 184 | ); | ||||||||||
| 185 | |||||||||||
| 186 | =head2 billing() | ||||||||||
| 187 | |||||||||||
| 188 | This returns the transaction's billing details (if any). This will be an object of type L<WebService::Braintree::_::Transaction::AddressDetail/>. | ||||||||||
| 189 | |||||||||||
| 190 | C<< billing_details() >> is an alias to this attribute. | ||||||||||
| 191 | |||||||||||
| 192 | =cut | ||||||||||
| 193 | |||||||||||
| 194 | 22 | has billing => ( | |||||||||
| 195 | is => 'ro', | ||||||||||
| 196 | isa => Transaction_AddressDetail, | ||||||||||
| 197 | coerce => 1, | ||||||||||
| 198 | alias => 'billing_details', | ||||||||||
| 199 | ); | ||||||||||
| 200 | |||||||||||
| 201 | =head2 channel() | ||||||||||
| 202 | |||||||||||
| 203 | This is the channel for this transaction. | ||||||||||
| 204 | |||||||||||
| 205 | =cut | ||||||||||
| 206 | |||||||||||
| 207 | 22 | has channel => ( | |||||||||
| 208 | is => 'ro', | ||||||||||
| 209 | ); | ||||||||||
| 210 | |||||||||||
| 211 | =head2 coinbase() | ||||||||||
| 212 | |||||||||||
| 213 | This returns the transaction's Coinbase details (if any). This will be an object of type L<WebService::Braintree::_::Transaction::CoinbaseDetail/>. | ||||||||||
| 214 | |||||||||||
| 215 | C<< coinbase_details() >> is an alias to this attribute. | ||||||||||
| 216 | |||||||||||
| 217 | =cut | ||||||||||
| 218 | |||||||||||
| 219 | 22 | has coinbase => ( | |||||||||
| 220 | is => 'ro', | ||||||||||
| 221 | isa => Transaction_CoinbaseDetail, | ||||||||||
| 222 | coerce => 1, | ||||||||||
| 223 | alias => 'coinbase_details', | ||||||||||
| 224 | ); | ||||||||||
| 225 | |||||||||||
| 226 | =head2 created_at() | ||||||||||
| 227 | |||||||||||
| 228 | This is when this transaction was created. | ||||||||||
| 229 | |||||||||||
| 230 | =cut | ||||||||||
| 231 | |||||||||||
| 232 | # Coerce this to DateTime | ||||||||||
| 233 | 22 | has created_at => ( | |||||||||
| 234 | is => 'ro', | ||||||||||
| 235 | ); | ||||||||||
| 236 | |||||||||||
| 237 | =head2 credit_card() | ||||||||||
| 238 | |||||||||||
| 239 | This returns the transaction's credit-card details (if any). This will be an object of type L<WebService::Braintree::_::Transaction::CreditCardDetail/>. | ||||||||||
| 240 | |||||||||||
| 241 | C<< credit_card_details() >> is an alias to this attribute. | ||||||||||
| 242 | |||||||||||
| 243 | =cut | ||||||||||
| 244 | |||||||||||
| 245 | 22 | has credit_card => ( | |||||||||
| 246 | is => 'ro', | ||||||||||
| 247 | isa => Transaction_CreditCardDetail, | ||||||||||
| 248 | coerce => 1, | ||||||||||
| 249 | alias => 'credit_card_details', | ||||||||||
| 250 | ); | ||||||||||
| 251 | |||||||||||
| 252 | =head2 currency_iso_code() | ||||||||||
| 253 | |||||||||||
| 254 | This is the currency ISO code for this transaction. | ||||||||||
| 255 | |||||||||||
| 256 | =cut | ||||||||||
| 257 | |||||||||||
| 258 | 22 | has currency_iso_code => ( | |||||||||
| 259 | is => 'ro', | ||||||||||
| 260 | ); | ||||||||||
| 261 | |||||||||||
| 262 | =head2 custom_fields() | ||||||||||
| 263 | |||||||||||
| 264 | This is the custom fields for this transaction. This will be a hashref. | ||||||||||
| 265 | |||||||||||
| 266 | =cut | ||||||||||
| 267 | |||||||||||
| 268 | # Require this to be a HashRef (?) | ||||||||||
| 269 | has custom_fields => ( | ||||||||||
| 270 | is => 'ro', | ||||||||||
| 271 | 3 | ▶ | default => sub { {} }, | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 272 | 22 | ); | |||||||||
| 273 | |||||||||||
| 274 | =head2 customer() | ||||||||||
| 275 | |||||||||||
| 276 | This returns the transaction's customer details (if any). This will be an object of type L<WebService::Braintree::_::Transaction::CustomerDetail/>. | ||||||||||
| 277 | |||||||||||
| 278 | C<< customer_details() >> is an alias to this attribute. | ||||||||||
| 279 | |||||||||||
| 280 | =cut | ||||||||||
| 281 | |||||||||||
| 282 | 22 | has customer => ( | |||||||||
| 283 | is => 'ro', | ||||||||||
| 284 | isa => Transaction_CustomerDetail, | ||||||||||
| 285 | coerce => 1, | ||||||||||
| 286 | alias => 'customer_details', | ||||||||||
| 287 | ); | ||||||||||
| 288 | |||||||||||
| 289 | =head2 cvv_response_code() | ||||||||||
| 290 | |||||||||||
| 291 | This is the CVV response code for this transaction. | ||||||||||
| 292 | |||||||||||
| 293 | =cut | ||||||||||
| 294 | |||||||||||
| 295 | 22 | has cvv_response_code => ( | |||||||||
| 296 | is => 'ro', | ||||||||||
| 297 | ); | ||||||||||
| 298 | |||||||||||
| 299 | =head2 descriptor() | ||||||||||
| 300 | |||||||||||
| 301 | This returns the transaction's descriptor (if any). This will be an object of type L<WebService::Braintree::_::Descriptor/>. | ||||||||||
| 302 | |||||||||||
| 303 | =cut | ||||||||||
| 304 | |||||||||||
| 305 | 22 | has descriptor => ( | |||||||||
| 306 | is => 'ro', | ||||||||||
| 307 | isa => Descriptor, | ||||||||||
| 308 | coerce => 1, | ||||||||||
| 309 | ); | ||||||||||
| 310 | |||||||||||
| 311 | =head2 disbursement() | ||||||||||
| 312 | |||||||||||
| 313 | This returns the transaction's disbursement details (if any). This will be an object of type L<WebService::Braintree::_::Transaction::DisbursementDetail/>. | ||||||||||
| 314 | |||||||||||
| 315 | C<< disbursement_details() >> is an alias to this attribute. | ||||||||||
| 316 | |||||||||||
| 317 | =cut | ||||||||||
| 318 | |||||||||||
| 319 | 22 | has disbursement => ( | |||||||||
| 320 | is => 'ro', | ||||||||||
| 321 | isa => Transaction_DisbursementDetail, | ||||||||||
| 322 | coerce => 1, | ||||||||||
| 323 | alias => 'disbursement_details', | ||||||||||
| 324 | ); | ||||||||||
| 325 | |||||||||||
| 326 | =head2 discount_amount() | ||||||||||
| 327 | |||||||||||
| 328 | This is the discount amount for this transaction. | ||||||||||
| 329 | |||||||||||
| 330 | =cut | ||||||||||
| 331 | |||||||||||
| 332 | 22 | has discount_amount => ( | |||||||||
| 333 | is => 'ro', | ||||||||||
| 334 | ); | ||||||||||
| 335 | |||||||||||
| 336 | =head2 discounts() | ||||||||||
| 337 | |||||||||||
| 338 | This returns the transaction's discounts (if any). This will be an arrayref | ||||||||||
| 339 | of L<WebService::Braintree::_::Discount/>. | ||||||||||
| 340 | |||||||||||
| 341 | =cut | ||||||||||
| 342 | |||||||||||
| 343 | 22 | has discounts => ( | |||||||||
| 344 | is => 'ro', | ||||||||||
| 345 | isa => ArrayRef[Discount], | ||||||||||
| 346 | coerce => 1, | ||||||||||
| 347 | ); | ||||||||||
| 348 | |||||||||||
| 349 | =head2 disputes() | ||||||||||
| 350 | |||||||||||
| 351 | This returns the transaction's disputes (if any). This will be an arrayref | ||||||||||
| 352 | of L<WebService::Braintree::_::Dispute/>. | ||||||||||
| 353 | |||||||||||
| 354 | =cut | ||||||||||
| 355 | |||||||||||
| 356 | 22 | has disputes => ( | |||||||||
| 357 | is => 'ro', | ||||||||||
| 358 | isa => ArrayRef[Dispute], | ||||||||||
| 359 | coerce => 1, | ||||||||||
| 360 | ); | ||||||||||
| 361 | |||||||||||
| 362 | =head2 escrow_status() | ||||||||||
| 363 | |||||||||||
| 364 | This is the escrow status for this transaction. | ||||||||||
| 365 | |||||||||||
| 366 | =cut | ||||||||||
| 367 | |||||||||||
| 368 | 22 | has escrow_status => ( | |||||||||
| 369 | is => 'ro', | ||||||||||
| 370 | ); | ||||||||||
| 371 | |||||||||||
| 372 | =head2 facilitated_details() | ||||||||||
| 373 | |||||||||||
| 374 | This returns the transaction's facilitated details (if any). This will be an object of type L<WebService::Braintree::_::Transaction::FacilitatedDetail/>. | ||||||||||
| 375 | |||||||||||
| 376 | =cut | ||||||||||
| 377 | |||||||||||
| 378 | 22 | has facilitated_details => ( | |||||||||
| 379 | is => 'ro', | ||||||||||
| 380 | isa => Transaction_FacilitatedDetail, | ||||||||||
| 381 | coerce => 1, | ||||||||||
| 382 | ); | ||||||||||
| 383 | |||||||||||
| 384 | =head2 facilitator_details() | ||||||||||
| 385 | |||||||||||
| 386 | This returns the transaction's facilitator details (if any). This will be an object of type L<WebService::Braintree::_::Transaction::FacilitatorDetail/>. | ||||||||||
| 387 | |||||||||||
| 388 | =cut | ||||||||||
| 389 | |||||||||||
| 390 | 22 | has facilitator_details => ( | |||||||||
| 391 | is => 'ro', | ||||||||||
| 392 | isa => Transaction_FacilitatorDetail, | ||||||||||
| 393 | coerce => 1, | ||||||||||
| 394 | ); | ||||||||||
| 395 | |||||||||||
| 396 | =head2 gateway_rejection_reason() | ||||||||||
| 397 | |||||||||||
| 398 | This is the gateway rejection reason for this transaction. | ||||||||||
| 399 | |||||||||||
| 400 | =cut | ||||||||||
| 401 | |||||||||||
| 402 | 22 | has gateway_rejection_reason => ( | |||||||||
| 403 | is => 'ro', | ||||||||||
| 404 | ); | ||||||||||
| 405 | |||||||||||
| 406 | =head2 id() | ||||||||||
| 407 | |||||||||||
| 408 | This is the id for this transaction. | ||||||||||
| 409 | |||||||||||
| 410 | =cut | ||||||||||
| 411 | |||||||||||
| 412 | 22 | has id => ( | |||||||||
| 413 | is => 'ro', | ||||||||||
| 414 | ); | ||||||||||
| 415 | |||||||||||
| 416 | =head2 ideal_payment() | ||||||||||
| 417 | |||||||||||
| 418 | This returns the transaction's IdealPayment details (if any). This will be an object of type L<WebService::Braintree::_::Transaction::IdealPaymentDetail/>. | ||||||||||
| 419 | |||||||||||
| 420 | C<< ideal_payment_details() >> is an alias to this attribute. | ||||||||||
| 421 | |||||||||||
| 422 | =cut | ||||||||||
| 423 | |||||||||||
| 424 | 22 | has ideal_payment => ( | |||||||||
| 425 | is => 'ro', | ||||||||||
| 426 | isa => Transaction_IdealPaymentDetail, | ||||||||||
| 427 | coerce => 1, | ||||||||||
| 428 | alias => 'ideal_payment_details', | ||||||||||
| 429 | ); | ||||||||||
| 430 | |||||||||||
| 431 | =head2 masterpass_card() | ||||||||||
| 432 | |||||||||||
| 433 | This returns the transaction's MasterpassCard details (if any). This will be an object of type L<WebService::Braintree::_::Transaction::MasterpassCardDetail/>. | ||||||||||
| 434 | |||||||||||
| 435 | C<< masterpass_card_details() >> is an alias to this attribute. | ||||||||||
| 436 | |||||||||||
| 437 | =cut | ||||||||||
| 438 | |||||||||||
| 439 | 22 | has masterpass_card => ( | |||||||||
| 440 | is => 'ro', | ||||||||||
| 441 | isa => Transaction_MasterpassCardDetail, | ||||||||||
| 442 | coerce => 1, | ||||||||||
| 443 | alias => 'masterpass_card_details', | ||||||||||
| 444 | ); | ||||||||||
| 445 | |||||||||||
| 446 | =head2 master_merchant_account_id() | ||||||||||
| 447 | |||||||||||
| 448 | This is the master merchant account id for this transaction. | ||||||||||
| 449 | |||||||||||
| 450 | =cut | ||||||||||
| 451 | |||||||||||
| 452 | 22 | has master_merchant_account_id => ( | |||||||||
| 453 | is => 'ro', | ||||||||||
| 454 | ); | ||||||||||
| 455 | |||||||||||
| 456 | =head2 merchant_account_id() | ||||||||||
| 457 | |||||||||||
| 458 | This is the merchant account id for this transaction. | ||||||||||
| 459 | |||||||||||
| 460 | =cut | ||||||||||
| 461 | |||||||||||
| 462 | 22 | has merchant_account_id => ( | |||||||||
| 463 | is => 'ro', | ||||||||||
| 464 | ); | ||||||||||
| 465 | |||||||||||
| 466 | =head2 never_expires() | ||||||||||
| 467 | |||||||||||
| 468 | This is true if this transaction never expires. | ||||||||||
| 469 | |||||||||||
| 470 | C<< is_never_expires() >> is an alias for this attribute. | ||||||||||
| 471 | |||||||||||
| 472 | =cut | ||||||||||
| 473 | |||||||||||
| 474 | 22 | has never_expires => ( | |||||||||
| 475 | is => 'ro', | ||||||||||
| 476 | alias => 'is_never_expires', | ||||||||||
| 477 | ); | ||||||||||
| 478 | |||||||||||
| 479 | =head2 options() | ||||||||||
| 480 | |||||||||||
| 481 | This is the options for this transaction. | ||||||||||
| 482 | |||||||||||
| 483 | =cut | ||||||||||
| 484 | |||||||||||
| 485 | 22 | has options => ( | |||||||||
| 486 | is => 'ro', | ||||||||||
| 487 | ); | ||||||||||
| 488 | |||||||||||
| 489 | =head2 order_id() | ||||||||||
| 490 | |||||||||||
| 491 | This is the order id for this transaction. | ||||||||||
| 492 | |||||||||||
| 493 | =cut | ||||||||||
| 494 | |||||||||||
| 495 | 22 | has order_id => ( | |||||||||
| 496 | is => 'ro', | ||||||||||
| 497 | ); | ||||||||||
| 498 | |||||||||||
| 499 | =head2 partial_settlement_transaction_ids() | ||||||||||
| 500 | |||||||||||
| 501 | This is the partial settlement transaction ids for this transaction. | ||||||||||
| 502 | |||||||||||
| 503 | =cut | ||||||||||
| 504 | |||||||||||
| 505 | 22 | has partial_settlement_transaction_ids => ( | |||||||||
| 506 | is => 'ro', | ||||||||||
| 507 | ); | ||||||||||
| 508 | |||||||||||
| 509 | =head2 payment_instrument_type() | ||||||||||
| 510 | |||||||||||
| 511 | This is the payment instrument type for this transaction. | ||||||||||
| 512 | |||||||||||
| 513 | =cut | ||||||||||
| 514 | |||||||||||
| 515 | 22 | has payment_instrument_type => ( | |||||||||
| 516 | is => 'ro', | ||||||||||
| 517 | ); | ||||||||||
| 518 | |||||||||||
| 519 | =head2 paypal() | ||||||||||
| 520 | |||||||||||
| 521 | This returns the transaction's PayPal details (if any). This will be an object of type L<WebService::Braintree::_::Transaction::PayPalDetail/>. | ||||||||||
| 522 | |||||||||||
| 523 | C<< paypal_details() >> is an alias to this attribute. | ||||||||||
| 524 | |||||||||||
| 525 | =cut | ||||||||||
| 526 | |||||||||||
| 527 | 22 | has paypal => ( | |||||||||
| 528 | is => 'ro', | ||||||||||
| 529 | isa => Transaction_PayPalDetail, | ||||||||||
| 530 | coerce => 1, | ||||||||||
| 531 | alias => 'paypal_details', | ||||||||||
| 532 | ); | ||||||||||
| 533 | |||||||||||
| 534 | =head2 plan_id() | ||||||||||
| 535 | |||||||||||
| 536 | This is the plan id for this transaction. | ||||||||||
| 537 | |||||||||||
| 538 | =cut | ||||||||||
| 539 | |||||||||||
| 540 | 22 | has plan_id => ( | |||||||||
| 541 | is => 'ro', | ||||||||||
| 542 | ); | ||||||||||
| 543 | |||||||||||
| 544 | =head2 processor_authorization_code() | ||||||||||
| 545 | |||||||||||
| 546 | This is the process authorization code for this transaction. | ||||||||||
| 547 | |||||||||||
| 548 | =cut | ||||||||||
| 549 | |||||||||||
| 550 | 22 | has processor_authorization_code => ( | |||||||||
| 551 | is => 'ro', | ||||||||||
| 552 | ); | ||||||||||
| 553 | |||||||||||
| 554 | =head2 processor_response_code() | ||||||||||
| 555 | |||||||||||
| 556 | This is the processor response code for this transaction. | ||||||||||
| 557 | |||||||||||
| 558 | =cut | ||||||||||
| 559 | |||||||||||
| 560 | 22 | has processor_response_code => ( | |||||||||
| 561 | is => 'ro', | ||||||||||
| 562 | ); | ||||||||||
| 563 | |||||||||||
| 564 | =head2 processor_response_text() | ||||||||||
| 565 | |||||||||||
| 566 | This is the processor response text for this transaction. | ||||||||||
| 567 | |||||||||||
| 568 | =cut | ||||||||||
| 569 | |||||||||||
| 570 | 22 | has processor_response_text => ( | |||||||||
| 571 | is => 'ro', | ||||||||||
| 572 | ); | ||||||||||
| 573 | |||||||||||
| 574 | =head2 processor_settlement_response_Code() | ||||||||||
| 575 | |||||||||||
| 576 | This is the processor settlement response code for this transaction. | ||||||||||
| 577 | |||||||||||
| 578 | =cut | ||||||||||
| 579 | |||||||||||
| 580 | 22 | has processor_settlement_response_code => ( | |||||||||
| 581 | is => 'ro', | ||||||||||
| 582 | ); | ||||||||||
| 583 | |||||||||||
| 584 | =head2 processor_settlement_response_text() | ||||||||||
| 585 | |||||||||||
| 586 | This is the processor settlement response text for this transaction. | ||||||||||
| 587 | |||||||||||
| 588 | =cut | ||||||||||
| 589 | |||||||||||
| 590 | 22 | has processor_settlement_response_text => ( | |||||||||
| 591 | is => 'ro', | ||||||||||
| 592 | ); | ||||||||||
| 593 | |||||||||||
| 594 | =head2 purchase_order_number() | ||||||||||
| 595 | |||||||||||
| 596 | This is the purchase order number for this transaction. | ||||||||||
| 597 | |||||||||||
| 598 | =cut | ||||||||||
| 599 | |||||||||||
| 600 | 22 | has purchase_order_number => ( | |||||||||
| 601 | is => 'ro', | ||||||||||
| 602 | ); | ||||||||||
| 603 | |||||||||||
| 604 | =head2 recurring() | ||||||||||
| 605 | |||||||||||
| 606 | This is true if this transaction is recurring. | ||||||||||
| 607 | |||||||||||
| 608 | C<< is_recurring() >> is an alias for this attribute. | ||||||||||
| 609 | |||||||||||
| 610 | =cut | ||||||||||
| 611 | |||||||||||
| 612 | 22 | has recurring => ( | |||||||||
| 613 | is => 'ro', | ||||||||||
| 614 | alias => 'is_recurring', | ||||||||||
| 615 | ); | ||||||||||
| 616 | |||||||||||
| 617 | =head2 refund_id() | ||||||||||
| 618 | |||||||||||
| 619 | This is the refund id for this transaction. | ||||||||||
| 620 | |||||||||||
| 621 | =cut | ||||||||||
| 622 | |||||||||||
| 623 | 22 | has refund_id => ( | |||||||||
| 624 | is => 'ro', | ||||||||||
| 625 | ); | ||||||||||
| 626 | |||||||||||
| 627 | =head2 refund_ids() | ||||||||||
| 628 | |||||||||||
| 629 | This is the refund ids for this transaction. | ||||||||||
| 630 | |||||||||||
| 631 | =cut | ||||||||||
| 632 | |||||||||||
| 633 | 22 | has refund_ids => ( | |||||||||
| 634 | is => 'ro', | ||||||||||
| 635 | ); | ||||||||||
| 636 | |||||||||||
| 637 | =head2 refunded_transaction_id() | ||||||||||
| 638 | |||||||||||
| 639 | This is the refunded transaction id for this transaction. | ||||||||||
| 640 | |||||||||||
| 641 | =cut | ||||||||||
| 642 | |||||||||||
| 643 | 22 | has refunded_transaction_id => ( | |||||||||
| 644 | is => 'ro', | ||||||||||
| 645 | ); | ||||||||||
| 646 | |||||||||||
| 647 | =head2 risk_data() | ||||||||||
| 648 | |||||||||||
| 649 | This returns the transaction's risk data details (if any). This will be an object of type L<WebService::Braintree::_::Transaction::RiskData/>. | ||||||||||
| 650 | |||||||||||
| 651 | =cut | ||||||||||
| 652 | |||||||||||
| 653 | 22 | has risk_data => ( | |||||||||
| 654 | is => 'ro', | ||||||||||
| 655 | isa => Transaction_RiskData, | ||||||||||
| 656 | coerce => 1, | ||||||||||
| 657 | ); | ||||||||||
| 658 | |||||||||||
| 659 | =head2 service_fee_amount() | ||||||||||
| 660 | |||||||||||
| 661 | This is the service fee amount for this transaction. | ||||||||||
| 662 | |||||||||||
| 663 | =cut | ||||||||||
| 664 | |||||||||||
| 665 | # Coerce to "big_decimal" | ||||||||||
| 666 | 22 | has service_fee_amount => ( | |||||||||
| 667 | is => 'ro', | ||||||||||
| 668 | ); | ||||||||||
| 669 | |||||||||||
| 670 | =head2 settlement_batch_id() | ||||||||||
| 671 | |||||||||||
| 672 | This is the settlement_batch_id for this transaction. | ||||||||||
| 673 | |||||||||||
| 674 | =cut | ||||||||||
| 675 | |||||||||||
| 676 | 22 | has settlement_batch_id => ( | |||||||||
| 677 | is => 'ro', | ||||||||||
| 678 | ); | ||||||||||
| 679 | |||||||||||
| 680 | =head2 shipping_amount() | ||||||||||
| 681 | |||||||||||
| 682 | This is the shipping amount for this transaction. | ||||||||||
| 683 | |||||||||||
| 684 | =cut | ||||||||||
| 685 | |||||||||||
| 686 | 22 | has shipping_amount => ( | |||||||||
| 687 | is => 'ro', | ||||||||||
| 688 | ); | ||||||||||
| 689 | |||||||||||
| 690 | =head2 shipping() | ||||||||||
| 691 | |||||||||||
| 692 | This returns the transaction's shipping details (if any). This will be an object of type L<WebService::Braintree::_::Transaction::AddressDetail/>. | ||||||||||
| 693 | |||||||||||
| 694 | C<< shipping_details() >> is an alias to this attribute. | ||||||||||
| 695 | |||||||||||
| 696 | =cut | ||||||||||
| 697 | |||||||||||
| 698 | 22 | has shipping => ( | |||||||||
| 699 | is => 'ro', | ||||||||||
| 700 | isa => Transaction_AddressDetail, | ||||||||||
| 701 | coerce => 1, | ||||||||||
| 702 | alias => 'shipping_details', | ||||||||||
| 703 | ); | ||||||||||
| 704 | |||||||||||
| 705 | =head2 ships_from_postal_code() | ||||||||||
| 706 | |||||||||||
| 707 | This is the ships from postal code for this transaction. | ||||||||||
| 708 | |||||||||||
| 709 | =cut | ||||||||||
| 710 | |||||||||||
| 711 | 22 | has ships_from_postal_code => ( | |||||||||
| 712 | is => 'ro', | ||||||||||
| 713 | ); | ||||||||||
| 714 | |||||||||||
| 715 | =head2 status() | ||||||||||
| 716 | |||||||||||
| 717 | This is the status for this transaction. | ||||||||||
| 718 | |||||||||||
| 719 | =cut | ||||||||||
| 720 | |||||||||||
| 721 | 22 | has status => ( | |||||||||
| 722 | is => 'ro', | ||||||||||
| 723 | ); | ||||||||||
| 724 | |||||||||||
| 725 | =head2 balance() | ||||||||||
| 726 | |||||||||||
| 727 | This is the balance for this transaction. | ||||||||||
| 728 | |||||||||||
| 729 | =cut | ||||||||||
| 730 | |||||||||||
| 731 | 22 | has status_history => ( | |||||||||
| 732 | is => 'ro', | ||||||||||
| 733 | isa => ArrayRef[Transaction_StatusDetail], | ||||||||||
| 734 | coerce => 1, | ||||||||||
| 735 | ); | ||||||||||
| 736 | |||||||||||
| 737 | =head2 sub_merchant_account_id() | ||||||||||
| 738 | |||||||||||
| 739 | This is the sub merchant account id for this transaction. | ||||||||||
| 740 | |||||||||||
| 741 | =cut | ||||||||||
| 742 | |||||||||||
| 743 | 22 | has sub_merchant_account_id => ( | |||||||||
| 744 | is => 'ro', | ||||||||||
| 745 | ); | ||||||||||
| 746 | |||||||||||
| 747 | =head2 balance() | ||||||||||
| 748 | |||||||||||
| 749 | This is the balance for this transaction. | ||||||||||
| 750 | |||||||||||
| 751 | =cut | ||||||||||
| 752 | |||||||||||
| 753 | 22 | has subscription => ( | |||||||||
| 754 | is => 'ro', | ||||||||||
| 755 | isa => Transaction_SubscriptionDetail, | ||||||||||
| 756 | coerce => 1, | ||||||||||
| 757 | alias => 'subscription_details', | ||||||||||
| 758 | ); | ||||||||||
| 759 | |||||||||||
| 760 | =head2 subscription_id() | ||||||||||
| 761 | |||||||||||
| 762 | This is the subscription id for this transaction. | ||||||||||
| 763 | |||||||||||
| 764 | =cut | ||||||||||
| 765 | |||||||||||
| 766 | 22 | has subscription_id => ( | |||||||||
| 767 | is => 'ro', | ||||||||||
| 768 | ); | ||||||||||
| 769 | |||||||||||
| 770 | =head2 tax_amount() | ||||||||||
| 771 | |||||||||||
| 772 | This is the tax amount for this transaction. | ||||||||||
| 773 | |||||||||||
| 774 | =cut | ||||||||||
| 775 | |||||||||||
| 776 | # Coerce to "big_decimal" | ||||||||||
| 777 | 22 | has tax_amount => ( | |||||||||
| 778 | is => 'ro', | ||||||||||
| 779 | ); | ||||||||||
| 780 | |||||||||||
| 781 | =head2 tax_exempt() | ||||||||||
| 782 | |||||||||||
| 783 | This is true if this transaction is tax-exempt. | ||||||||||
| 784 | |||||||||||
| 785 | C<< is_tax_exempt() >> is an alias for this attribute. | ||||||||||
| 786 | |||||||||||
| 787 | =cut | ||||||||||
| 788 | |||||||||||
| 789 | 22 | has tax_exempt => ( | |||||||||
| 790 | is => 'ro', | ||||||||||
| 791 | alias => 'is_tax_exempt', | ||||||||||
| 792 | ); | ||||||||||
| 793 | |||||||||||
| 794 | =head2 balance() | ||||||||||
| 795 | |||||||||||
| 796 | This is the balance for this transaction. | ||||||||||
| 797 | |||||||||||
| 798 | =cut | ||||||||||
| 799 | |||||||||||
| 800 | 22 | has three_d_secure_info => ( | |||||||||
| 801 | is => 'ro', | ||||||||||
| 802 | isa => ThreeDSecureInfo|Undef, | ||||||||||
| 803 | coerce => 1, | ||||||||||
| 804 | ); | ||||||||||
| 805 | |||||||||||
| 806 | =head2 type() | ||||||||||
| 807 | |||||||||||
| 808 | This is the type for this transaction. | ||||||||||
| 809 | |||||||||||
| 810 | =cut | ||||||||||
| 811 | |||||||||||
| 812 | 22 | has type => ( | |||||||||
| 813 | is => 'ro', | ||||||||||
| 814 | ); | ||||||||||
| 815 | |||||||||||
| 816 | =head2 updated_at() | ||||||||||
| 817 | |||||||||||
| 818 | This is when this transaction was last updated. If it has never been updated, | ||||||||||
| 819 | then this should equal the L</created_at> date. | ||||||||||
| 820 | |||||||||||
| 821 | =cut | ||||||||||
| 822 | |||||||||||
| 823 | # Coerce this to a DateTime | ||||||||||
| 824 | 22 | has updated_at => ( | |||||||||
| 825 | is => 'ro', | ||||||||||
| 826 | ); | ||||||||||
| 827 | |||||||||||
| 828 | =head2 balance() | ||||||||||
| 829 | |||||||||||
| 830 | This is the balance for this transaction. | ||||||||||
| 831 | |||||||||||
| 832 | =cut | ||||||||||
| 833 | |||||||||||
| 834 | 22 | has us_bank_account => ( | |||||||||
| 835 | is => 'ro', | ||||||||||
| 836 | isa => Transaction_UsBankAccountDetail, | ||||||||||
| 837 | coerce => 1, | ||||||||||
| 838 | alias => 'us_bank_account_details', | ||||||||||
| 839 | ); | ||||||||||
| 840 | |||||||||||
| 841 | =head2 balance() | ||||||||||
| 842 | |||||||||||
| 843 | This is the balance for this transaction. | ||||||||||
| 844 | |||||||||||
| 845 | =cut | ||||||||||
| 846 | |||||||||||
| 847 | 22 | has venmo_account => ( | |||||||||
| 848 | is => 'ro', | ||||||||||
| 849 | isa => Transaction_VenmoAccountDetail, | ||||||||||
| 850 | coerce => 1, | ||||||||||
| 851 | alias => 'venmo_account_details', | ||||||||||
| 852 | ); | ||||||||||
| 853 | |||||||||||
| 854 | =head2 balance() | ||||||||||
| 855 | |||||||||||
| 856 | This is the balance for this transaction. | ||||||||||
| 857 | |||||||||||
| 858 | =cut | ||||||||||
| 859 | |||||||||||
| 860 | 22 | has visa_checkout_card => ( | |||||||||
| 861 | is => 'ro', | ||||||||||
| 862 | isa => Transaction_VisaCheckoutCardDetail, | ||||||||||
| 863 | coerce => 1, | ||||||||||
| 864 | alias => 'visa_checkout_card_details', | ||||||||||
| 865 | ); | ||||||||||
| 866 | |||||||||||
| 867 | =head2 voice_referral_number() | ||||||||||
| 868 | |||||||||||
| 869 | This is the voice referral number for this transaction. | ||||||||||
| 870 | |||||||||||
| 871 | =cut | ||||||||||
| 872 | |||||||||||
| 873 | 22 | has voice_referral_number => ( | |||||||||
| 874 | is => 'ro', | ||||||||||
| 875 | ); | ||||||||||
| 876 | |||||||||||
| 877 | =head1 METHODS | ||||||||||
| 878 | |||||||||||
| 879 | =cut | ||||||||||
| 880 | |||||||||||
| 881 | =head2 line_items() | ||||||||||
| 882 | |||||||||||
| 883 | This returns all the line-items. | ||||||||||
| 884 | |||||||||||
| 885 | =cut | ||||||||||
| 886 | |||||||||||
| 887 | 0 | ▶ | sub line_items() { | ||||||||
|
Subroutine
line_items: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 888 | 0 | my $self = shift; | |||||||||
| 889 | 0 | WebService::Braintree::TransactionLineItem->find_all($self->id); | |||||||||
| 890 | } | ||||||||||
| 891 | |||||||||||
| 892 | =head2 is_disbursed() | ||||||||||
| 893 | |||||||||||
| 894 | This returns whether or not the L</disbursement_details> are valid. | ||||||||||
| 895 | |||||||||||
| 896 | =cut | ||||||||||
| 897 | |||||||||||
| 898 | 0 | ▶ | sub is_disbursed { | ||||||||
|
Subroutine
is_disbursed: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 899 | 0 | shift->disbursement_details->is_valid(); | |||||||||
| 900 | } | ||||||||||
| 901 | |||||||||||
| 902 | =head2 is_refunded() | ||||||||||
| 903 | |||||||||||
| 904 | This returns whether or not this transaction has a refund id. | ||||||||||
| 905 | |||||||||||
| 906 | =cut | ||||||||||
| 907 | |||||||||||
| 908 | # This is going against refund_id, not refund_ids | ||||||||||
| 909 | 0 | ▶ | sub is_refunded { | ||||||||
|
Subroutine
is_refunded: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 910 | 0 | my $self = shift; | |||||||||
| 911 | 0 | !!$self->refund_id | |||||||||
| 912 | } | ||||||||||
| 913 | |||||||||||
| 914 | =head2 vault_billing_address() | ||||||||||
| 915 | |||||||||||
| 916 | This returns the billing address of the customer. | ||||||||||
| 917 | |||||||||||
| 918 | =cut | ||||||||||
| 919 | |||||||||||
| 920 | 0 | ▶ | sub vault_billing_address { | ||||||||
|
Subroutine
vault_billing_address: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 921 | 0 | my $self = shift; | |||||||||
| 922 | 0 | ▶ | return unless $self->billing_details->id; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 923 | 0 | WebService::Braintree::Address->find( | |||||||||
| 924 | $self->customer_details->id, $self->billing_details->id, | ||||||||||
| 925 | ); | ||||||||||
| 926 | } | ||||||||||
| 927 | |||||||||||
| 928 | =head2 vault_credit_card() | ||||||||||
| 929 | |||||||||||
| 930 | This returns the credit card. | ||||||||||
| 931 | |||||||||||
| 932 | =cut | ||||||||||
| 933 | |||||||||||
| 934 | 0 | ▶ | sub vault_credit_card { | ||||||||
|
Subroutine
vault_credit_card: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 935 | 0 | my $self = shift; | |||||||||
| 936 | 0 | ▶ | return unless $self->credit_card_details->token; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 937 | 0 | WebService::Braintree::CreditCard->find( | |||||||||
| 938 | $self->credit_card_details->id, | ||||||||||
| 939 | ); | ||||||||||
| 940 | } | ||||||||||
| 941 | |||||||||||
| 942 | =head2 vault_customer() | ||||||||||
| 943 | |||||||||||
| 944 | This returns the customer. | ||||||||||
| 945 | |||||||||||
| 946 | =cut | ||||||||||
| 947 | |||||||||||
| 948 | 0 | ▶ | sub vault_customer { | ||||||||
|
Subroutine
vault_customer: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 949 | 0 | my $self = shift; | |||||||||
| 950 | 0 | ▶ | return unless $self->customer_details->id; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 951 | 0 | WebService::Braintree::Customer->find( | |||||||||
| 952 | $self->customer_details->id, | ||||||||||
| 953 | ); | ||||||||||
| 954 | } | ||||||||||
| 955 | |||||||||||
| 956 | =head2 vault_shipping_address() | ||||||||||
| 957 | |||||||||||
| 958 | This returns the customer's shipping address. | ||||||||||
| 959 | |||||||||||
| 960 | =cut | ||||||||||
| 961 | |||||||||||
| 962 | 0 | ▶ | sub vault_shipping_address { | ||||||||
|
Subroutine
vault_shipping_address: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 963 | 0 | my $self = shift; | |||||||||
| 964 | 0 | ▶ | return unless $self->shipping_details->id; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 965 | 0 | WebService::Braintree::Address->find( | |||||||||
| 966 | $self->customer_details->id, $self->shipping_details->id, | ||||||||||
| 967 | ); | ||||||||||
| 968 | } | ||||||||||
| 969 | |||||||||||
| 970 | 22 | __PACKAGE__->meta->make_immutable; | |||||||||
| 971 | |||||||||||
| 972 | 22 | 1; | |||||||||
| 973 | __END__ | ||||||||||