braintree 4.15.0 → 4.17.0
Sign up to get free protection for your applications and to get access to all the features.
- 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_gateway.rb +28 -11
- 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 +5 -5
- 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 +2 -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 +4 -4
- 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 +3 -3
- 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/client_api/spec_helper.rb +2 -2
- data/spec/integration/braintree/credit_card_verification_spec.rb +45 -0
- 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/base_module_spec.rb +1 -1
- data/spec/unit/braintree/credit_card_verification_gateway_spec.rb +13 -8
- 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
data/lib/braintree/risk_data.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Braintree
|
2
2
|
class SamsungPayCard
|
3
|
-
include BaseModule
|
3
|
+
include BaseModule
|
4
4
|
include Braintree::Util::TokenEquality
|
5
5
|
|
6
6
|
attr_reader :billing_address
|
@@ -29,7 +29,7 @@ module Braintree
|
|
29
29
|
attr_reader :unique_number_identifier
|
30
30
|
attr_reader :updated_at
|
31
31
|
|
32
|
-
def initialize(gateway, attributes)
|
32
|
+
def initialize(gateway, attributes)
|
33
33
|
@gateway = gateway
|
34
34
|
set_instance_variables_from_hash(attributes)
|
35
35
|
@billing_address = attributes[:billing_address] ? Address._new(@gateway, attributes[:billing_address]) : nil
|
@@ -49,7 +49,7 @@ module Braintree
|
|
49
49
|
@expired
|
50
50
|
end
|
51
51
|
|
52
|
-
def inspect
|
52
|
+
def inspect
|
53
53
|
first = [:token]
|
54
54
|
order = first + (self.class._attributes - first)
|
55
55
|
nice_attributes = order.map do |attr|
|
@@ -66,7 +66,7 @@ module Braintree
|
|
66
66
|
protected :new
|
67
67
|
end
|
68
68
|
|
69
|
-
def self._attributes
|
69
|
+
def self._attributes
|
70
70
|
[
|
71
71
|
:billing_address, :bin, :cardholder_name, :card_type, :created_at, :customer_id,
|
72
72
|
:customer_location, :expiration_month, :expiration_year,
|
@@ -76,7 +76,7 @@ module Braintree
|
|
76
76
|
]
|
77
77
|
end
|
78
78
|
|
79
|
-
def self._new(*args)
|
79
|
+
def self._new(*args)
|
80
80
|
self.new(*args)
|
81
81
|
end
|
82
82
|
end
|
@@ -17,7 +17,7 @@ module Braintree
|
|
17
17
|
attr_reader :updated_at
|
18
18
|
attr_reader :view_mandate_url
|
19
19
|
|
20
|
-
def initialize(gateway, attributes)
|
20
|
+
def initialize(gateway, attributes)
|
21
21
|
@gateway = gateway
|
22
22
|
@subscriptions = (@subscriptions || []).map { |subscription_hash| Subscription._new(@gateway, subscription_hash) }
|
23
23
|
set_instance_variables_from_hash(attributes)
|
@@ -31,7 +31,7 @@ module Braintree
|
|
31
31
|
protected :new
|
32
32
|
end
|
33
33
|
|
34
|
-
def self._new(*args)
|
34
|
+
def self._new(*args)
|
35
35
|
self.new(*args)
|
36
36
|
end
|
37
37
|
|
@@ -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"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Braintree
|
2
2
|
class Transaction
|
3
|
-
class AddressDetails
|
3
|
+
class AddressDetails
|
4
4
|
include BaseModule
|
5
5
|
|
6
6
|
module ShippingMethod
|
@@ -10,6 +10,7 @@ module Braintree
|
|
10
10
|
Ground = "ground"
|
11
11
|
Electronic = "electronic"
|
12
12
|
ShipToStore = "ship_to_store"
|
13
|
+
PickupInStore = "pickup_in_store"
|
13
14
|
end
|
14
15
|
|
15
16
|
attr_reader :company
|
@@ -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
|