braintree 2.74.0 → 4.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/LICENSE +1 -1
- data/braintree.gemspec +13 -7
- data/lib/braintree/account_updater_daily_report.rb +2 -2
- data/lib/braintree/ach_mandate.rb +2 -1
- data/lib/braintree/address/country_names.rb +4 -1
- data/lib/braintree/address.rb +30 -38
- data/lib/braintree/address_gateway.rb +12 -2
- data/lib/braintree/advanced_search.rb +8 -0
- data/lib/braintree/apple_pay.rb +29 -0
- data/lib/braintree/apple_pay_card.rb +28 -4
- data/lib/braintree/apple_pay_gateway.rb +37 -0
- data/lib/braintree/apple_pay_options.rb +19 -0
- data/lib/braintree/authorization_adjustment.rb +23 -0
- data/lib/braintree/base_module.rb +10 -0
- data/lib/braintree/bin_data.rb +33 -0
- data/lib/braintree/client_token.rb +3 -3
- data/lib/braintree/client_token_gateway.rb +3 -1
- data/lib/braintree/configuration.rb +57 -10
- data/lib/braintree/connected_merchant_paypal_status_changed.rb +6 -2
- data/lib/braintree/connected_merchant_status_transitioned.rb +6 -2
- data/lib/braintree/credentials_parser.rb +5 -1
- data/lib/braintree/credit_card.rb +53 -107
- data/lib/braintree/credit_card_gateway.rb +43 -30
- data/lib/braintree/credit_card_verification.rb +61 -21
- data/lib/braintree/credit_card_verification_gateway.rb +19 -6
- data/lib/braintree/credit_card_verification_search.rb +1 -1
- data/lib/braintree/customer.rb +51 -98
- data/lib/braintree/customer_gateway.rb +30 -23
- data/lib/braintree/customer_search.rb +1 -1
- data/lib/braintree/descriptor.rb +3 -1
- data/lib/braintree/disbursement.rb +24 -2
- data/lib/braintree/dispute/evidence.rb +24 -0
- data/lib/braintree/{transaction/coinbase_details.rb → dispute/paypal_message.rb} +5 -3
- data/lib/braintree/dispute/status_history.rb +18 -0
- data/lib/braintree/dispute/transaction.rb +20 -0
- data/lib/braintree/dispute/transaction_details.rb +2 -1
- data/lib/braintree/dispute.rb +114 -10
- data/lib/braintree/dispute_gateway.rb +142 -0
- data/lib/braintree/dispute_search.rb +31 -0
- data/lib/braintree/document_upload.rb +37 -0
- data/lib/braintree/document_upload_gateway.rb +38 -0
- data/lib/braintree/enriched_customer_data.rb +21 -0
- data/lib/braintree/error_codes.rb +328 -109
- data/lib/braintree/error_result.rb +8 -1
- data/lib/braintree/exceptions.rb +5 -3
- data/lib/braintree/exchange_rate.rb +13 -0
- data/lib/braintree/exchange_rate_quote.rb +24 -0
- data/lib/braintree/exchange_rate_quote_gateway.rb +35 -0
- data/lib/braintree/exchange_rate_quote_input.rb +21 -0
- data/lib/braintree/exchange_rate_quote_request.rb +18 -0
- data/lib/braintree/exchange_rate_quote_response.rb +18 -0
- data/lib/braintree/facilitated_details.rb +21 -0
- data/lib/braintree/facilitator_details.rb +2 -1
- data/lib/braintree/gateway.rb +29 -11
- data/lib/braintree/google_pay_card.rb +61 -0
- data/lib/braintree/granted_payment_instrument_update.rb +23 -0
- data/lib/braintree/graphql_client.rb +34 -0
- data/lib/braintree/http.rb +81 -20
- data/lib/braintree/local_payment_completed.rb +23 -0
- data/lib/braintree/local_payment_expired.rb +21 -0
- data/lib/braintree/local_payment_funded.rb +22 -0
- data/lib/braintree/local_payment_reversed.rb +19 -0
- data/lib/braintree/merchant.rb +11 -4
- data/lib/braintree/merchant_account/address_details.rb +4 -1
- data/lib/braintree/merchant_account/business_details.rb +4 -1
- data/lib/braintree/merchant_account/funding_details.rb +6 -1
- data/lib/braintree/merchant_account/individual_details.rb +7 -2
- data/lib/braintree/merchant_account.rb +23 -10
- data/lib/braintree/merchant_account_gateway.rb +13 -1
- data/lib/braintree/merchant_gateway.rb +2 -2
- data/lib/braintree/modification.rb +1 -1
- data/lib/braintree/oauth_credentials.rb +5 -2
- data/lib/braintree/oauth_gateway.rb +8 -14
- data/lib/braintree/paginated_result.rb +3 -1
- data/lib/braintree/payment_instrument_type.rb +11 -11
- data/lib/braintree/payment_method.rb +20 -12
- data/lib/braintree/payment_method_customer_data_updated_metadata.rb +24 -0
- data/lib/braintree/payment_method_gateway.rb +82 -54
- data/lib/braintree/payment_method_nonce.rb +22 -8
- data/lib/braintree/payment_method_nonce_details.rb +40 -0
- data/lib/braintree/payment_method_nonce_details_payer_info.rb +32 -0
- data/lib/braintree/payment_method_nonce_gateway.rb +19 -2
- data/lib/braintree/payment_method_parser.rb +28 -0
- data/lib/braintree/paypal_account.rb +10 -1
- data/lib/braintree/plan.rb +25 -5
- data/lib/braintree/plan_gateway.rb +100 -0
- data/lib/braintree/processor_response_types.rb +7 -0
- data/lib/braintree/resource_collection.rb +8 -3
- data/lib/braintree/revoked_payment_method_metadata.rb +22 -0
- data/lib/braintree/risk_data/liability_shift.rb +22 -0
- data/lib/braintree/risk_data.rb +12 -2
- data/lib/braintree/samsung_pay_card.rb +83 -0
- data/lib/braintree/sepa_direct_debit_account.rb +60 -0
- data/lib/braintree/sepa_direct_debit_account_gateway.rb +25 -0
- data/lib/braintree/sepa_direct_debit_account_nonce_details.rb +28 -0
- data/lib/braintree/settlement_batch_summary.rb +2 -1
- data/lib/braintree/settlement_batch_summary_gateway.rb +2 -0
- data/lib/braintree/subscription/status_details.rb +8 -1
- data/lib/braintree/subscription.rb +56 -41
- data/lib/braintree/subscription_gateway.rb +25 -2
- data/lib/braintree/successful_result.rb +23 -1
- data/lib/braintree/test/authentication_id.rb +21 -0
- data/lib/braintree/test/credit_card.rb +13 -0
- data/lib/braintree/test/nonce.rb +28 -20
- data/lib/braintree/test/transaction_amounts.rb +1 -0
- data/lib/braintree/three_d_secure_info.rb +34 -2
- data/lib/braintree/transaction/address_details.rb +24 -4
- data/lib/braintree/transaction/apple_pay_details.rb +20 -2
- data/lib/braintree/transaction/credit_card_details.rb +45 -6
- data/lib/braintree/transaction/customer_details.rb +8 -1
- data/lib/braintree/transaction/disbursement_details.rb +6 -1
- data/lib/braintree/transaction/google_pay_details.rb +41 -0
- data/lib/braintree/transaction/installment/adjustment.rb +33 -0
- data/lib/braintree/transaction/installment.rb +28 -0
- data/lib/braintree/transaction/local_payment_details.rb +24 -0
- data/lib/braintree/transaction/paypal_details.rb +26 -4
- data/lib/braintree/transaction/paypal_here_details.rb +23 -0
- data/lib/braintree/transaction/{masterpass_card_details.rb → samsung_pay_card_details.rb} +21 -6
- data/lib/braintree/transaction/sepa_direct_debit_account_details.rb +27 -0
- data/lib/braintree/transaction/status_details.rb +5 -1
- data/lib/braintree/transaction/subscription_details.rb +4 -1
- data/lib/braintree/transaction/us_bank_account_details.rb +8 -1
- data/lib/braintree/transaction/venmo_account_details.rb +5 -1
- data/lib/braintree/transaction/visa_checkout_card_details.rb +19 -4
- data/lib/braintree/transaction.rb +201 -188
- data/lib/braintree/transaction_gateway.rb +124 -30
- data/lib/braintree/transaction_line_item.rb +40 -0
- data/lib/braintree/transaction_line_item_gateway.rb +19 -0
- data/lib/braintree/transaction_review.rb +18 -0
- data/lib/braintree/transaction_search.rb +6 -3
- data/lib/braintree/unknown_payment_method.rb +3 -2
- data/lib/braintree/us_bank_account.rb +24 -8
- data/lib/braintree/us_bank_account_gateway.rb +0 -1
- data/lib/braintree/us_bank_account_verification.rb +81 -0
- data/lib/braintree/us_bank_account_verification_gateway.rb +51 -0
- data/lib/braintree/us_bank_account_verification_search.rb +19 -0
- data/lib/braintree/util.rb +79 -9
- data/lib/braintree/validation_error.rb +13 -3
- data/lib/braintree/validation_error_collection.rb +2 -1
- data/lib/braintree/venmo_account.rb +11 -4
- data/lib/braintree/venmo_profile_data.rb +23 -0
- data/lib/braintree/version.rb +2 -2
- data/lib/braintree/visa_checkout_card.rb +29 -13
- data/lib/braintree/webhook_notification.rb +66 -26
- data/lib/braintree/webhook_notification_gateway.rb +5 -3
- data/lib/braintree/webhook_testing.rb +2 -2
- data/lib/braintree/webhook_testing_gateway.rb +721 -55
- data/lib/braintree/xml/generator.rb +6 -4
- data/lib/braintree/xml/parser.rb +22 -35
- data/lib/braintree/xml/rexml.rb +4 -5
- data/lib/braintree.rb +60 -22
- data/lib/ssl/api_braintreegateway_com.ca.crt +50 -0
- data/spec/fixtures/files/bt_logo.png +0 -0
- data/spec/fixtures/files/gif_extension_bt_logo.gif +0 -0
- data/spec/fixtures/files/malformed_pdf.pdf +1 -0
- data/spec/fixtures/files/too_long.pdf +0 -0
- data/spec/integration/braintree/add_on_spec.rb +3 -3
- data/spec/integration/braintree/address_spec.rb +30 -113
- data/spec/integration/braintree/advanced_search_spec.rb +45 -45
- data/spec/integration/braintree/apple_pay_spec.rb +63 -0
- data/spec/integration/braintree/braintree_gateway_spec.rb +72 -0
- data/spec/integration/braintree/client_api/client_token_spec.rb +14 -32
- data/spec/integration/braintree/client_api/spec_helper.rb +104 -65
- data/spec/integration/braintree/credit_card_spec.rb +460 -615
- data/spec/integration/braintree/credit_card_verification_search_spec.rb +2 -2
- data/spec/integration/braintree/credit_card_verification_spec.rb +222 -6
- data/spec/integration/braintree/customer_search_spec.rb +8 -8
- data/spec/integration/braintree/customer_spec.rb +810 -498
- data/spec/integration/braintree/discount_spec.rb +1 -1
- data/spec/integration/braintree/dispute_search_spec.rb +167 -0
- data/spec/integration/braintree/dispute_spec.rb +333 -0
- data/spec/integration/braintree/document_upload_spec.rb +87 -0
- data/spec/integration/braintree/error_codes_spec.rb +1 -1
- data/spec/integration/braintree/exchange_rate_quote_spec.rb +97 -0
- data/spec/integration/braintree/graphql_client_spec.rb +72 -0
- data/spec/integration/braintree/http_spec.rb +12 -4
- data/spec/integration/braintree/merchant_account_spec.rb +74 -26
- data/spec/integration/braintree/merchant_spec.rb +39 -13
- data/spec/integration/braintree/oauth_spec.rb +18 -25
- data/spec/integration/braintree/payment_method_nonce_spec.rb +239 -5
- data/spec/integration/braintree/payment_method_spec.rb +882 -300
- data/spec/integration/braintree/payment_method_us_bank_account_spec.rb +416 -0
- data/spec/integration/braintree/paypal_account_spec.rb +32 -31
- data/spec/integration/braintree/plan_spec.rb +82 -0
- data/spec/integration/braintree/samsung_pay_card_spec.rb +144 -0
- data/spec/integration/braintree/sepa_direct_debit_account_spec.rb +196 -0
- data/spec/integration/braintree/settlement_batch_summary_spec.rb +8 -8
- data/spec/integration/braintree/subscription_spec.rb +274 -180
- data/spec/integration/braintree/test/transaction_amounts_spec.rb +2 -2
- data/spec/integration/braintree/test_transaction_spec.rb +18 -18
- data/spec/integration/braintree/transaction_line_item_spec.rb +38 -0
- data/spec/integration/braintree/transaction_search_spec.rb +280 -152
- data/spec/integration/braintree/transaction_spec.rb +3709 -1175
- data/spec/integration/braintree/transaction_us_bank_account_spec.rb +438 -0
- data/spec/integration/braintree/us_bank_account_spec.rb +38 -17
- data/spec/integration/braintree/us_bank_account_verification_search_spec.rb +178 -0
- data/spec/integration/braintree/us_bank_account_verification_spec.rb +240 -0
- data/spec/integration/braintree/visa_checkout_card_spec.rb +5 -5
- data/spec/integration/spec_helper.rb +27 -6
- data/spec/oauth_test_helper.rb +1 -1
- data/spec/script/httpsd.rb +6 -6
- data/spec/spec_helper.rb +26 -23
- data/spec/unit/braintree/address_spec.rb +1 -9
- data/spec/unit/braintree/apple_pay_card_spec.rb +104 -4
- data/spec/unit/braintree/client_token_spec.rb +2 -2
- data/spec/unit/braintree/configuration_spec.rb +108 -33
- data/spec/unit/braintree/credit_card_spec.rb +62 -33
- data/spec/unit/braintree/credit_card_verification_gateway_spec.rb +51 -0
- data/spec/unit/braintree/credit_card_verification_search_spec.rb +1 -1
- data/spec/unit/braintree/credit_card_verification_spec.rb +39 -6
- data/spec/unit/braintree/customer_spec.rb +107 -27
- data/spec/unit/braintree/disbursement_spec.rb +59 -7
- data/spec/unit/braintree/dispute_search_spec.rb +66 -0
- data/spec/unit/braintree/dispute_spec.rb +472 -8
- data/spec/unit/braintree/document_upload_spec.rb +35 -0
- data/spec/unit/braintree/enriched_customer_data_spec.rb +32 -0
- data/spec/unit/braintree/error_result_spec.rb +5 -5
- data/spec/unit/braintree/errors_spec.rb +8 -8
- data/spec/unit/braintree/exchange_rate_quote_input_spec.rb +42 -0
- data/spec/unit/braintree/exchange_rate_quote_request_spec.rb +82 -0
- data/spec/unit/braintree/exchange_rate_quote_response_spec.rb +52 -0
- data/spec/unit/braintree/exchange_rate_quote_spec.rb +42 -0
- data/spec/unit/braintree/exchange_rate_spec.rb +23 -0
- data/spec/unit/braintree/http_spec.rb +93 -5
- data/spec/unit/braintree/local_payment_completed_spec.rb +50 -0
- data/spec/unit/braintree/local_payment_expired_spec.rb +24 -0
- data/spec/unit/braintree/local_payment_funded_spec.rb +34 -0
- data/spec/unit/braintree/merchant_account_spec.rb +1 -1
- data/spec/unit/braintree/modification_spec.rb +1 -1
- data/spec/unit/braintree/payment_method_customer_data_updated_metadata_spec.rb +45 -0
- data/spec/unit/braintree/payment_method_nonce_details_payer_info_spec.rb +31 -0
- data/spec/unit/braintree/payment_method_nonce_details_spec.rb +51 -0
- data/spec/unit/braintree/payment_method_nonce_spec.rb +40 -0
- data/spec/unit/braintree/payment_method_spec.rb +1 -1
- data/spec/unit/braintree/paypal_account_spec.rb +2 -2
- data/spec/unit/braintree/resource_collection_spec.rb +30 -1
- data/spec/unit/braintree/risk_data/liability_shift.rb +26 -0
- data/spec/unit/braintree/risk_data_spec.rb +40 -6
- data/spec/unit/braintree/sepa_debit_account_nonce_details_spec.rb +29 -0
- data/spec/unit/braintree/sepa_debit_account_spec.rb +86 -0
- data/spec/unit/braintree/subscription_search_spec.rb +1 -1
- data/spec/unit/braintree/subscription_spec.rb +2 -2
- data/spec/unit/braintree/successful_result_spec.rb +1 -1
- data/spec/unit/braintree/three_d_secure_info_spec.rb +34 -6
- data/spec/unit/braintree/transaction/credit_card_details_spec.rb +19 -3
- data/spec/unit/braintree/transaction/customer_details_spec.rb +1 -1
- data/spec/unit/braintree/transaction/deposit_details_spec.rb +2 -2
- data/spec/unit/braintree/transaction/installment_spec.rb +25 -0
- data/spec/unit/braintree/transaction/paypal_details_spec.rb +63 -0
- data/spec/unit/braintree/transaction/sepa_direct_debit_account_details_spec.rb +33 -0
- data/spec/unit/braintree/transaction_gateway_spec.rb +111 -0
- data/spec/unit/braintree/transaction_search_spec.rb +12 -12
- data/spec/unit/braintree/transaction_spec.rb +171 -55
- data/spec/unit/braintree/us_bank_account_verification_search_spec.rb +60 -0
- data/spec/unit/braintree/us_bank_account_verification_spec.rb +93 -0
- data/spec/unit/braintree/util_spec.rb +162 -19
- data/spec/unit/braintree/validation_error_collection_spec.rb +336 -133
- data/spec/unit/braintree/venmo_profile_data_spec.rb +32 -0
- data/spec/unit/braintree/webhook_notification_spec.rb +546 -114
- data/spec/unit/braintree/xml/parser_spec.rb +21 -16
- data/spec/unit/braintree/xml_spec.rb +31 -24
- data/spec/unit/braintree_spec.rb +1 -0
- metadata +290 -198
- data/README.rdoc +0 -93
- data/lib/braintree/amex_express_checkout_card.rb +0 -26
- data/lib/braintree/android_pay_card.rb +0 -35
- data/lib/braintree/coinbase_account.rb +0 -25
- data/lib/braintree/europe_bank_account.rb +0 -34
- data/lib/braintree/europe_bank_account_gateway.rb +0 -17
- data/lib/braintree/ideal_payment.rb +0 -46
- data/lib/braintree/ideal_payment_gateway.rb +0 -18
- data/lib/braintree/masterpass_card.rb +0 -66
- data/lib/braintree/settlement_batch.rb +0 -0
- data/lib/braintree/transaction/amex_express_checkout_details.rb +0 -14
- data/lib/braintree/transaction/android_pay_details.rb +0 -17
- data/lib/braintree/transaction/ideal_payment_details.rb +0 -13
- data/lib/braintree/transparent_redirect.rb +0 -40
- data/lib/braintree/transparent_redirect_gateway.rb +0 -105
- data/spec/hacks/tcp_socket.rb +0 -18
- data/spec/httpsd.pid +0 -1
- data/spec/integration/braintree/coinbase_spec.rb +0 -31
- data/spec/integration/braintree/ideal_payment_spec.rb +0 -87
- data/spec/integration/braintree/masterpass_card_spec.rb +0 -97
- data/spec/integration/braintree/transparent_redirect_spec.rb +0 -268
- data/spec/unit/braintree/transparent_redirect_spec.rb +0 -223
@@ -1,20 +1,21 @@
|
|
1
1
|
module Braintree
|
2
2
|
class Transaction
|
3
3
|
include BaseModule
|
4
|
+
include Braintree::Util::IdEquality
|
4
5
|
|
5
6
|
module CreatedUsing
|
6
|
-
FullInformation =
|
7
|
-
Token =
|
8
|
-
Unrecognized =
|
7
|
+
FullInformation = "full_information"
|
8
|
+
Token = "token"
|
9
|
+
Unrecognized = "unrecognized"
|
9
10
|
end
|
10
11
|
|
11
12
|
module EscrowStatus
|
12
|
-
HoldPending =
|
13
|
-
Held =
|
14
|
-
ReleasePending =
|
15
|
-
Released =
|
16
|
-
Refunded =
|
17
|
-
Unrecognized =
|
13
|
+
HoldPending = "hold_pending"
|
14
|
+
Held = "held"
|
15
|
+
ReleasePending = "release_pending"
|
16
|
+
Released = "released"
|
17
|
+
Refunded = "refunded"
|
18
|
+
Unrecognized = "unrecognized"
|
18
19
|
end
|
19
20
|
|
20
21
|
module GatewayRejectionReason
|
@@ -23,26 +24,29 @@ module Braintree
|
|
23
24
|
AVSAndCVV = "avs_and_cvv"
|
24
25
|
CVV = "cvv"
|
25
26
|
Duplicate = "duplicate"
|
27
|
+
ExcessiveRetry = "excessive_retry"
|
26
28
|
Fraud = "fraud"
|
29
|
+
RiskThreshold = "risk_threshold"
|
27
30
|
ThreeDSecure = "three_d_secure"
|
31
|
+
TokenIssuance = "token_issuance"
|
28
32
|
Unrecognized = "unrecognized"
|
29
33
|
end
|
30
34
|
|
31
35
|
module Status
|
32
|
-
AuthorizationExpired =
|
33
|
-
Authorizing =
|
34
|
-
Authorized =
|
35
|
-
GatewayRejected =
|
36
|
-
Failed =
|
37
|
-
ProcessorDeclined =
|
38
|
-
Settled =
|
39
|
-
SettlementConfirmed =
|
40
|
-
SettlementDeclined =
|
41
|
-
SettlementPending =
|
42
|
-
Settling =
|
43
|
-
SubmittedForSettlement =
|
44
|
-
Voided =
|
45
|
-
Unrecognized =
|
36
|
+
AuthorizationExpired = "authorization_expired"
|
37
|
+
Authorizing = "authorizing"
|
38
|
+
Authorized = "authorized"
|
39
|
+
GatewayRejected = "gateway_rejected"
|
40
|
+
Failed = "failed"
|
41
|
+
ProcessorDeclined = "processor_declined"
|
42
|
+
Settled = "settled"
|
43
|
+
SettlementConfirmed = "settlement_confirmed"
|
44
|
+
SettlementDeclined = "settlement_declined"
|
45
|
+
SettlementPending = "settlement_pending"
|
46
|
+
Settling = "settling"
|
47
|
+
SubmittedForSettlement = "submitted_for_settlement"
|
48
|
+
Voided = "voided"
|
49
|
+
Unrecognized = "unrecognized"
|
46
50
|
|
47
51
|
All = constants.map { |c| const_get(c) }
|
48
52
|
end
|
@@ -57,6 +61,18 @@ module Braintree
|
|
57
61
|
module IndustryType
|
58
62
|
Lodging = "lodging"
|
59
63
|
TravelAndCruise = "travel_cruise"
|
64
|
+
TravelAndFlight = "travel_flight"
|
65
|
+
|
66
|
+
All = constants.map { |c| const_get(c) }
|
67
|
+
end
|
68
|
+
|
69
|
+
module AdditionalCharge
|
70
|
+
Restaurant = "restaurant"
|
71
|
+
GiftShop = "gift_shop"
|
72
|
+
MiniBar = "mini_bar"
|
73
|
+
Telephone = "telephone"
|
74
|
+
Laundry = "laundry"
|
75
|
+
Other = "other"
|
60
76
|
|
61
77
|
All = constants.map { |c| const_get(c) }
|
62
78
|
end
|
@@ -68,219 +84,257 @@ module Braintree
|
|
68
84
|
All = constants.map { |c| const_get(c) }
|
69
85
|
end
|
70
86
|
|
71
|
-
|
72
|
-
|
87
|
+
module ExternalVault
|
88
|
+
module Status
|
89
|
+
WillVault = "will_vault"
|
90
|
+
Vaulted = "vaulted"
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
attr_reader :acquirer_reference_number
|
95
|
+
attr_reader :ach_return_code
|
96
|
+
attr_reader :add_ons
|
97
|
+
attr_reader :additional_processor_response # The raw response from the processor.
|
98
|
+
attr_reader :amount
|
99
|
+
attr_reader :apple_pay_details
|
100
|
+
attr_reader :authorization_adjustments
|
101
|
+
attr_reader :authorization_expires_at
|
102
|
+
attr_reader :authorized_transaction_id
|
103
|
+
attr_reader :avs_error_response_code
|
104
|
+
attr_reader :avs_postal_code_response_code
|
105
|
+
attr_reader :avs_street_address_response_code
|
106
|
+
attr_reader :billing_details
|
107
|
+
attr_reader :channel
|
108
|
+
attr_reader :created_at
|
109
|
+
attr_reader :credit_card_details
|
73
110
|
attr_reader :currency_iso_code
|
74
111
|
attr_reader :custom_fields
|
112
|
+
attr_reader :customer_details
|
75
113
|
attr_reader :cvv_response_code
|
114
|
+
attr_reader :descriptor
|
76
115
|
attr_reader :disbursement_details
|
116
|
+
attr_reader :discount_amount
|
117
|
+
attr_reader :discounts
|
77
118
|
attr_reader :disputes
|
78
|
-
attr_reader :descriptor
|
79
119
|
attr_reader :escrow_status
|
120
|
+
attr_reader :facilitated_details
|
121
|
+
attr_reader :facilitator_details
|
80
122
|
attr_reader :gateway_rejection_reason
|
123
|
+
attr_reader :google_pay_details
|
124
|
+
attr_reader :graphql_id
|
125
|
+
attr_reader :id
|
126
|
+
attr_reader :installment_count
|
127
|
+
attr_reader :installments
|
128
|
+
attr_reader :local_payment_details
|
81
129
|
attr_reader :merchant_account_id
|
130
|
+
attr_reader :merchant_advice_code
|
131
|
+
attr_reader :merchant_advice_code_text
|
132
|
+
attr_reader :network_response_code # Response code from the card network
|
133
|
+
attr_reader :network_response_text # Response text from the card network
|
134
|
+
attr_reader :network_token_details
|
135
|
+
attr_reader :network_transaction_id
|
82
136
|
attr_reader :order_id
|
83
|
-
attr_reader :
|
84
|
-
attr_reader :
|
137
|
+
attr_reader :partial_settlement_transaction_ids
|
138
|
+
attr_reader :payment_instrument_type
|
85
139
|
attr_reader :paypal_details
|
86
|
-
attr_reader :
|
87
|
-
attr_reader :android_pay_details
|
88
|
-
attr_reader :amex_express_checkout_details
|
89
|
-
attr_reader :venmo_account_details
|
90
|
-
attr_reader :coinbase_details
|
140
|
+
attr_reader :paypal_here_details
|
91
141
|
attr_reader :plan_id
|
92
|
-
#
|
93
|
-
attr_reader :
|
94
|
-
#
|
95
|
-
attr_reader :
|
96
|
-
#
|
97
|
-
attr_reader :
|
98
|
-
|
99
|
-
attr_reader :additional_processor_response
|
100
|
-
# The settlement response code from the processor.
|
101
|
-
attr_reader :processor_settlement_response_code
|
102
|
-
# The settlement response text from the processor.
|
103
|
-
attr_reader :processor_settlement_response_text
|
104
|
-
attr_reader :voice_referral_number
|
142
|
+
attr_reader :processor_authorization_code # Authorization code from the processor.
|
143
|
+
attr_reader :processor_response_code # Response code from the processor.
|
144
|
+
attr_reader :processor_response_text # Response text from the processor.
|
145
|
+
attr_reader :processor_response_type # Response type from the processor.
|
146
|
+
attr_reader :processor_settlement_response_code # Settlement response code from the processor.
|
147
|
+
attr_reader :processor_settlement_response_text # Settlement response text from the processor.
|
148
|
+
attr_reader :product_sku
|
105
149
|
attr_reader :purchase_order_number
|
106
150
|
attr_reader :recurring
|
107
|
-
attr_reader :refund_ids
|
151
|
+
attr_reader :refund_ids
|
152
|
+
attr_reader :refunded_transaction_id
|
153
|
+
attr_reader :refunded_installments
|
154
|
+
attr_reader :retried
|
155
|
+
attr_reader :retrieval_reference_number
|
156
|
+
attr_reader :risk_data
|
157
|
+
attr_reader :samsung_pay_card_details
|
158
|
+
attr_reader :sca_exemption_requested
|
159
|
+
attr_reader :service_fee_amount
|
160
|
+
attr_reader :sepa_direct_debit_account_details
|
161
|
+
attr_reader :sepa_direct_debit_return_code
|
108
162
|
attr_reader :settlement_batch_id
|
109
|
-
attr_reader :
|
110
|
-
attr_reader :
|
111
|
-
|
112
|
-
attr_reader :status
|
163
|
+
attr_reader :shipping_amount
|
164
|
+
attr_reader :shipping_details
|
165
|
+
attr_reader :ships_from_postal_code
|
166
|
+
attr_reader :status # See Transaction::Status
|
113
167
|
attr_reader :status_history
|
168
|
+
attr_reader :subscription_details
|
114
169
|
attr_reader :subscription_id
|
115
170
|
attr_reader :tax_amount
|
116
171
|
attr_reader :tax_exempt
|
117
|
-
# Will either be "sale" or "credit"
|
118
|
-
attr_reader :type
|
119
|
-
attr_reader :updated_at
|
120
|
-
attr_reader :add_ons, :discounts
|
121
|
-
attr_reader :payment_instrument_type
|
122
|
-
attr_reader :risk_data
|
123
|
-
attr_reader :facilitator_details
|
124
172
|
attr_reader :three_d_secure_info
|
173
|
+
attr_reader :type # Will either be "sale" or "credit"
|
174
|
+
attr_reader :updated_at
|
125
175
|
attr_reader :us_bank_account_details
|
126
|
-
attr_reader :
|
176
|
+
attr_reader :venmo_account_details
|
127
177
|
attr_reader :visa_checkout_card_details
|
128
|
-
attr_reader :
|
178
|
+
attr_reader :voice_referral_number
|
179
|
+
attr_reader :ach_return_responses
|
129
180
|
|
130
|
-
def self.
|
131
|
-
Configuration.gateway.transaction.
|
181
|
+
def self.adjust_authorization(*args)
|
182
|
+
Configuration.gateway.transaction.adjust_authorization(*args)
|
132
183
|
end
|
133
184
|
|
134
|
-
def self.
|
135
|
-
|
185
|
+
def self.adjust_authorization!(*args)
|
186
|
+
Configuration.gateway.transaction.adjust_authorization!(*args)
|
136
187
|
end
|
137
188
|
|
138
|
-
def self.
|
139
|
-
Configuration.gateway.transaction.
|
189
|
+
def self.create(*args)
|
190
|
+
Configuration.gateway.transaction.create(*args)
|
140
191
|
end
|
141
192
|
|
142
|
-
def self.
|
143
|
-
return_object_or_raise(:transaction) {
|
193
|
+
def self.create!(*args)
|
194
|
+
return_object_or_raise(:transaction) { create(*args) }
|
144
195
|
end
|
145
196
|
|
146
|
-
def self.
|
147
|
-
Configuration.gateway.transaction.
|
197
|
+
def self.cancel_release(*args)
|
198
|
+
Configuration.gateway.transaction.cancel_release(*args)
|
148
199
|
end
|
149
200
|
|
150
|
-
def self.
|
151
|
-
|
201
|
+
def self.cancel_release!(*args)
|
202
|
+
Configuration.gateway.transaction.cancel_release!(*args)
|
152
203
|
end
|
153
204
|
|
154
|
-
|
155
|
-
|
156
|
-
warn "[DEPRECATED] Transaction.create_from_transparent_redirect is deprecated. Please use TransparentRedirect.confirm"
|
157
|
-
Configuration.gateway.transaction.create_from_transparent_redirect(query_string)
|
205
|
+
def self.clone_transaction(*args)
|
206
|
+
Configuration.gateway.transaction.clone_transaction(*args)
|
158
207
|
end
|
159
208
|
|
160
|
-
|
161
|
-
|
162
|
-
warn "[DEPRECATED] Transaction.create_transaction_url is deprecated. Please use TransparentRedirect.url"
|
163
|
-
Configuration.gateway.transaction.create_transaction_url
|
209
|
+
def self.clone_transaction!(*args)
|
210
|
+
Configuration.gateway.transaction.clone_transaction!(*args)
|
164
211
|
end
|
165
212
|
|
166
|
-
def self.credit(
|
167
|
-
Configuration.gateway.transaction.credit(
|
213
|
+
def self.credit(*args)
|
214
|
+
Configuration.gateway.transaction.credit(*args)
|
168
215
|
end
|
169
216
|
|
170
|
-
def self.credit!(
|
171
|
-
|
217
|
+
def self.credit!(*args)
|
218
|
+
Configuration.gateway.transaction.credit!(*args)
|
172
219
|
end
|
173
220
|
|
174
|
-
def self.find(
|
175
|
-
Configuration.gateway.transaction.find(
|
221
|
+
def self.find(*args)
|
222
|
+
Configuration.gateway.transaction.find(*args)
|
176
223
|
end
|
177
224
|
|
178
|
-
def self.
|
179
|
-
Configuration.gateway.
|
225
|
+
def self.line_items(*args)
|
226
|
+
Configuration.gateway.transaction_line_item.find_all(*args)
|
180
227
|
end
|
181
228
|
|
182
|
-
def self.hold_in_escrow
|
183
|
-
|
229
|
+
def self.hold_in_escrow(*args)
|
230
|
+
Configuration.gateway.transaction.hold_in_escrow(*args)
|
184
231
|
end
|
185
232
|
|
186
|
-
def self.
|
187
|
-
Configuration.gateway.transaction.
|
233
|
+
def self.hold_in_escrow!(*args)
|
234
|
+
Configuration.gateway.transaction.hold_in_escrow!(*args)
|
188
235
|
end
|
189
236
|
|
190
|
-
def self.refund
|
191
|
-
|
237
|
+
def self.refund(*args)
|
238
|
+
Configuration.gateway.transaction.refund(*args)
|
192
239
|
end
|
193
240
|
|
194
|
-
def self.
|
195
|
-
Configuration.gateway.transaction.
|
241
|
+
def self.refund!(*args)
|
242
|
+
Configuration.gateway.transaction.refund!(*args)
|
196
243
|
end
|
197
244
|
|
198
|
-
def self.sale
|
199
|
-
|
245
|
+
def self.sale(*args)
|
246
|
+
Configuration.gateway.transaction.sale(*args)
|
247
|
+
end
|
248
|
+
|
249
|
+
def self.sale!(*args)
|
250
|
+
Configuration.gateway.transaction.sale!(*args)
|
200
251
|
end
|
201
252
|
|
202
253
|
def self.search(&block)
|
203
254
|
Configuration.gateway.transaction.search(&block)
|
204
255
|
end
|
205
256
|
|
206
|
-
def self.release_from_escrow(
|
207
|
-
Configuration.gateway.transaction.release_from_escrow(
|
257
|
+
def self.release_from_escrow(*args)
|
258
|
+
Configuration.gateway.transaction.release_from_escrow(*args)
|
208
259
|
end
|
209
260
|
|
210
|
-
def self.release_from_escrow!(
|
211
|
-
|
261
|
+
def self.release_from_escrow!(*args)
|
262
|
+
Configuration.gateway.transaction.release_from_escrow!(*args)
|
212
263
|
end
|
213
264
|
|
214
|
-
def self.submit_for_settlement(
|
215
|
-
Configuration.gateway.transaction.submit_for_settlement(
|
265
|
+
def self.submit_for_settlement(*args)
|
266
|
+
Configuration.gateway.transaction.submit_for_settlement(*args)
|
216
267
|
end
|
217
268
|
|
218
|
-
def self.submit_for_settlement!(
|
219
|
-
|
269
|
+
def self.submit_for_settlement!(*args)
|
270
|
+
Configuration.gateway.transaction.submit_for_settlement!(*args)
|
220
271
|
end
|
221
272
|
|
222
|
-
def self.update_details(
|
223
|
-
Configuration.gateway.transaction.update_details(
|
273
|
+
def self.update_details(*args)
|
274
|
+
Configuration.gateway.transaction.update_details(*args)
|
224
275
|
end
|
225
276
|
|
226
|
-
def self.update_details!(
|
227
|
-
return_object_or_raise(:transaction) { update_details(
|
277
|
+
def self.update_details!(*args)
|
278
|
+
return_object_or_raise(:transaction) { update_details(*args) }
|
228
279
|
end
|
229
280
|
|
230
|
-
def self.submit_for_partial_settlement(
|
231
|
-
Configuration.gateway.transaction.submit_for_partial_settlement(
|
281
|
+
def self.submit_for_partial_settlement(*args)
|
282
|
+
Configuration.gateway.transaction.submit_for_partial_settlement(*args)
|
232
283
|
end
|
233
284
|
|
234
|
-
def self.submit_for_partial_settlement!(
|
235
|
-
|
285
|
+
def self.submit_for_partial_settlement!(*args)
|
286
|
+
Configuration.gateway.transaction.submit_for_partial_settlement!(*args)
|
236
287
|
end
|
237
288
|
|
238
|
-
def self.void(
|
239
|
-
Configuration.gateway.transaction.void(
|
289
|
+
def self.void(*args)
|
290
|
+
Configuration.gateway.transaction.void(*args)
|
240
291
|
end
|
241
292
|
|
242
|
-
def self.void!(
|
243
|
-
|
293
|
+
def self.void!(*args)
|
294
|
+
Configuration.gateway.transaction.void!(*args)
|
244
295
|
end
|
245
296
|
|
246
297
|
def initialize(gateway, attributes) # :nodoc:
|
247
298
|
@gateway = gateway
|
248
299
|
set_instance_variables_from_hash(attributes)
|
300
|
+
|
249
301
|
@amount = Util.to_big_decimal(amount)
|
302
|
+
@apple_pay_details = ApplePayDetails.new(@apple_pay)
|
303
|
+
@billing_details = AddressDetails.new(@billing)
|
250
304
|
@credit_card_details = CreditCardDetails.new(@credit_card)
|
251
|
-
@
|
252
|
-
@
|
305
|
+
@network_token_details = CreditCardDetails.new(@network_token)
|
306
|
+
@custom_fields = attributes[:custom_fields].is_a?(Hash) ? attributes[:custom_fields] : {}
|
253
307
|
@customer_details = CustomerDetails.new(@customer)
|
254
|
-
@
|
308
|
+
@descriptor = Descriptor.new(@descriptor)
|
255
309
|
@disbursement_details = DisbursementDetails.new(@disbursement_details)
|
310
|
+
@google_pay_details = GooglePayDetails.new(@google_pay_card)
|
311
|
+
@local_payment_details = LocalPaymentDetails.new(@local_payment)
|
312
|
+
@payment_instrument_type = attributes[:payment_instrument_type]
|
313
|
+
@paypal_details = PayPalDetails.new(@paypal)
|
314
|
+
@paypal_here_details = PayPalHereDetails.new(@paypal_here)
|
315
|
+
@samsung_pay_card_details = SamsungPayCardDetails.new(attributes[:samsung_pay_card])
|
316
|
+
@sca_exemption_requested = attributes[:sca_exemption_requested]
|
317
|
+
@sepa_direct_debit_account_details = SepaDirectDebitAccountDetails.new(@sepa_debit_account_detail)
|
318
|
+
@service_fee_amount = Util.to_big_decimal(service_fee_amount)
|
256
319
|
@shipping_details = AddressDetails.new(@shipping)
|
257
320
|
@status_history = attributes[:status_history] ? attributes[:status_history].map { |s| StatusDetails.new(s) } : []
|
321
|
+
@subscription_details = SubscriptionDetails.new(@subscription)
|
258
322
|
@tax_amount = Util.to_big_decimal(tax_amount)
|
259
|
-
@descriptor = Descriptor.new(@descriptor)
|
260
|
-
@paypal_details = PayPalDetails.new(@paypal)
|
261
|
-
@apple_pay_details = ApplePayDetails.new(@apple_pay)
|
262
|
-
@android_pay_details = AndroidPayDetails.new(@android_pay_card)
|
263
|
-
@amex_express_checkout_details = AmexExpressCheckoutDetails.new(@amex_express_checkout_card)
|
264
323
|
@venmo_account_details = VenmoAccountDetails.new(@venmo_account)
|
265
|
-
@
|
266
|
-
|
267
|
-
@
|
268
|
-
add_ons.map! { |attrs| AddOn._new(attrs) } if add_ons
|
269
|
-
discounts.map! { |attrs| Discount._new(attrs) } if discounts
|
270
|
-
@payment_instrument_type = attributes[:payment_instrument_type]
|
271
|
-
@risk_data = RiskData.new(attributes[:risk_data]) if attributes[:risk_data]
|
324
|
+
@visa_checkout_card_details = VisaCheckoutCardDetails.new(attributes[:visa_checkout_card])
|
325
|
+
|
326
|
+
@facilitated_details = FacilitatedDetails.new(attributes[:facilitated_details]) if attributes[:facilitated_details]
|
272
327
|
@facilitator_details = FacilitatorDetails.new(attributes[:facilitator_details]) if attributes[:facilitator_details]
|
328
|
+
@risk_data = RiskData.new(attributes[:risk_data]) if attributes[:risk_data]
|
273
329
|
@three_d_secure_info = ThreeDSecureInfo.new(attributes[:three_d_secure_info]) if attributes[:three_d_secure_info]
|
274
330
|
@us_bank_account_details = UsBankAccountDetails.new(attributes[:us_bank_account]) if attributes[:us_bank_account]
|
275
|
-
@ideal_payment_details = IdealPaymentDetails.new(attributes[:ideal_payment]) if attributes[:ideal_payment]
|
276
|
-
@visa_checkout_card_details = VisaCheckoutCardDetails.new(attributes[:visa_checkout_card])
|
277
|
-
@masterpass_card_details = MasterpassCardDetails.new(attributes[:masterpass_card])
|
278
|
-
end
|
279
331
|
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
332
|
+
add_ons.map! { |attrs| AddOn._new(attrs) } if add_ons
|
333
|
+
authorization_adjustments.map! { |attrs| AuthorizationAdjustment._new(attrs) } if authorization_adjustments
|
334
|
+
discounts.map! { |attrs| Discount._new(attrs) } if discounts
|
335
|
+
disputes.map! { |attrs| Dispute._new(attrs) } if disputes
|
336
|
+
installments.map! { |attrs| Installment.new(attrs) } if installments
|
337
|
+
refunded_installments.map! { |attrs| Installment.new(attrs) } if refunded_installments
|
284
338
|
end
|
285
339
|
|
286
340
|
def inspect # :nodoc:
|
@@ -296,16 +350,8 @@ module Braintree
|
|
296
350
|
"#<#{self.class} #{nice_attributes.join(', ')}>"
|
297
351
|
end
|
298
352
|
|
299
|
-
|
300
|
-
|
301
|
-
warn "[DEPRECATED] refund as an instance method is deprecated. Please use Transaction.refund"
|
302
|
-
result = @gateway.transaction.refund(id, amount)
|
303
|
-
|
304
|
-
if result.success?
|
305
|
-
SuccessfulResult.new(:new_transaction => result.transaction)
|
306
|
-
else
|
307
|
-
result
|
308
|
-
end
|
353
|
+
def line_items
|
354
|
+
@gateway.transaction_line_item.find_all(id)
|
309
355
|
end
|
310
356
|
|
311
357
|
# Returns true if the transaction has been refunded. False otherwise.
|
@@ -318,27 +364,6 @@ module Braintree
|
|
318
364
|
@disbursement_details.valid?
|
319
365
|
end
|
320
366
|
|
321
|
-
def refund_id
|
322
|
-
warn "[DEPRECATED] Transaction.refund_id is deprecated. Please use Transaction.refund_ids"
|
323
|
-
@refund_id
|
324
|
-
end
|
325
|
-
|
326
|
-
# Deprecated. Use Braintree::Transaction.submit_for_settlement
|
327
|
-
def submit_for_settlement(amount = nil)
|
328
|
-
warn "[DEPRECATED] submit_for_settlement as an instance method is deprecated. Please use Transaction.submit_for_settlement"
|
329
|
-
result = @gateway.transaction.submit_for_settlement(id, amount)
|
330
|
-
if result.success?
|
331
|
-
copy_instance_variables_from_object result.transaction
|
332
|
-
end
|
333
|
-
result
|
334
|
-
end
|
335
|
-
|
336
|
-
# Deprecated. Use Braintree::Transaction.submit_for_settlement!
|
337
|
-
def submit_for_settlement!(amount = nil)
|
338
|
-
warn "[DEPRECATED] submit_for_settlement! as an instance method is deprecated. Please use Transaction.submit_for_settlement!"
|
339
|
-
return_object_or_raise(:transaction) { submit_for_settlement(amount) }
|
340
|
-
end
|
341
|
-
|
342
367
|
# If this transaction was stored in the vault, or created from vault records,
|
343
368
|
# vault_billing_address will return the associated Braintree::Address. Because the
|
344
369
|
# vault billing address can be updated after the transaction was created, the attributes
|
@@ -375,31 +400,19 @@ module Braintree
|
|
375
400
|
@gateway.address.find(customer_details.id, shipping_details.id)
|
376
401
|
end
|
377
402
|
|
378
|
-
|
379
|
-
|
380
|
-
warn "[DEPRECATED] void as an instance method is deprecated. Please use Transaction.void"
|
381
|
-
result = @gateway.transaction.void(id)
|
382
|
-
if result.success?
|
383
|
-
copy_instance_variables_from_object result.transaction
|
384
|
-
end
|
385
|
-
result
|
386
|
-
end
|
387
|
-
|
388
|
-
# Deprecated. Use Braintree::Transaction.void!
|
389
|
-
def void!
|
390
|
-
warn "[DEPRECATED] void! as an instance method is deprecated. Please use Transaction.void!"
|
391
|
-
return_object_or_raise(:transaction) { void }
|
403
|
+
def processed_with_network_token?
|
404
|
+
@processed_with_network_token
|
392
405
|
end
|
393
406
|
|
394
407
|
class << self
|
395
408
|
protected :new
|
396
409
|
def _new(*args) # :nodoc:
|
397
|
-
self.new
|
410
|
+
self.new(*args)
|
398
411
|
end
|
399
412
|
end
|
400
413
|
|
401
414
|
def self._attributes # :nodoc:
|
402
|
-
[:amount, :created_at, :credit_card_details, :customer_details, :id, :status, :subscription_details, :type, :updated_at]
|
415
|
+
[:amount, :created_at, :credit_card_details, :customer_details, :id, :status, :subscription_details, :type, :updated_at, :processed_with_network_token?]
|
403
416
|
end
|
404
417
|
end
|
405
418
|
end
|