braintree 4.15.0 → 4.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/braintree/account_updater_daily_report.rb +3 -3
- data/lib/braintree/ach_mandate.rb +1 -1
- data/lib/braintree/add_on_gateway.rb +1 -1
- data/lib/braintree/address.rb +4 -4
- data/lib/braintree/address_gateway.rb +5 -5
- data/lib/braintree/advanced_search.rb +10 -10
- data/lib/braintree/apple_pay.rb +3 -3
- data/lib/braintree/apple_pay_card.rb +3 -3
- data/lib/braintree/apple_pay_options.rb +3 -3
- data/lib/braintree/authorization_adjustment.rb +3 -3
- data/lib/braintree/base_module.rb +1 -1
- data/lib/braintree/bin_data.rb +2 -2
- data/lib/braintree/client_token_gateway.rb +1 -1
- data/lib/braintree/configuration.rb +22 -22
- data/lib/braintree/connected_merchant_paypal_status_changed.rb +1 -1
- data/lib/braintree/connected_merchant_status_transitioned.rb +1 -1
- data/lib/braintree/credit_card.rb +9 -9
- data/lib/braintree/credit_card_gateway.rb +8 -8
- data/lib/braintree/credit_card_verification.rb +3 -3
- data/lib/braintree/credit_card_verification_search.rb +1 -1
- data/lib/braintree/customer.rb +5 -9
- data/lib/braintree/customer_gateway.rb +7 -7
- data/lib/braintree/customer_search.rb +1 -1
- data/lib/braintree/descriptor.rb +1 -1
- data/lib/braintree/digest.rb +1 -1
- data/lib/braintree/disbursement.rb +5 -5
- data/lib/braintree/discount_gateway.rb +1 -1
- data/lib/braintree/dispute/evidence.rb +1 -1
- data/lib/braintree/dispute/paypal_message.rb +1 -1
- data/lib/braintree/dispute/status_history.rb +1 -1
- data/lib/braintree/dispute/transaction.rb +1 -1
- data/lib/braintree/dispute/transaction_details.rb +1 -1
- data/lib/braintree/dispute.rb +3 -3
- data/lib/braintree/dispute_gateway.rb +1 -1
- data/lib/braintree/dispute_search.rb +1 -1
- data/lib/braintree/document_upload.rb +2 -2
- data/lib/braintree/document_upload_gateway.rb +3 -3
- data/lib/braintree/enriched_customer_data.rb +2 -2
- data/lib/braintree/error_result.rb +2 -3
- data/lib/braintree/errors.rb +3 -3
- data/lib/braintree/exceptions.rb +1 -2
- data/lib/braintree/exchange_rate.rb +2 -2
- data/lib/braintree/exchange_rate_quote.rb +3 -3
- data/lib/braintree/exchange_rate_quote_gateway.rb +1 -1
- data/lib/braintree/exchange_rate_quote_input.rb +3 -3
- data/lib/braintree/exchange_rate_quote_request.rb +3 -3
- data/lib/braintree/exchange_rate_quote_response.rb +3 -3
- data/lib/braintree/facilitated_details.rb +1 -1
- data/lib/braintree/facilitator_details.rb +1 -1
- data/lib/braintree/google_pay_card.rb +3 -3
- data/lib/braintree/granted_payment_instrument_update.rb +1 -1
- data/lib/braintree/graphql_client.rb +1 -1
- data/lib/braintree/http.rb +1 -1
- data/lib/braintree/local_payment_completed.rb +2 -2
- data/lib/braintree/local_payment_expired.rb +2 -2
- data/lib/braintree/local_payment_funded.rb +2 -2
- data/lib/braintree/local_payment_reversed.rb +2 -2
- data/lib/braintree/merchant.rb +3 -3
- data/lib/braintree/merchant_account.rb +2 -2
- data/lib/braintree/merchant_account_gateway.rb +9 -9
- data/lib/braintree/meta_checkout_card.rb +89 -0
- data/lib/braintree/meta_checkout_token.rb +88 -0
- data/lib/braintree/modification.rb +3 -3
- data/lib/braintree/oauth_credentials.rb +3 -3
- data/lib/braintree/paginated_collection.rb +2 -2
- data/lib/braintree/paginated_result.rb +1 -1
- data/lib/braintree/payment_instrument_type.rb +2 -0
- data/lib/braintree/payment_method_customer_data_updated_metadata.rb +2 -2
- data/lib/braintree/payment_method_gateway.rb +8 -7
- data/lib/braintree/payment_method_nonce.rb +4 -4
- data/lib/braintree/payment_method_nonce_details.rb +1 -1
- data/lib/braintree/payment_method_nonce_details_payer_info.rb +1 -1
- data/lib/braintree/payment_method_nonce_gateway.rb +1 -1
- data/lib/braintree/paypal_account.rb +1 -2
- data/lib/braintree/paypal_account_gateway.rb +5 -5
- data/lib/braintree/plan.rb +1 -1
- data/lib/braintree/plan_gateway.rb +2 -2
- data/lib/braintree/resource_collection.rb +2 -2
- data/lib/braintree/revoked_payment_method_metadata.rb +1 -1
- data/lib/braintree/risk_data.rb +1 -1
- data/lib/braintree/samsung_pay_card.rb +5 -5
- data/lib/braintree/sepa_direct_debit_account.rb +2 -2
- data/lib/braintree/sepa_direct_debit_account_nonce_details.rb +1 -1
- data/lib/braintree/settlement_batch_summary_gateway.rb +1 -1
- data/lib/braintree/sha256_digest.rb +1 -1
- data/lib/braintree/subscription/status_details.rb +1 -1
- data/lib/braintree/subscription.rb +2 -2
- data/lib/braintree/subscription_gateway.rb +6 -6
- data/lib/braintree/subscription_search.rb +1 -1
- data/lib/braintree/successful_result.rb +2 -2
- data/lib/braintree/test/credit_card.rb +7 -10
- data/lib/braintree/test/merchant_account.rb +1 -1
- data/lib/braintree/test/nonce.rb +3 -0
- data/lib/braintree/test/transaction_amounts.rb +2 -3
- data/lib/braintree/testing_gateway.rb +1 -1
- data/lib/braintree/three_d_secure_info.rb +1 -1
- data/lib/braintree/transaction/address_details.rb +1 -1
- data/lib/braintree/transaction/credit_card_details.rb +1 -1
- data/lib/braintree/transaction/customer_details.rb +1 -1
- data/lib/braintree/transaction/disbursement_details.rb +1 -1
- data/lib/braintree/transaction/meta_checkout_card_details.rb +52 -0
- data/lib/braintree/transaction/meta_checkout_token_details.rb +54 -0
- data/lib/braintree/transaction/samsung_pay_card_details.rb +1 -1
- data/lib/braintree/transaction/sepa_direct_debit_account_details.rb +1 -1
- data/lib/braintree/transaction/status_details.rb +1 -1
- data/lib/braintree/transaction/subscription_details.rb +1 -1
- data/lib/braintree/transaction/us_bank_account_details.rb +1 -1
- data/lib/braintree/transaction/visa_checkout_card_details.rb +1 -1
- data/lib/braintree/transaction.rb +22 -16
- data/lib/braintree/transaction_gateway.rb +9 -10
- data/lib/braintree/transaction_line_item.rb +2 -2
- data/lib/braintree/transaction_line_item_gateway.rb +1 -1
- data/lib/braintree/transaction_review.rb +1 -1
- data/lib/braintree/transaction_search.rb +1 -1
- data/lib/braintree/unknown_payment_method.rb +1 -1
- data/lib/braintree/us_bank_account.rb +2 -2
- data/lib/braintree/us_bank_account_verification.rb +23 -15
- data/lib/braintree/us_bank_account_verification_search.rb +1 -1
- data/lib/braintree/util.rb +3 -3
- data/lib/braintree/validation_error.rb +1 -1
- data/lib/braintree/validation_error_collection.rb +3 -3
- data/lib/braintree/venmo_account.rb +3 -3
- data/lib/braintree/venmo_profile_data.rb +6 -4
- data/lib/braintree/version.rb +1 -1
- data/lib/braintree/visa_checkout_card.rb +7 -7
- data/lib/braintree/webhook_notification.rb +2 -2
- data/lib/braintree/webhook_notification_gateway.rb +3 -3
- data/lib/braintree/webhook_testing.rb +1 -1
- data/lib/braintree/webhook_testing_gateway.rb +1 -1
- data/lib/braintree/xml/generator.rb +1 -1
- data/lib/braintree/xml/libxml.rb +1 -1
- data/lib/braintree/xml/parser.rb +2 -2
- data/lib/braintree/xml/rexml.rb +2 -2
- data/lib/braintree/xml.rb +1 -1
- data/lib/braintree.rb +4 -1
- data/spec/integration/braintree/dispute_search_spec.rb +0 -1
- data/spec/integration/braintree/payment_method_nonce_spec.rb +20 -0
- data/spec/integration/braintree/payment_method_us_bank_account_spec.rb +72 -0
- data/spec/integration/braintree/transaction_search_spec.rb +27 -0
- data/spec/integration/braintree/transaction_spec.rb +192 -66
- data/spec/unit/braintree/enriched_customer_data_spec.rb +9 -0
- data/spec/unit/braintree/http_spec.rb +1 -1
- data/spec/unit/braintree/meta_checkout_card_details_spec.rb +60 -0
- data/spec/unit/braintree/meta_checkout_card_spec.rb +60 -0
- data/spec/unit/braintree/meta_checkout_token_details_spec.rb +63 -0
- data/spec/unit/braintree/meta_checkout_token_spec.rb +63 -0
- data/spec/unit/braintree/transaction_gateway_spec.rb +30 -1
- data/spec/unit/braintree/us_bank_account_verification_spec.rb +5 -0
- data/spec/unit/braintree/venmo_profile_data_spec.rb +11 -0
- metadata +10 -2
|
@@ -91,7 +91,7 @@ module Braintree
|
|
|
91
91
|
Configuration.gateway.subscription.update!(*args)
|
|
92
92
|
end
|
|
93
93
|
|
|
94
|
-
def initialize(gateway, attributes)
|
|
94
|
+
def initialize(gateway, attributes)
|
|
95
95
|
@gateway = gateway
|
|
96
96
|
set_instance_variables_from_hash(attributes)
|
|
97
97
|
@balance = Util.to_big_decimal(balance)
|
|
@@ -114,7 +114,7 @@ module Braintree
|
|
|
114
114
|
|
|
115
115
|
class << self
|
|
116
116
|
protected :new
|
|
117
|
-
def _new(*args)
|
|
117
|
+
def _new(*args)
|
|
118
118
|
self.new(*args)
|
|
119
119
|
end
|
|
120
120
|
end
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
module Braintree
|
|
2
|
-
class SubscriptionGateway
|
|
2
|
+
class SubscriptionGateway
|
|
3
3
|
include BaseModule
|
|
4
4
|
|
|
5
5
|
def initialize(gateway)
|
|
@@ -70,7 +70,7 @@ module Braintree
|
|
|
70
70
|
return_object_or_raise(:subscription) { update(*args) }
|
|
71
71
|
end
|
|
72
72
|
|
|
73
|
-
def self._create_signature
|
|
73
|
+
def self._create_signature
|
|
74
74
|
[
|
|
75
75
|
:billing_day_of_month,
|
|
76
76
|
:first_billing_date,
|
|
@@ -94,7 +94,7 @@ module Braintree
|
|
|
94
94
|
] + _add_on_discount_signature
|
|
95
95
|
end
|
|
96
96
|
|
|
97
|
-
def self._update_signature
|
|
97
|
+
def self._update_signature
|
|
98
98
|
[
|
|
99
99
|
:id,
|
|
100
100
|
:merchant_account_id,
|
|
@@ -114,7 +114,7 @@ module Braintree
|
|
|
114
114
|
] + _add_on_discount_signature
|
|
115
115
|
end
|
|
116
116
|
|
|
117
|
-
def self._add_on_discount_signature
|
|
117
|
+
def self._add_on_discount_signature
|
|
118
118
|
[
|
|
119
119
|
{
|
|
120
120
|
:add_ons => [
|
|
@@ -133,7 +133,7 @@ module Braintree
|
|
|
133
133
|
]
|
|
134
134
|
end
|
|
135
135
|
|
|
136
|
-
def _do_create(path, params)
|
|
136
|
+
def _do_create(path, params)
|
|
137
137
|
response = @config.http.post("#{@config.base_merchant_path}#{path}", params)
|
|
138
138
|
if response[:subscription]
|
|
139
139
|
SuccessfulResult.new(:subscription => Subscription._new(@gateway, response[:subscription]))
|
|
@@ -144,7 +144,7 @@ module Braintree
|
|
|
144
144
|
end
|
|
145
145
|
end
|
|
146
146
|
|
|
147
|
-
def _fetch_subscriptions(search, ids)
|
|
147
|
+
def _fetch_subscriptions(search, ids)
|
|
148
148
|
search.ids.in ids
|
|
149
149
|
response = @config.http.post("#{@config.base_merchant_path}/subscriptions/advanced_search", {:search => search.to_hash})
|
|
150
150
|
attributes = response[:subscriptions]
|
|
@@ -25,7 +25,7 @@ module Braintree
|
|
|
25
25
|
attr_reader :transaction
|
|
26
26
|
attr_reader :us_bank_account_verification
|
|
27
27
|
|
|
28
|
-
def initialize(attributes = {})
|
|
28
|
+
def initialize(attributes = {})
|
|
29
29
|
@attrs = attributes.keys
|
|
30
30
|
attributes.each do |key, value|
|
|
31
31
|
instance_variable_set("@#{key}", value)
|
|
@@ -33,7 +33,7 @@ module Braintree
|
|
|
33
33
|
@credit_card_verification = @verification
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
-
def inspect
|
|
36
|
+
def inspect
|
|
37
37
|
inspected_attributes = @attrs.map { |attr| "#{attr}:#{send(attr).inspect}" }
|
|
38
38
|
"#<#{self.class} #{inspected_attributes.join(" ")}>"
|
|
39
39
|
end
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
module Braintree
|
|
2
|
-
module Test
|
|
3
|
-
# The constants contained in the Braintree::Test::CreditCardNumbers module provide
|
|
4
|
-
# credit card numbers that should be used when working in the sandbox environment. The sandbox
|
|
5
|
-
# will not accept any credit card numbers other than the ones listed below.
|
|
2
|
+
module Test
|
|
6
3
|
module CreditCardNumbers
|
|
7
4
|
module CardTypeIndicators
|
|
8
5
|
Prepaid = "4111111111111210"
|
|
@@ -18,16 +15,16 @@ module Braintree
|
|
|
18
15
|
end
|
|
19
16
|
|
|
20
17
|
AmExes = %w[378282246310005 371449635398431 378734493671000]
|
|
21
|
-
CarteBlanches = %w[30569309025904]
|
|
22
|
-
DinersClubs = %w[38520000023237]
|
|
18
|
+
CarteBlanches = %w[30569309025904]
|
|
19
|
+
DinersClubs = %w[38520000023237]
|
|
23
20
|
|
|
24
21
|
Discover = "6011111111111117"
|
|
25
22
|
Discovers = %w[6011111111111117 6011000990139424]
|
|
26
|
-
JCBs = %w[3530111333300000 3566002020360505]
|
|
23
|
+
JCBs = %w[3530111333300000 3566002020360505]
|
|
27
24
|
|
|
28
|
-
Maestro = "6304000000000000"
|
|
25
|
+
Maestro = "6304000000000000"
|
|
29
26
|
MasterCard = "5555555555554444"
|
|
30
|
-
MasterCardInternational = "5105105105105100"
|
|
27
|
+
MasterCardInternational = "5105105105105100"
|
|
31
28
|
|
|
32
29
|
MasterCards = %w[5105105105105100 5555555555554444]
|
|
33
30
|
|
|
@@ -37,7 +34,7 @@ module Braintree
|
|
|
37
34
|
|
|
38
35
|
Visa = "4012888888881881"
|
|
39
36
|
VisaCountryOfIssuanceIE = "4023490000000008"
|
|
40
|
-
VisaInternational = "4009348888881881"
|
|
37
|
+
VisaInternational = "4009348888881881"
|
|
41
38
|
VisaPrepaid = "4500600000000061"
|
|
42
39
|
|
|
43
40
|
Fraud = "4000111111111511"
|
data/lib/braintree/test/nonce.rb
CHANGED
|
@@ -18,6 +18,8 @@ module Braintree
|
|
|
18
18
|
GooglePayVisa = "fake-android-pay-visa-nonce"
|
|
19
19
|
GooglePayMasterCard = "fake-android-pay-mastercard-nonce"
|
|
20
20
|
GooglePayAmEx = "fake-android-pay-amex-nonce"
|
|
21
|
+
MetaCheckoutCard = "fake-meta-checkout-card-nonce"
|
|
22
|
+
MetaCheckoutToken = "fake-meta-checkout-token-nonce"
|
|
21
23
|
VenmoAccount = "fake-venmo-account-nonce"
|
|
22
24
|
VenmoAccountTokenIssuanceError = "fake-token-issuance-error-venmo-account-nonce"
|
|
23
25
|
ThreeDSecureVisaFullAuthentication = "fake-three-d-secure-visa-full-authentication-nonce"
|
|
@@ -72,6 +74,7 @@ module Braintree
|
|
|
72
74
|
SamsungPayMasterCard = "tokensam_fake_mastercard"
|
|
73
75
|
SamsungPayVisa = "tokensam_fake_visa"
|
|
74
76
|
SepaDirectDebit = "fake-sepa-direct-debit-nonce"
|
|
77
|
+
UsBankAccount = "fake-us-bank-account-nonce"
|
|
75
78
|
end
|
|
76
79
|
end
|
|
77
80
|
end
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
module Braintree
|
|
2
|
-
module Test
|
|
3
|
-
#
|
|
4
|
-
# the desired status in the sandbox environment.
|
|
2
|
+
module Test
|
|
3
|
+
# NEXT_MAJOR_VERSION are these even being used anymore? Can we remove this class??
|
|
5
4
|
module TransactionAmounts
|
|
6
5
|
Authorize = "1000.00"
|
|
7
6
|
Decline = "2000.00"
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
module Braintree
|
|
2
|
+
class Transaction
|
|
3
|
+
class MetaCheckoutCardDetails # :nodoc:
|
|
4
|
+
include BaseModule
|
|
5
|
+
|
|
6
|
+
attr_reader :bin
|
|
7
|
+
attr_reader :card_type
|
|
8
|
+
attr_reader :cardholder_name
|
|
9
|
+
attr_reader :commercial
|
|
10
|
+
attr_reader :container_id
|
|
11
|
+
attr_reader :country_of_issuance
|
|
12
|
+
attr_reader :created_at
|
|
13
|
+
attr_reader :customer_location
|
|
14
|
+
attr_reader :debit
|
|
15
|
+
attr_reader :durbin_regulated
|
|
16
|
+
attr_reader :expiration_month
|
|
17
|
+
attr_reader :expiration_year
|
|
18
|
+
attr_reader :healthcare
|
|
19
|
+
attr_reader :image_url
|
|
20
|
+
attr_reader :is_network_tokenized
|
|
21
|
+
attr_reader :issuing_bank
|
|
22
|
+
attr_reader :last_4
|
|
23
|
+
attr_reader :payroll
|
|
24
|
+
attr_reader :prepaid
|
|
25
|
+
attr_reader :product_id
|
|
26
|
+
attr_reader :token
|
|
27
|
+
attr_reader :unique_number_identifier
|
|
28
|
+
attr_reader :updated_at
|
|
29
|
+
|
|
30
|
+
def initialize(attributes)
|
|
31
|
+
set_instance_variables_from_hash attributes unless attributes.nil?
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def expiration_date
|
|
35
|
+
"#{expiration_month}/#{expiration_year}"
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def inspect
|
|
39
|
+
attr_order = [:token, :bin, :last_4, :card_type, :expiration_date, :cardholder_name, :customer_location, :prepaid,
|
|
40
|
+
:healthcare, :durbin_regulated, :debit, :commercial, :payroll, :product_id, :country_of_issuance, :issuing_bank, :image_url, :container_id]
|
|
41
|
+
formatted_attrs = attr_order.map do |attr|
|
|
42
|
+
"#{attr}: #{send(attr).inspect}"
|
|
43
|
+
end
|
|
44
|
+
"#<#{formatted_attrs.join(", ")}>"
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def masked_number
|
|
48
|
+
"#{bin}******#{last_4}"
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
module Braintree
|
|
2
|
+
class Transaction
|
|
3
|
+
class MetaCheckoutTokenDetails # :nodoc:
|
|
4
|
+
include BaseModule
|
|
5
|
+
|
|
6
|
+
attr_reader :bin
|
|
7
|
+
attr_reader :container_id
|
|
8
|
+
attr_reader :card_type
|
|
9
|
+
attr_reader :cardholder_name
|
|
10
|
+
attr_reader :commercial
|
|
11
|
+
attr_reader :country_of_issuance
|
|
12
|
+
attr_reader :created_at
|
|
13
|
+
attr_reader :cryptogram
|
|
14
|
+
attr_reader :customer_location
|
|
15
|
+
attr_reader :debit
|
|
16
|
+
attr_reader :durbin_regulated
|
|
17
|
+
attr_reader :ecommerce_indicator
|
|
18
|
+
attr_reader :expiration_month
|
|
19
|
+
attr_reader :expiration_year
|
|
20
|
+
attr_reader :healthcare
|
|
21
|
+
attr_reader :image_url
|
|
22
|
+
attr_reader :issuing_bank
|
|
23
|
+
attr_reader :is_network_tokenized
|
|
24
|
+
attr_reader :last_4
|
|
25
|
+
attr_reader :payroll
|
|
26
|
+
attr_reader :prepaid
|
|
27
|
+
attr_reader :product_id
|
|
28
|
+
attr_reader :token
|
|
29
|
+
attr_reader :unique_number_identifier
|
|
30
|
+
attr_reader :updated_at
|
|
31
|
+
|
|
32
|
+
def initialize(attributes)
|
|
33
|
+
set_instance_variables_from_hash attributes unless attributes.nil?
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def expiration_date
|
|
37
|
+
"#{expiration_month}/#{expiration_year}"
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def inspect
|
|
41
|
+
attr_order = [:container_id, :cryptogram, :ecommerce_indicator, :token, :bin, :last_4, :card_type, :expiration_date, :cardholder_name, :customer_location, :prepaid,
|
|
42
|
+
:healthcare, :durbin_regulated, :debit, :commercial, :payroll, :product_id, :country_of_issuance, :issuing_bank, :is_network_tokenized, :image_url]
|
|
43
|
+
formatted_attrs = attr_order.map do |attr|
|
|
44
|
+
"#{attr}: #{send(attr).inspect}"
|
|
45
|
+
end
|
|
46
|
+
"#<#{formatted_attrs.join(", ")}>"
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def masked_number
|
|
50
|
+
"#{bin}******#{last_4}"
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -77,9 +77,9 @@ module Braintree
|
|
|
77
77
|
All = constants.map { |c| const_get(c) }
|
|
78
78
|
end
|
|
79
79
|
|
|
80
|
-
module Type
|
|
81
|
-
Credit = "credit"
|
|
82
|
-
Sale = "sale"
|
|
80
|
+
module Type
|
|
81
|
+
Credit = "credit"
|
|
82
|
+
Sale = "sale"
|
|
83
83
|
|
|
84
84
|
All = constants.map { |c| const_get(c) }
|
|
85
85
|
end
|
|
@@ -131,6 +131,8 @@ module Braintree
|
|
|
131
131
|
attr_reader :merchant_account_id
|
|
132
132
|
attr_reader :merchant_advice_code
|
|
133
133
|
attr_reader :merchant_advice_code_text
|
|
134
|
+
attr_reader :meta_checkout_card_details
|
|
135
|
+
attr_reader :meta_checkout_token_details
|
|
134
136
|
attr_reader :network_response_code # Response code from the card network
|
|
135
137
|
attr_reader :network_response_text # Response text from the card network
|
|
136
138
|
attr_reader :network_token_details
|
|
@@ -142,12 +144,12 @@ module Braintree
|
|
|
142
144
|
attr_reader :paypal_details
|
|
143
145
|
attr_reader :paypal_here_details
|
|
144
146
|
attr_reader :plan_id
|
|
145
|
-
attr_reader :processor_authorization_code
|
|
146
|
-
attr_reader :processor_response_code
|
|
147
|
-
attr_reader :processor_response_text
|
|
148
|
-
attr_reader :processor_response_type
|
|
149
|
-
attr_reader :processor_settlement_response_code
|
|
150
|
-
attr_reader :processor_settlement_response_text
|
|
147
|
+
attr_reader :processor_authorization_code
|
|
148
|
+
attr_reader :processor_response_code
|
|
149
|
+
attr_reader :processor_response_text
|
|
150
|
+
attr_reader :processor_response_type
|
|
151
|
+
attr_reader :processor_settlement_response_code
|
|
152
|
+
attr_reader :processor_settlement_response_text
|
|
151
153
|
attr_reader :product_sku
|
|
152
154
|
attr_reader :purchase_order_number
|
|
153
155
|
attr_reader :recurring
|
|
@@ -175,7 +177,7 @@ module Braintree
|
|
|
175
177
|
attr_reader :tax_amount
|
|
176
178
|
attr_reader :tax_exempt
|
|
177
179
|
attr_reader :three_d_secure_info
|
|
178
|
-
attr_reader :type
|
|
180
|
+
attr_reader :type
|
|
179
181
|
attr_reader :updated_at
|
|
180
182
|
attr_reader :us_bank_account_details
|
|
181
183
|
attr_reader :venmo_account_details
|
|
@@ -298,7 +300,7 @@ module Braintree
|
|
|
298
300
|
Configuration.gateway.transaction.void!(*args)
|
|
299
301
|
end
|
|
300
302
|
|
|
301
|
-
def initialize(gateway, attributes)
|
|
303
|
+
def initialize(gateway, attributes)
|
|
302
304
|
@gateway = gateway
|
|
303
305
|
set_instance_variables_from_hash(attributes)
|
|
304
306
|
|
|
@@ -313,6 +315,8 @@ module Braintree
|
|
|
313
315
|
@disbursement_details = DisbursementDetails.new(@disbursement_details)
|
|
314
316
|
@google_pay_details = GooglePayDetails.new(@google_pay_card)
|
|
315
317
|
@local_payment_details = LocalPaymentDetails.new(@local_payment)
|
|
318
|
+
@meta_checkout_card_details = MetaCheckoutCardDetails.new(attributes[:meta_checkout_card])
|
|
319
|
+
@meta_checkout_token_details = MetaCheckoutTokenDetails.new(attributes[:meta_checkout_token])
|
|
316
320
|
@payment_instrument_type = attributes[:payment_instrument_type]
|
|
317
321
|
@payment_receipt = PaymentReceipt.new(attributes[:payment_receipt]) if attributes[:payment_receipt]
|
|
318
322
|
@paypal_details = PayPalDetails.new(@paypal)
|
|
@@ -342,7 +346,7 @@ module Braintree
|
|
|
342
346
|
refunded_installments.map! { |attrs| Installment.new(attrs) } if refunded_installments
|
|
343
347
|
end
|
|
344
348
|
|
|
345
|
-
def inspect
|
|
349
|
+
def inspect
|
|
346
350
|
first = [:id, :type, :amount, :status]
|
|
347
351
|
order = first + (self.class._attributes - first)
|
|
348
352
|
nice_attributes = order.map do |attr|
|
|
@@ -359,12 +363,10 @@ module Braintree
|
|
|
359
363
|
@gateway.transaction_line_item.find_all(id)
|
|
360
364
|
end
|
|
361
365
|
|
|
362
|
-
# Returns true if the transaction has been refunded. False otherwise.
|
|
363
366
|
def refunded?
|
|
364
367
|
!@refund_id.nil?
|
|
365
368
|
end
|
|
366
369
|
|
|
367
|
-
# Returns true if the transaction has been disbursed. False otherwise.
|
|
368
370
|
def disbursed?
|
|
369
371
|
@disbursement_details.valid?
|
|
370
372
|
end
|
|
@@ -373,6 +375,7 @@ module Braintree
|
|
|
373
375
|
# vault_billing_address will return the associated Braintree::Address. Because the
|
|
374
376
|
# vault billing address can be updated after the transaction was created, the attributes
|
|
375
377
|
# on vault_billing_address may not match the attributes on billing_details.
|
|
378
|
+
# NEXT_MAJOR_VERSION these methods are not documented in the developer docs, remove
|
|
376
379
|
def vault_billing_address
|
|
377
380
|
return nil if billing_details.id.nil?
|
|
378
381
|
@gateway.address.find(customer_details.id, billing_details.id)
|
|
@@ -382,6 +385,7 @@ module Braintree
|
|
|
382
385
|
# vault_credit_card will return the associated Braintree::CreditCard. Because the
|
|
383
386
|
# vault credit card can be updated after the transaction was created, the attributes
|
|
384
387
|
# on vault_credit_card may not match the attributes on credit_card_details.
|
|
388
|
+
# NEXT_MAJOR_VERSION these methods are not documented in the developer docs, remove
|
|
385
389
|
def vault_credit_card
|
|
386
390
|
return nil if credit_card_details.token.nil?
|
|
387
391
|
@gateway.credit_card.find(credit_card_details.token)
|
|
@@ -391,6 +395,7 @@ module Braintree
|
|
|
391
395
|
# vault_customer will return the associated Braintree::Customer. Because the
|
|
392
396
|
# vault customer can be updated after the transaction was created, the attributes
|
|
393
397
|
# on vault_customer may not match the attributes on customer_details.
|
|
398
|
+
# NEXT_MAJOR_VERSION these methods are not documented in the developer docs, remove
|
|
394
399
|
def vault_customer
|
|
395
400
|
return nil if customer_details.id.nil?
|
|
396
401
|
@gateway.customer.find(customer_details.id)
|
|
@@ -400,6 +405,7 @@ module Braintree
|
|
|
400
405
|
# vault_shipping_address will return the associated Braintree::Address. Because the
|
|
401
406
|
# vault shipping address can be updated after the transaction was created, the attributes
|
|
402
407
|
# on vault_shipping_address may not match the attributes on shipping_details.
|
|
408
|
+
# NEXT_MAJOR_VERSION these methods are not documented in the developer docs, remove
|
|
403
409
|
def vault_shipping_address
|
|
404
410
|
return nil if shipping_details.id.nil?
|
|
405
411
|
@gateway.address.find(customer_details.id, shipping_details.id)
|
|
@@ -411,12 +417,12 @@ module Braintree
|
|
|
411
417
|
|
|
412
418
|
class << self
|
|
413
419
|
protected :new
|
|
414
|
-
def _new(*args)
|
|
420
|
+
def _new(*args)
|
|
415
421
|
self.new(*args)
|
|
416
422
|
end
|
|
417
423
|
end
|
|
418
424
|
|
|
419
|
-
def self._attributes
|
|
425
|
+
def self._attributes
|
|
420
426
|
[:amount, :created_at, :credit_card_details, :customer_details, :id, :status, :subscription_details, :type, :updated_at, :processed_with_network_token?]
|
|
421
427
|
end
|
|
422
428
|
end
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
module Braintree
|
|
2
|
-
class TransactionGateway
|
|
2
|
+
class TransactionGateway
|
|
3
3
|
include BaseModule
|
|
4
4
|
|
|
5
5
|
def initialize(gateway)
|
|
@@ -187,15 +187,14 @@ module Braintree
|
|
|
187
187
|
return_object_or_raise(:transaction) { void(*args) }
|
|
188
188
|
end
|
|
189
189
|
|
|
190
|
-
def self._clone_signature
|
|
190
|
+
def self._clone_signature
|
|
191
191
|
[:amount, :channel, {:options => [:submit_for_settlement]}]
|
|
192
192
|
end
|
|
193
193
|
|
|
194
|
-
|
|
195
194
|
# NEXT_MAJOR_VERSION Remove venmo_sdk_payment_method_code, venmo_sdk_session, and three_d_secure_token
|
|
196
195
|
# The old venmo SDK class has been deprecated
|
|
197
196
|
# three_d_secure_token has been deprecated in favor of three_d_secure_authentication_id
|
|
198
|
-
def self._create_signature
|
|
197
|
+
def self._create_signature
|
|
199
198
|
[
|
|
200
199
|
:amount, :billing_address_id, :channel, :customer_id, :device_data, :discount_amount,
|
|
201
200
|
:merchant_account_id, :order_id, :payment_method_nonce, :payment_method_token,
|
|
@@ -258,7 +257,7 @@ module Braintree
|
|
|
258
257
|
{:industry => [
|
|
259
258
|
:industry_type,
|
|
260
259
|
{:data => [
|
|
261
|
-
:folio_number, :check_in_date, :check_out_date, :travel_package, :lodging_check_in_date, :lodging_check_out_date, :departure_date, :lodging_name, :room_rate, :room_tax,
|
|
260
|
+
:country_code, :date_of_birth, :folio_number, :check_in_date, :check_out_date, :travel_package, :lodging_check_in_date, :lodging_check_out_date, :departure_date, :lodging_name, :room_rate, :room_tax,
|
|
262
261
|
:passenger_first_name, :passenger_last_name, :passenger_middle_initial, :passenger_title, :issued_date, :travel_agency_name, :travel_agency_code, :ticket_number,
|
|
263
262
|
:issuing_carrier_code, :customer_code, :fare_amount, :fee_amount, :tax_amount, :restricted_ticket, :no_show, :advanced_deposit, :fire_safe, :property_phone, :ticket_issuer_address, :arrival_date,
|
|
264
263
|
{:legs => [
|
|
@@ -276,14 +275,14 @@ module Braintree
|
|
|
276
275
|
]
|
|
277
276
|
end
|
|
278
277
|
|
|
279
|
-
def self._submit_for_settlement_signature
|
|
278
|
+
def self._submit_for_settlement_signature
|
|
280
279
|
[
|
|
281
280
|
:order_id,
|
|
282
281
|
{:descriptor => [:name, :phone, :url]},
|
|
283
282
|
{:industry => [
|
|
284
283
|
:industry_type,
|
|
285
284
|
{:data => [
|
|
286
|
-
:folio_number, :check_in_date, :check_out_date, :travel_package, :lodging_check_in_date, :lodging_check_out_date, :departure_date, :lodging_name, :room_rate, :room_tax,
|
|
285
|
+
:country_code, :date_of_birth, :folio_number, :check_in_date, :check_out_date, :travel_package, :lodging_check_in_date, :lodging_check_out_date, :departure_date, :lodging_name, :room_rate, :room_tax,
|
|
287
286
|
:passenger_first_name, :passenger_last_name, :passenger_middle_initial, :passenger_title, :issued_date, :travel_agency_name, :travel_agency_code, :ticket_number,
|
|
288
287
|
:issuing_carrier_code, :customer_code, :fare_amount, :fee_amount, :tax_amount, :restricted_ticket, :no_show, :advanced_deposit, :fire_safe, :property_phone, :ticket_issuer_address, :arrival_date,
|
|
289
288
|
{:legs => [
|
|
@@ -311,7 +310,7 @@ module Braintree
|
|
|
311
310
|
]
|
|
312
311
|
end
|
|
313
312
|
|
|
314
|
-
def self._update_details_signature
|
|
313
|
+
def self._update_details_signature
|
|
315
314
|
[
|
|
316
315
|
:amount,
|
|
317
316
|
:order_id,
|
|
@@ -327,7 +326,7 @@ module Braintree
|
|
|
327
326
|
]
|
|
328
327
|
end
|
|
329
328
|
|
|
330
|
-
def _do_create(path, params=nil)
|
|
329
|
+
def _do_create(path, params=nil)
|
|
331
330
|
if !params.nil?
|
|
332
331
|
params = Util.replace_key(params, :google_pay_card, :android_pay_card)
|
|
333
332
|
end
|
|
@@ -335,7 +334,7 @@ module Braintree
|
|
|
335
334
|
_handle_transaction_response(response)
|
|
336
335
|
end
|
|
337
336
|
|
|
338
|
-
def _fetch_transactions(search, ids)
|
|
337
|
+
def _fetch_transactions(search, ids)
|
|
339
338
|
search.ids.in ids
|
|
340
339
|
response = @config.http.post("#{@config.base_merchant_path}/transactions/advanced_search", {:search => search.to_hash})
|
|
341
340
|
attributes = response[:credit_card_transactions]
|
|
@@ -15,7 +15,7 @@ module Braintree
|
|
|
15
15
|
attr_reader :commodity_code
|
|
16
16
|
attr_reader :url
|
|
17
17
|
|
|
18
|
-
def initialize(gateway, attributes)
|
|
18
|
+
def initialize(gateway, attributes)
|
|
19
19
|
@gateway = gateway
|
|
20
20
|
set_instance_variables_from_hash(attributes)
|
|
21
21
|
@quantity = Util.to_big_decimal(quantity)
|
|
@@ -28,7 +28,7 @@ module Braintree
|
|
|
28
28
|
|
|
29
29
|
class << self
|
|
30
30
|
protected :new
|
|
31
|
-
def _new(*args)
|
|
31
|
+
def _new(*args)
|
|
32
32
|
self.new(*args)
|
|
33
33
|
end
|
|
34
34
|
end
|