braintree 4.13.0 → 4.15.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/credit_card.rb +13 -0
- data/lib/braintree/credit_card_gateway.rb +15 -3
- data/lib/braintree/payment_method_gateway.rb +15 -3
- data/lib/braintree/test/nonce.rb +1 -0
- data/lib/braintree/test/venmo_sdk.rb +2 -0
- data/lib/braintree/transaction/credit_card_details.rb +3 -0
- data/lib/braintree/transaction/local_payment_details.rb +2 -0
- data/lib/braintree/transaction/payment_receipt/card_present_data.rb +36 -0
- data/lib/braintree/transaction/payment_receipt/merchant_address.rb +19 -0
- data/lib/braintree/transaction/payment_receipt.rb +31 -0
- data/lib/braintree/transaction/us_bank_account_details.rb +1 -0
- data/lib/braintree/transaction.rb +7 -4
- data/lib/braintree/transaction_gateway.rb +15 -3
- data/lib/braintree/transaction_search.rb +6 -5
- data/lib/braintree/version.rb +1 -1
- data/lib/braintree/webhook_notification.rb +1 -0
- data/lib/braintree/webhook_testing_gateway.rb +17 -0
- data/lib/braintree.rb +3 -0
- data/spec/integration/braintree/add_on_spec.rb +9 -9
- data/spec/integration/braintree/address_spec.rb +69 -69
- data/spec/integration/braintree/advanced_search_spec.rb +45 -45
- data/spec/integration/braintree/apple_pay_spec.rb +8 -8
- data/spec/integration/braintree/client_api/client_token_spec.rb +15 -15
- data/spec/integration/braintree/credit_card_spec.rb +223 -223
- data/spec/integration/braintree/credit_card_verification_search_spec.rb +16 -16
- data/spec/integration/braintree/credit_card_verification_spec.rb +52 -52
- data/spec/integration/braintree/customer_search_spec.rb +20 -20
- data/spec/integration/braintree/customer_spec.rb +313 -313
- data/spec/integration/braintree/disbursement_spec.rb +2 -2
- data/spec/integration/braintree/discount_spec.rb +9 -9
- data/spec/integration/braintree/dispute_spec.rb +87 -87
- data/spec/integration/braintree/document_upload_spec.rb +17 -17
- data/spec/integration/braintree/error_codes_spec.rb +2 -2
- data/spec/integration/braintree/http_spec.rb +28 -28
- data/spec/integration/braintree/merchant_account_spec.rb +127 -127
- data/spec/integration/braintree/merchant_spec.rb +103 -103
- data/spec/integration/braintree/oauth_spec.rb +61 -61
- data/spec/integration/braintree/payment_method_nonce_spec.rb +73 -73
- data/spec/integration/braintree/payment_method_spec.rb +389 -389
- data/spec/integration/braintree/payment_method_us_bank_account_spec.rb +78 -78
- data/spec/integration/braintree/paypal_account_spec.rb +38 -38
- data/spec/integration/braintree/plan_spec.rb +15 -15
- data/spec/integration/braintree/samsung_pay_card_spec.rb +65 -65
- data/spec/integration/braintree/sepa_direct_debit_account_spec.rb +51 -51
- data/spec/integration/braintree/settlement_batch_summary_spec.rb +11 -11
- data/spec/integration/braintree/subscription_spec.rb +364 -364
- data/spec/integration/braintree/test/transaction_amounts_spec.rb +2 -2
- data/spec/integration/braintree/test_transaction_spec.rb +19 -19
- data/spec/integration/braintree/transaction_line_item_spec.rb +6 -6
- data/spec/integration/braintree/transaction_search_spec.rb +198 -165
- data/spec/integration/braintree/transaction_spec.rb +1319 -1151
- data/spec/integration/braintree/transaction_us_bank_account_spec.rb +32 -32
- data/spec/integration/braintree/us_bank_account_spec.rb +30 -30
- data/spec/integration/braintree/us_bank_account_verification_search_spec.rb +18 -18
- data/spec/integration/braintree/us_bank_account_verification_spec.rb +33 -33
- data/spec/integration/braintree/visa_checkout_card_spec.rb +57 -57
- data/spec/spec_helper.rb +9 -8
- data/spec/unit/braintree/address_spec.rb +8 -8
- data/spec/unit/braintree/base_module_spec.rb +4 -4
- data/spec/unit/braintree/client_token_spec.rb +2 -2
- data/spec/unit/braintree/configuration_spec.rb +57 -57
- data/spec/unit/braintree/credentials_parser_spec.rb +6 -6
- data/spec/unit/braintree/credit_card_spec.rb +31 -29
- data/spec/unit/braintree/credit_card_verification_gateway_spec.rb +28 -28
- data/spec/unit/braintree/credit_card_verification_search_spec.rb +9 -9
- data/spec/unit/braintree/credit_card_verification_spec.rb +17 -17
- data/spec/unit/braintree/customer_spec.rb +41 -40
- data/spec/unit/braintree/digest_spec.rb +5 -5
- data/spec/unit/braintree/disbursement_spec.rb +11 -11
- data/spec/unit/braintree/dispute_search_spec.rb +2 -2
- data/spec/unit/braintree/dispute_spec.rb +56 -56
- data/spec/unit/braintree/document_upload_spec.rb +8 -8
- data/spec/unit/braintree/enriched_customer_data_spec.rb +2 -2
- data/spec/unit/braintree/error_result_spec.rb +5 -5
- data/spec/unit/braintree/errors_spec.rb +9 -9
- data/spec/unit/braintree/http_spec.rb +8 -8
- data/spec/unit/braintree/local_payment_completed_spec.rb +11 -11
- data/spec/unit/braintree/local_payment_expired_spec.rb +2 -2
- data/spec/unit/braintree/local_payment_funded_spec.rb +6 -6
- data/spec/unit/braintree/merchant_account_spec.rb +4 -4
- data/spec/unit/braintree/modification_spec.rb +1 -1
- data/spec/unit/braintree/payment_method_customer_data_updated_metadata_spec.rb +6 -6
- data/spec/unit/braintree/payment_method_nonce_details_payer_info_spec.rb +7 -7
- data/spec/unit/braintree/payment_method_nonce_details_spec.rb +14 -14
- data/spec/unit/braintree/payment_method_spec.rb +19 -19
- data/spec/unit/braintree/paypal_account_spec.rb +4 -4
- data/spec/unit/braintree/resource_collection_spec.rb +7 -7
- data/spec/unit/braintree/sepa_debit_account_nonce_details_spec.rb +1 -1
- data/spec/unit/braintree/sha256_digest_spec.rb +1 -1
- data/spec/unit/braintree/signature_service_spec.rb +2 -2
- data/spec/unit/braintree/subscription_search_spec.rb +17 -17
- data/spec/unit/braintree/subscription_spec.rb +8 -8
- data/spec/unit/braintree/successful_result_spec.rb +5 -5
- data/spec/unit/braintree/three_d_secure_info_spec.rb +20 -20
- data/spec/unit/braintree/transaction/credit_card_details_spec.rb +5 -5
- 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/local_payment_details_spec.rb +30 -0
- data/spec/unit/braintree/transaction/payment_receipt_spec.rb +73 -0
- data/spec/unit/braintree/transaction_gateway_spec.rb +9 -6
- data/spec/unit/braintree/transaction_search_spec.rb +2 -2
- data/spec/unit/braintree/transaction_spec.rb +101 -93
- data/spec/unit/braintree/unknown_payment_method_spec.rb +4 -4
- data/spec/unit/braintree/us_bank_account_spec.rb +2 -2
- data/spec/unit/braintree/us_bank_account_verification_search_spec.rb +7 -7
- data/spec/unit/braintree/us_bank_account_verification_spec.rb +7 -7
- data/spec/unit/braintree/util_spec.rb +27 -27
- data/spec/unit/braintree/validation_error_collection_spec.rb +34 -34
- data/spec/unit/braintree/validation_error_spec.rb +4 -4
- data/spec/unit/braintree/venmo_profile_data_spec.rb +5 -5
- data/spec/unit/braintree/webhook_notification_spec.rb +206 -191
- data/spec/unit/braintree/xml/libxml_spec.rb +5 -5
- data/spec/unit/braintree/xml/parser_spec.rb +8 -8
- data/spec/unit/braintree/xml/rexml_spec.rb +5 -5
- data/spec/unit/braintree/xml_spec.rb +17 -17
- data/spec/unit/braintree_spec.rb +2 -2
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71fab9e9404ac3f2c30216aca3642baecbd01c942a25c16c70b6748563f32435
|
4
|
+
data.tar.gz: b8900d8aa7aac3716db035478510532bb82edd40ba599626d7cbe770fa939849
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9470b1e652814a7ae2fda1250b2c9f670069f1ef98a601ce2a382a4e3430017eaeaeaf7dabe4bc1b456c755d1b0fb258b06fc0593432d2b35c2ce9fc02671d5a
|
7
|
+
data.tar.gz: e376876f7c6ae2c5a1ce588c847d3494e828b29c4f2aee273d5e2c97348577db364b4bcc48ba0588074d87644a39f771b45c7eb56e7865be1cec730a76e72162
|
@@ -23,6 +23,16 @@ module Braintree
|
|
23
23
|
All = constants.map { |c| const_get(c) }
|
24
24
|
end
|
25
25
|
|
26
|
+
module DebitNetwork
|
27
|
+
Accel = "ACCEL"
|
28
|
+
Nyce = "NYCE"
|
29
|
+
Pulse = "PULSE"
|
30
|
+
Star = "STAR"
|
31
|
+
Star_Access = "STAR_ACCESS"
|
32
|
+
|
33
|
+
All = constants.map { |c| const_get(c) }
|
34
|
+
end
|
35
|
+
|
26
36
|
module CustomerLocation
|
27
37
|
International = "international"
|
28
38
|
US = "us"
|
@@ -160,7 +170,10 @@ module Braintree
|
|
160
170
|
end
|
161
171
|
|
162
172
|
# Returns true if the card is associated with Venmo SDK
|
173
|
+
# NEXT_MAJOR_VERSION Remove this method
|
174
|
+
# The old venmo SDK class has been deprecated
|
163
175
|
def venmo_sdk?
|
176
|
+
warn "[DEPRECATED] The Venmo SDK integration is Unsupported. Please update your integration to use Pay with Venmo instead."
|
164
177
|
@venmo_sdk
|
165
178
|
end
|
166
179
|
|
@@ -12,6 +12,10 @@ module Braintree
|
|
12
12
|
if attributes.has_key?(:expiration_date) && (attributes.has_key?(:expiration_month) || attributes.has_key?(:expiration_year))
|
13
13
|
raise ArgumentError.new("create with both expiration_month and expiration_year or only expiration_date")
|
14
14
|
end
|
15
|
+
# NEXT_MAJOR_VERSION remove this check
|
16
|
+
if attributes.has_key?(:venmo_sdk_payment_method_code) || attributes.has_key?(:venmo_sdk_session)
|
17
|
+
warn "[DEPRECATED] The Venmo SDK integration is Unsupported. Please update your integration to use Pay with Venmo instead."
|
18
|
+
end
|
15
19
|
Util.verify_keys(CreditCardGateway._create_signature, attributes)
|
16
20
|
_do_create("/payment_methods", :credit_card => attributes)
|
17
21
|
end
|
@@ -61,6 +65,10 @@ module Braintree
|
|
61
65
|
end
|
62
66
|
|
63
67
|
def update(token, attributes)
|
68
|
+
# NEXT_MAJOR_VERSION remove this check
|
69
|
+
if attributes.has_key?(:venmo_sdk_payment_method_code) || attributes.has_key?(:venmo_sdk_session)
|
70
|
+
warn "[DEPRECATED] The Venmo SDK integration is Unsupported. Please update your integration to use Pay with Venmo instead."
|
71
|
+
end
|
64
72
|
Util.verify_keys(CreditCardGateway._update_signature, attributes)
|
65
73
|
_do_update(:put, "/payment_methods/credit_card/#{token}", :credit_card => attributes)
|
66
74
|
end
|
@@ -79,21 +87,25 @@ module Braintree
|
|
79
87
|
|
80
88
|
def self._signature(type) # :nodoc:
|
81
89
|
billing_address_params = AddressGateway._shared_signature
|
90
|
+
# NEXT_MAJOR_VERSION Remove venmo_sdk_session
|
91
|
+
# The old venmo SDK class has been deprecated
|
82
92
|
options = [
|
83
93
|
:fail_on_duplicate_payment_method,
|
84
94
|
:make_default,
|
85
95
|
:skip_advanced_fraud_checking,
|
86
|
-
:venmo_sdk_session,
|
96
|
+
:venmo_sdk_session, # Deprecated
|
87
97
|
:verification_account_type,
|
88
98
|
:verification_amount,
|
89
99
|
:verification_currency_iso_code,
|
90
100
|
:verification_merchant_account_id,
|
91
101
|
:verify_card
|
92
102
|
]
|
103
|
+
# NEXT_MAJOR_VERSION Remove venmo_sdk_payment_method_code
|
104
|
+
# The old venmo SDK class has been deprecated
|
93
105
|
signature = [
|
94
106
|
:billing_address_id, :cardholder_name, :cvv, :expiration_date, :expiration_month,
|
95
|
-
:expiration_year, :number, :token, :venmo_sdk_payment_method_code,
|
96
|
-
:payment_method_nonce,
|
107
|
+
:expiration_year, :number, :token, :venmo_sdk_payment_method_code, # Deprecated
|
108
|
+
:device_data, :payment_method_nonce,
|
97
109
|
{:external_vault => [:network_transaction_id]},
|
98
110
|
{:options => options},
|
99
111
|
{:billing_address => billing_address_params}
|
@@ -9,6 +9,10 @@ module Braintree
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def create(attributes)
|
12
|
+
# NEXT_MAJOR_VERSION remove this check
|
13
|
+
if attributes.has_key?(:venmo_sdk_payment_method_code) || attributes.has_key?(:venmo_sdk_session)
|
14
|
+
warn "[DEPRECATED] The Venmo SDK integration is Unsupported. Please update your integration to use Pay with Venmo instead."
|
15
|
+
end
|
12
16
|
Util.verify_keys(PaymentMethodGateway._create_signature, attributes)
|
13
17
|
_do_create("/payment_methods", :payment_method => attributes)
|
14
18
|
end
|
@@ -60,6 +64,10 @@ module Braintree
|
|
60
64
|
end
|
61
65
|
|
62
66
|
def update(token, attributes)
|
67
|
+
# NEXT_MAJOR_VERSION remove this check
|
68
|
+
if attributes.has_key?(:venmo_sdk_payment_method_code) || attributes.has_key?(:venmo_sdk_session)
|
69
|
+
warn "[DEPRECATED] The Venmo SDK integration is Unsupported. Please update your integration to use Pay with Venmo instead."
|
70
|
+
end
|
63
71
|
Util.verify_keys(PaymentMethodGateway._update_signature, attributes)
|
64
72
|
_do_update(:put, "/payment_methods/any/#{token}", :payment_method => attributes)
|
65
73
|
end
|
@@ -149,11 +157,13 @@ module Braintree
|
|
149
157
|
def self._signature(type) # :nodoc:
|
150
158
|
billing_address_params = AddressGateway._shared_signature
|
151
159
|
paypal_options_shipping_signature = AddressGateway._shared_signature
|
160
|
+
# NEXT_MAJOR_VERSION Remove venmo_sdk_session
|
161
|
+
# The old venmo SDK class has been deprecated
|
152
162
|
options = [
|
153
163
|
:make_default,
|
154
164
|
:skip_advanced_fraud_checking,
|
155
165
|
:us_bank_account_verification_method,
|
156
|
-
:venmo_sdk_session,
|
166
|
+
:venmo_sdk_session, # Deprecated
|
157
167
|
:verification_account_type,
|
158
168
|
:verification_amount,
|
159
169
|
:verification_currency_iso_code,
|
@@ -168,10 +178,12 @@ module Braintree
|
|
168
178
|
{:shipping => paypal_options_shipping_signature}
|
169
179
|
],
|
170
180
|
]
|
181
|
+
# NEXT_MAJOR_VERSION Remove venmo_sdk_payment_method_code
|
182
|
+
# The old venmo SDK class has been deprecated
|
171
183
|
signature = [
|
172
184
|
:billing_address_id, :cardholder_name, :cvv, :expiration_date, :expiration_month,
|
173
|
-
:expiration_year, :number, :token, :venmo_sdk_payment_method_code,
|
174
|
-
:payment_method_nonce,
|
185
|
+
:expiration_year, :number, :token, :venmo_sdk_payment_method_code, # Deprecated
|
186
|
+
:device_data, :payment_method_nonce,
|
175
187
|
{:options => options},
|
176
188
|
{:billing_address => billing_address_params}
|
177
189
|
]
|
data/lib/braintree/test/nonce.rb
CHANGED
@@ -53,6 +53,7 @@ module Braintree
|
|
53
53
|
TransactableCountryOfIssuanceUSA = "fake-valid-country-of-issuance-usa-nonce"
|
54
54
|
TransactableCountryOfIssuanceCAD = "fake-valid-country-of-issuance-cad-nonce"
|
55
55
|
TransactableIssuingBankNetworkOnly = "fake-valid-issuing-bank-network-only-nonce"
|
56
|
+
TransactablePinlessDebitVisa = "fake-pinless-debit-visa-nonce"
|
56
57
|
ProcessorDeclinedVisa = "fake-processor-declined-visa-nonce"
|
57
58
|
ProcessorDeclinedMasterCard = "fake-processor-declined-mastercard-nonce"
|
58
59
|
ProcessorDeclinedAmEx = "fake-processor-declined-amex-nonce"
|
@@ -64,7 +64,10 @@ module Braintree
|
|
64
64
|
"#{bin}******#{last_4}"
|
65
65
|
end
|
66
66
|
|
67
|
+
# NEXT_MAJOR_VERSION Remove this method
|
68
|
+
# The old venmo SDK class has been deprecated
|
67
69
|
def venmo_sdk?
|
70
|
+
warn "[DEPRECATED] The Venmo SDK integration is Unsupported. Please update your integration to use Pay with Venmo instead."
|
68
71
|
@venmo_sdk
|
69
72
|
end
|
70
73
|
|
@@ -8,6 +8,8 @@ module Braintree
|
|
8
8
|
attr_reader :debug_id
|
9
9
|
attr_reader :description
|
10
10
|
attr_reader :funding_source
|
11
|
+
attr_reader :implicitly_vaulted_payment_method_global_id
|
12
|
+
attr_reader :implicitly_vaulted_payment_method_token
|
11
13
|
attr_reader :payer_id
|
12
14
|
attr_reader :payment_id
|
13
15
|
attr_reader :refund_from_transaction_fee_amount
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Braintree
|
2
|
+
class Transaction
|
3
|
+
class PaymentReceipt
|
4
|
+
class CardPresentData
|
5
|
+
include BaseModule
|
6
|
+
|
7
|
+
attr_reader :application_cryptogram
|
8
|
+
attr_reader :application_identifier
|
9
|
+
attr_reader :application_interchange_profile
|
10
|
+
attr_reader :application_name
|
11
|
+
attr_reader :application_transaction_counter
|
12
|
+
attr_reader :application_usage_control
|
13
|
+
attr_reader :authorization_mode
|
14
|
+
attr_reader :authorization_response_code
|
15
|
+
attr_reader :card_entry_method
|
16
|
+
attr_reader :card_sequence_number
|
17
|
+
attr_reader :cardholder_verification_method_results
|
18
|
+
attr_reader :cashback_amount
|
19
|
+
attr_reader :cryptogram_information_data
|
20
|
+
attr_reader :issuer_action_code_default
|
21
|
+
attr_reader :issuer_action_code_denial
|
22
|
+
attr_reader :issuer_action_code_online
|
23
|
+
attr_reader :issuer_authentication_data
|
24
|
+
attr_reader :terminal_country_code
|
25
|
+
attr_reader :terminal_transaction_date
|
26
|
+
attr_reader :terminal_transaction_type
|
27
|
+
attr_reader :terminal_verification_result
|
28
|
+
attr_reader :unpredictable_number
|
29
|
+
|
30
|
+
def initialize(attributes)
|
31
|
+
set_instance_variables_from_hash attributes unless attributes.nil?
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Braintree
|
2
|
+
class Transaction
|
3
|
+
class PaymentReceipt
|
4
|
+
class MerchantAddress
|
5
|
+
include BaseModule
|
6
|
+
|
7
|
+
attr_reader :locality
|
8
|
+
attr_reader :phone
|
9
|
+
attr_reader :postal_code
|
10
|
+
attr_reader :region
|
11
|
+
attr_reader :street_address
|
12
|
+
|
13
|
+
def initialize(attributes)
|
14
|
+
set_instance_variables_from_hash attributes unless attributes.nil?
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Braintree
|
2
|
+
class Transaction
|
3
|
+
class PaymentReceipt
|
4
|
+
include BaseModule
|
5
|
+
|
6
|
+
attr_reader :account_balance
|
7
|
+
attr_reader :amount
|
8
|
+
attr_reader :card_last_4
|
9
|
+
attr_reader :card_present_data
|
10
|
+
attr_reader :card_type
|
11
|
+
attr_reader :currency_iso_code
|
12
|
+
attr_reader :global_id
|
13
|
+
attr_reader :id
|
14
|
+
attr_reader :merchant_address
|
15
|
+
attr_reader :merchant_identification_number
|
16
|
+
attr_reader :merchant_name
|
17
|
+
attr_reader :pin_verified
|
18
|
+
attr_reader :processor_authorization_code
|
19
|
+
attr_reader :processor_response_code
|
20
|
+
attr_reader :processor_response_text
|
21
|
+
attr_reader :terminal_identification_number
|
22
|
+
attr_reader :type
|
23
|
+
|
24
|
+
def initialize(attributes)
|
25
|
+
set_instance_variables_from_hash attributes unless attributes.nil?
|
26
|
+
@card_present_data = CardPresentData.new(attributes[:card_present_date]) if attributes[:card_present_data]
|
27
|
+
@merchant_address = MerchantAddress.new(attributes[:merchant_address]) if attributes[:merchant_address]
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -91,8 +91,9 @@ module Braintree
|
|
91
91
|
end
|
92
92
|
end
|
93
93
|
|
94
|
-
attr_reader :acquirer_reference_number
|
95
94
|
attr_reader :ach_return_code
|
95
|
+
attr_reader :ach_return_responses
|
96
|
+
attr_reader :acquirer_reference_number
|
96
97
|
attr_reader :add_ons
|
97
98
|
attr_reader :additional_processor_response # The raw response from the processor.
|
98
99
|
attr_reader :amount
|
@@ -111,6 +112,7 @@ module Braintree
|
|
111
112
|
attr_reader :custom_fields
|
112
113
|
attr_reader :customer_details
|
113
114
|
attr_reader :cvv_response_code
|
115
|
+
attr_reader :debit_network
|
114
116
|
attr_reader :descriptor
|
115
117
|
attr_reader :disbursement_details
|
116
118
|
attr_reader :discount_amount
|
@@ -136,6 +138,7 @@ module Braintree
|
|
136
138
|
attr_reader :order_id
|
137
139
|
attr_reader :partial_settlement_transaction_ids
|
138
140
|
attr_reader :payment_instrument_type
|
141
|
+
attr_reader :payment_receipt
|
139
142
|
attr_reader :paypal_details
|
140
143
|
attr_reader :paypal_here_details
|
141
144
|
attr_reader :plan_id
|
@@ -149,8 +152,8 @@ module Braintree
|
|
149
152
|
attr_reader :purchase_order_number
|
150
153
|
attr_reader :recurring
|
151
154
|
attr_reader :refund_ids
|
152
|
-
attr_reader :refunded_transaction_id
|
153
155
|
attr_reader :refunded_installments
|
156
|
+
attr_reader :refunded_transaction_id
|
154
157
|
attr_reader :retried
|
155
158
|
attr_reader :retried_transaction_id # the primary/parent transaction id of any retried transaction
|
156
159
|
attr_reader :retrieval_reference_number
|
@@ -158,9 +161,9 @@ module Braintree
|
|
158
161
|
attr_reader :risk_data
|
159
162
|
attr_reader :samsung_pay_card_details
|
160
163
|
attr_reader :sca_exemption_requested
|
161
|
-
attr_reader :service_fee_amount
|
162
164
|
attr_reader :sepa_direct_debit_account_details
|
163
165
|
attr_reader :sepa_direct_debit_return_code
|
166
|
+
attr_reader :service_fee_amount
|
164
167
|
attr_reader :settlement_batch_id
|
165
168
|
attr_reader :shipping_amount
|
166
169
|
attr_reader :shipping_details
|
@@ -178,7 +181,6 @@ module Braintree
|
|
178
181
|
attr_reader :venmo_account_details
|
179
182
|
attr_reader :visa_checkout_card_details
|
180
183
|
attr_reader :voice_referral_number
|
181
|
-
attr_reader :ach_return_responses
|
182
184
|
|
183
185
|
def self.adjust_authorization(*args)
|
184
186
|
Configuration.gateway.transaction.adjust_authorization(*args)
|
@@ -312,6 +314,7 @@ module Braintree
|
|
312
314
|
@google_pay_details = GooglePayDetails.new(@google_pay_card)
|
313
315
|
@local_payment_details = LocalPaymentDetails.new(@local_payment)
|
314
316
|
@payment_instrument_type = attributes[:payment_instrument_type]
|
317
|
+
@payment_receipt = PaymentReceipt.new(attributes[:payment_receipt]) if attributes[:payment_receipt]
|
315
318
|
@paypal_details = PayPalDetails.new(@paypal)
|
316
319
|
@paypal_here_details = PayPalHereDetails.new(@paypal_here)
|
317
320
|
@samsung_pay_card_details = SamsungPayCardDetails.new(attributes[:samsung_pay_card])
|
@@ -9,6 +9,14 @@ module Braintree
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def create(attributes)
|
12
|
+
# NEXT_MAJOR_VERSION remove this check
|
13
|
+
if attributes.has_key?(:venmo_sdk_payment_method_code) || attributes.has_key?(:venmo_sdk_session)
|
14
|
+
warn "[DEPRECATED] The Venmo SDK integration is Unsupported. Please update your integration to use Pay with Venmo instead."
|
15
|
+
end
|
16
|
+
# NEXT_MAJOR_VERSION remove this check
|
17
|
+
if attributes.has_key?(:three_d_secure_token)
|
18
|
+
warn "[DEPRECATED] Passing :three_d_secure_token to create is deprecated. Please use :three_d_secure_authentication_id"
|
19
|
+
end
|
12
20
|
Util.verify_keys(TransactionGateway._create_signature, attributes)
|
13
21
|
_do_create "/transactions", :transaction => attributes
|
14
22
|
end
|
@@ -183,6 +191,10 @@ module Braintree
|
|
183
191
|
[:amount, :channel, {:options => [:submit_for_settlement]}]
|
184
192
|
end
|
185
193
|
|
194
|
+
|
195
|
+
# NEXT_MAJOR_VERSION Remove venmo_sdk_payment_method_code, venmo_sdk_session, and three_d_secure_token
|
196
|
+
# The old venmo SDK class has been deprecated
|
197
|
+
# three_d_secure_token has been deprecated in favor of three_d_secure_authentication_id
|
186
198
|
def self._create_signature # :nodoc:
|
187
199
|
[
|
188
200
|
:amount, :billing_address_id, :channel, :customer_id, :device_data, :discount_amount,
|
@@ -190,8 +202,8 @@ module Braintree
|
|
190
202
|
:product_sku, :purchase_order_number, :service_fee_amount, :shared_billing_address_id,
|
191
203
|
:shared_customer_id, :shared_payment_method_nonce, :shared_payment_method_token,
|
192
204
|
:shared_shipping_address_id, :shipping_address_id, :shipping_amount,
|
193
|
-
:ships_from_postal_code, :tax_amount, :tax_exempt, :three_d_secure_authentication_id,
|
194
|
-
:
|
205
|
+
:ships_from_postal_code, :tax_amount, :tax_exempt, :three_d_secure_authentication_id,:three_d_secure_token, #Deprecated
|
206
|
+
:transaction_source, :type, :venmo_sdk_payment_method_code, # Deprecated
|
195
207
|
:sca_exemption, :currency_iso_code, :exchange_rate_quote_id,
|
196
208
|
{:line_items => [:quantity, :name, :description, :kind, :unit_amount, :unit_tax_amount, :total_amount, :discount_amount, :tax_amount, :unit_of_measure, :product_code, :commodity_code, :url]},
|
197
209
|
{:risk_data => [:customer_browser, :customer_device_id, :customer_ip, :customer_location_zip, :customer_tenure]},
|
@@ -222,7 +234,7 @@ module Braintree
|
|
222
234
|
:submit_for_settlement,
|
223
235
|
:add_billing_address_to_payment_method,
|
224
236
|
:store_shipping_address_in_vault,
|
225
|
-
:venmo_sdk_session,
|
237
|
+
:venmo_sdk_session, # Deprecated
|
226
238
|
:payee_id,
|
227
239
|
:payee_email,
|
228
240
|
:skip_advanced_fraud_checking,
|
@@ -54,15 +54,16 @@ module Braintree
|
|
54
54
|
CreditCard::CustomerLocation::International,
|
55
55
|
CreditCard::CustomerLocation::US
|
56
56
|
]
|
57
|
+
multiple_value_field :debit_network, :allows => CreditCard::DebitNetwork::All
|
57
58
|
multiple_value_field :ids
|
58
|
-
multiple_value_field :payment_instrument_type
|
59
|
-
multiple_value_field :user
|
60
59
|
multiple_value_field :merchant_account_id
|
61
|
-
multiple_value_field :
|
60
|
+
multiple_value_field :payment_instrument_type
|
61
|
+
multiple_value_field :reason_code
|
62
62
|
multiple_value_field :source
|
63
|
-
multiple_value_field :
|
63
|
+
multiple_value_field :status, :allows => Transaction::Status::All
|
64
64
|
multiple_value_field :store_ids
|
65
|
-
multiple_value_field :
|
65
|
+
multiple_value_field :type, :allows => Transaction::Type::All
|
66
|
+
multiple_value_field :user
|
66
67
|
|
67
68
|
key_value_fields :refund
|
68
69
|
|
data/lib/braintree/version.rb
CHANGED
@@ -45,6 +45,7 @@ module Braintree
|
|
45
45
|
|
46
46
|
RecipientUpdatedGrantedPaymentMethod = "recipient_updated_granted_payment_method"
|
47
47
|
|
48
|
+
SubscriptionBillingSkipped = "subscription_billing_skipped"
|
48
49
|
SubscriptionCanceled = "subscription_canceled"
|
49
50
|
SubscriptionChargedSuccessfully = "subscription_charged_successfully"
|
50
51
|
SubscriptionChargedUnsuccessfully = "subscription_charged_unsuccessfully"
|
@@ -72,6 +72,8 @@ module Braintree
|
|
72
72
|
_disbursement_exception_sample_xml(id)
|
73
73
|
when Braintree::WebhookNotification::Kind::Disbursement
|
74
74
|
_disbursement_sample_xml(id)
|
75
|
+
when Braintree::WebhookNotification::Kind::SubscriptionBillingSkipped
|
76
|
+
_subscription_billing_skipped(id)
|
75
77
|
when Braintree::WebhookNotification::Kind::SubscriptionChargedSuccessfully
|
76
78
|
_subscription_charged_successfully(id)
|
77
79
|
when Braintree::WebhookNotification::Kind::SubscriptionChargedUnsuccessfully
|
@@ -112,6 +114,21 @@ module Braintree
|
|
112
114
|
XML
|
113
115
|
end
|
114
116
|
|
117
|
+
def _subscription_billing_skipped(id)
|
118
|
+
|
119
|
+
<<-XML
|
120
|
+
<subscription>
|
121
|
+
<id>#{id}</id>
|
122
|
+
<transactions type="array">
|
123
|
+
</transactions>
|
124
|
+
<add_ons type="array">
|
125
|
+
</add_ons>
|
126
|
+
<discounts type="array">
|
127
|
+
</discounts>
|
128
|
+
</subscription>
|
129
|
+
XML
|
130
|
+
end
|
131
|
+
|
115
132
|
def _subscription_charged_successfully(id)
|
116
133
|
|
117
134
|
<<-XML
|
data/lib/braintree.rb
CHANGED
@@ -150,6 +150,9 @@ require "braintree/transaction/disbursement_details"
|
|
150
150
|
require "braintree/transaction/google_pay_details"
|
151
151
|
require "braintree/transaction/installment"
|
152
152
|
require "braintree/transaction/installment/adjustment"
|
153
|
+
require "braintree/transaction/payment_receipt"
|
154
|
+
require "braintree/transaction/payment_receipt/card_present_data.rb"
|
155
|
+
require "braintree/transaction/payment_receipt/merchant_address.rb"
|
153
156
|
require "braintree/transaction/paypal_details"
|
154
157
|
require "braintree/transaction/paypal_here_details"
|
155
158
|
require "braintree/transaction/samsung_pay_card_details"
|
@@ -20,15 +20,15 @@ describe Braintree::AddOn do
|
|
20
20
|
add_ons = Braintree::AddOn.all
|
21
21
|
add_on = add_ons.select { |add_on| add_on.id == id }.first
|
22
22
|
|
23
|
-
add_on.
|
24
|
-
add_on.amount.
|
25
|
-
add_on.created_at.
|
26
|
-
add_on.description.
|
27
|
-
add_on.kind.
|
28
|
-
add_on.name.
|
29
|
-
add_on.never_expires.
|
30
|
-
add_on.number_of_billing_cycles.
|
31
|
-
add_on.updated_at.
|
23
|
+
expect(add_on).not_to be_nil
|
24
|
+
expect(add_on.amount).to eq(BigDecimal(expected[:amount]))
|
25
|
+
expect(add_on.created_at).not_to be_nil
|
26
|
+
expect(add_on.description).to eq(expected[:description])
|
27
|
+
expect(add_on.kind).to eq(expected[:kind])
|
28
|
+
expect(add_on.name).to eq(expected[:name])
|
29
|
+
expect(add_on.never_expires).to eq(expected[:never_expires])
|
30
|
+
expect(add_on.number_of_billing_cycles).to eq(expected[:number_of_billing_cycles])
|
31
|
+
expect(add_on.updated_at).not_to be_nil
|
32
32
|
end
|
33
33
|
|
34
34
|
it "raises with a helpful error if public_key and private_key are not set" do
|