braintree 4.34.0 → 4.35.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/customer.rb +1 -1
- data/lib/braintree/payment_instrument_type.rb +1 -0
- data/lib/braintree/payment_method_parser.rb +1 -0
- data/lib/braintree/test/nonce.rb +1 -0
- data/lib/braintree/test/transaction_amounts.rb +1 -0
- data/lib/braintree/transaction/visa_checkout_card_details.rb +2 -0
- data/lib/braintree/transaction.rb +6 -2
- data/lib/braintree/transaction_gateway.rb +2 -1
- data/lib/braintree/version.rb +1 -1
- data/lib/braintree/visa_checkout_card.rb +2 -0
- data/spec/integration/braintree/customer_spec.rb +0 -16
- data/spec/integration/braintree/payment_method_us_bank_account_spec.rb +1 -1
- data/spec/integration/braintree/test_transaction_spec.rb +6 -6
- data/spec/integration/braintree/transaction_spec.rb +16 -0
- data/spec/integration/braintree/transaction_us_bank_account_spec.rb +41 -0
- data/spec/integration/braintree/visa_checkout_card_spec.rb +4 -100
- data/spec/unit/braintree/transaction_gateway_spec.rb +2 -1
- data/spec/unit/braintree/transaction_spec.rb +19 -0
- data/spec/unit/braintree/visa_checkout_card_spec.rb +1 -0
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b265c2399fc0ef51a35bfdd1b804ec05e1173b9f1ee04a8fd47b29ee7494062c
|
|
4
|
+
data.tar.gz: b52c492b7b84c343a287d60d27b63f9813aa7a5c099cfc52d91a7590285d739f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 964368649d781437f2f2c5bdbdc75e953c577ab637baa9e5df9c6498c3e70ac3da83e1583540451505fedef5688e49373b3831ff01c2c18f15a229643e77c15b
|
|
7
|
+
data.tar.gz: ca2a9f488eca05e47ec7bf5b52e27db811bcffbb80c972a5a313522bfce5373a245de8c0a202319babfaebe9655f73960f1f1d1d5b57822b4694c0003aa74789
|
data/lib/braintree/customer.rb
CHANGED
|
@@ -90,7 +90,7 @@ module Braintree
|
|
|
90
90
|
@google_pay_cards = (@google_pay_cards || []).map { |pm| GooglePayCard._new gateway, pm }
|
|
91
91
|
@venmo_accounts = (@venmo_accounts || []).map { |pm| VenmoAccount._new gateway, pm }
|
|
92
92
|
@us_bank_accounts = (@us_bank_accounts || []).map { |pm| UsBankAccount._new gateway, pm }
|
|
93
|
-
@visa_checkout_cards = (@visa_checkout_cards|| []).map { |pm| VisaCheckoutCard._new gateway, pm }
|
|
93
|
+
@visa_checkout_cards = (@visa_checkout_cards|| []).map { |pm| VisaCheckoutCard._new gateway, pm } # Deprecated
|
|
94
94
|
@sepa_direct_debit_accounts = (@sepa_debit_accounts || []).map { |pm| SepaDirectDebitAccount._new gateway, pm }
|
|
95
95
|
@samsung_pay_cards = (@samsung_pay_cards|| []).map { |pm| SamsungPayCard._new gateway, pm } # Deprecated
|
|
96
96
|
@addresses = (@addresses || []).map { |addr| Address._new gateway, addr }
|
|
@@ -15,6 +15,7 @@ module Braintree
|
|
|
15
15
|
elsif attributes[:venmo_account]
|
|
16
16
|
VenmoAccount._new(gateway, attributes[:venmo_account])
|
|
17
17
|
elsif attributes[:visa_checkout_card]
|
|
18
|
+
warn "[DEPRECATED] VisaCheckoutCard is no longer a supported payment method type"
|
|
18
19
|
VisaCheckoutCard._new(gateway, attributes[:visa_checkout_card])
|
|
19
20
|
elsif attributes[:samsung_pay_card]
|
|
20
21
|
warn "[DEPRECATED] SamsungPayCard is no longer a supported payment method type"
|
data/lib/braintree/test/nonce.rb
CHANGED
|
@@ -65,6 +65,7 @@ module Braintree
|
|
|
65
65
|
PayPalFuturePaymentRefreshToken = "fake-paypal-future-refresh-token-nonce"
|
|
66
66
|
GatewayRejectedFraud = "fake-gateway-rejected-fraud-nonce"
|
|
67
67
|
GatewayRejectedRiskThresholds = "fake-gateway-rejected-risk-thresholds-nonce"
|
|
68
|
+
# NEXT_MAJOR_VERSION VisaCheckoutCard is deprecated, remove associated nonces
|
|
68
69
|
VisaCheckoutAmEx = "fake-visa-checkout-amex-nonce"
|
|
69
70
|
VisaCheckoutDiscover = "fake-visa-checkout-discover-nonce"
|
|
70
71
|
VisaCheckoutMasterCard = "fake-visa-checkout-mastercard-nonce"
|
|
@@ -86,6 +86,7 @@ module Braintree
|
|
|
86
86
|
attr_reader :ach_reject_reason
|
|
87
87
|
attr_reader :ach_return_code
|
|
88
88
|
attr_reader :ach_return_responses
|
|
89
|
+
attr_reader :ach_type
|
|
89
90
|
attr_reader :acquirer_reference_number
|
|
90
91
|
attr_reader :add_ons
|
|
91
92
|
attr_reader :additional_processor_response # The raw response from the processor.
|
|
@@ -133,6 +134,7 @@ module Braintree
|
|
|
133
134
|
attr_reader :order_id
|
|
134
135
|
attr_reader :packages
|
|
135
136
|
attr_reader :partial_settlement_transaction_ids
|
|
137
|
+
attr_reader :partially_authorized
|
|
136
138
|
attr_reader :payment_instrument_type
|
|
137
139
|
attr_reader :payment_receipt
|
|
138
140
|
attr_reader :paypal_details
|
|
@@ -150,6 +152,7 @@ module Braintree
|
|
|
150
152
|
attr_reader :refund_ids
|
|
151
153
|
attr_reader :refunded_installments
|
|
152
154
|
attr_reader :refunded_transaction_id
|
|
155
|
+
attr_reader :requested_ach_type
|
|
153
156
|
attr_reader :retried
|
|
154
157
|
attr_reader :retried_transaction_id # the primary/parent transaction id of any retried transaction
|
|
155
158
|
attr_reader :retrieval_reference_number
|
|
@@ -310,7 +313,7 @@ module Braintree
|
|
|
310
313
|
@payment_receipt = PaymentReceipt.new(attributes[:payment_receipt]) if attributes[:payment_receipt]
|
|
311
314
|
@paypal_details = PayPalDetails.new(@paypal)
|
|
312
315
|
@paypal_here_details = PayPalHereDetails.new(@paypal_here)
|
|
313
|
-
@samsung_pay_card_details = SamsungPayCardDetails.new(attributes[:samsung_pay_card]) #Deprecated
|
|
316
|
+
@samsung_pay_card_details = SamsungPayCardDetails.new(attributes[:samsung_pay_card]) # Deprecated
|
|
314
317
|
@sca_exemption_requested = attributes[:sca_exemption_requested]
|
|
315
318
|
@sepa_direct_debit_account_details = SepaDirectDebitAccountDetails.new(@sepa_debit_account_detail)
|
|
316
319
|
@service_fee_amount = Util.to_big_decimal(service_fee_amount)
|
|
@@ -318,9 +321,10 @@ module Braintree
|
|
|
318
321
|
@shipping_details = AddressDetails.new(@shipping)
|
|
319
322
|
@status_history = attributes[:status_history] ? attributes[:status_history].map { |s| StatusDetails.new(s) } : []
|
|
320
323
|
@subscription_details = SubscriptionDetails.new(@subscription)
|
|
324
|
+
@partially_authorized = %w[1004].include?(processor_response_code)
|
|
321
325
|
@tax_amount = Util.to_big_decimal(tax_amount)
|
|
322
326
|
@venmo_account_details = VenmoAccountDetails.new(@venmo_account)
|
|
323
|
-
@visa_checkout_card_details = VisaCheckoutCardDetails.new(attributes[:visa_checkout_card])
|
|
327
|
+
@visa_checkout_card_details = VisaCheckoutCardDetails.new(attributes[:visa_checkout_card]) # Deprecated
|
|
324
328
|
|
|
325
329
|
@facilitated_details = FacilitatedDetails.new(attributes[:facilitated_details]) if attributes[:facilitated_details]
|
|
326
330
|
@facilitator_details = FacilitatorDetails.new(attributes[:facilitator_details]) if attributes[:facilitator_details]
|
|
@@ -194,7 +194,7 @@ module Braintree
|
|
|
194
194
|
# three_d_secure_token has been deprecated in favor of three_d_secure_authentication_id
|
|
195
195
|
def self._create_signature
|
|
196
196
|
[
|
|
197
|
-
:amount, :billing_address_id, :channel, :currency_iso_code, :customer_id, :device_data,
|
|
197
|
+
:accept_partial_authorization, :amount, :billing_address_id, :channel, :currency_iso_code, :customer_id, :device_data,
|
|
198
198
|
:discount_amount, :exchange_rate_quote_id, :foreign_retailer,
|
|
199
199
|
:merchant_account_id, :order_id, :payment_method_nonce, :payment_method_token, :processing_merchant_category_code,
|
|
200
200
|
:product_sku, :purchase_order_number, :service_fee_amount, :shared_billing_address_id,
|
|
@@ -250,6 +250,7 @@ module Braintree
|
|
|
250
250
|
:store_shipping_address_in_vault,
|
|
251
251
|
:submit_for_settlement,
|
|
252
252
|
{:three_d_secure => [:required]},
|
|
253
|
+
{:us_bank_account => [:ach_type]},
|
|
253
254
|
{:venmo => [:profile_id]},
|
|
254
255
|
:venmo_sdk_session, # Deprecated
|
|
255
256
|
]
|
data/lib/braintree/version.rb
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
module Braintree
|
|
2
|
+
# DEPRECATED: Visa Checkout is no longer supported for creating new transactions.
|
|
3
|
+
# This class is retained for search functionality and historical transaction data only.
|
|
2
4
|
class VisaCheckoutCard
|
|
3
5
|
include BaseModule
|
|
4
6
|
include Braintree::Util::TokenEquality
|
|
@@ -1979,20 +1979,4 @@ describe Braintree::Customer do
|
|
|
1979
1979
|
end
|
|
1980
1980
|
end
|
|
1981
1981
|
|
|
1982
|
-
it "returns bin fields from VisaCheckoutCard" do
|
|
1983
|
-
result = Braintree::Customer.create(
|
|
1984
|
-
:payment_method_nonce => Braintree::Test::Nonce::VisaCheckoutVisa,
|
|
1985
|
-
)
|
|
1986
|
-
expect(result.success?).to eq(true)
|
|
1987
|
-
|
|
1988
|
-
found_customer = Braintree::Customer.find(result.customer.id)
|
|
1989
|
-
expect(found_customer.visa_checkout_cards).not_to be_nil
|
|
1990
|
-
visa_checkout_card = found_customer.visa_checkout_cards.first
|
|
1991
|
-
expect(visa_checkout_card).to be_a Braintree::VisaCheckoutCard
|
|
1992
|
-
expect(visa_checkout_card.business).not_to be_nil
|
|
1993
|
-
expect(visa_checkout_card.consumer).not_to be_nil
|
|
1994
|
-
expect(visa_checkout_card.corporate).not_to be_nil
|
|
1995
|
-
expect(visa_checkout_card.prepaid_reloadable).not_to be_nil
|
|
1996
|
-
expect(visa_checkout_card.purchase).not_to be_nil
|
|
1997
|
-
end
|
|
1998
1982
|
end
|
|
@@ -96,7 +96,7 @@ describe Braintree::PaymentMethod do
|
|
|
96
96
|
expect(us_bank_account.routing_number).to eq("123456789")
|
|
97
97
|
expect(us_bank_account.last_4).to eq("0000")
|
|
98
98
|
expect(us_bank_account.account_type).to eq("checking")
|
|
99
|
-
expect(us_bank_account.account_holder_name).to eq("
|
|
99
|
+
expect(us_bank_account.account_holder_name).to eq("Marty McFly")
|
|
100
100
|
expect(us_bank_account.bank_name).to match(/Wells Fargo/)
|
|
101
101
|
expect(us_bank_account.default).to eq(true)
|
|
102
102
|
expect(us_bank_account.ach_mandate.accepted_at).to be_a Time
|
|
@@ -6,7 +6,7 @@ describe Braintree::TestTransaction do
|
|
|
6
6
|
it "changes transaction status to settled" do
|
|
7
7
|
sale_result = Braintree::Transaction.sale(
|
|
8
8
|
:amount => "100",
|
|
9
|
-
:payment_method_nonce => Braintree::Test::Nonce::
|
|
9
|
+
:payment_method_nonce => Braintree::Test::Nonce::ApplePayVisa,
|
|
10
10
|
:options => {
|
|
11
11
|
:submit_for_settlement => true
|
|
12
12
|
},
|
|
@@ -22,7 +22,7 @@ describe Braintree::TestTransaction do
|
|
|
22
22
|
it "changes transaction status to settlement_confirmed" do
|
|
23
23
|
sale_result = Braintree::Transaction.sale(
|
|
24
24
|
:amount => "100",
|
|
25
|
-
:payment_method_nonce => Braintree::Test::Nonce::
|
|
25
|
+
:payment_method_nonce => Braintree::Test::Nonce::ApplePayVisa,
|
|
26
26
|
:options => {
|
|
27
27
|
:submit_for_settlement => true
|
|
28
28
|
},
|
|
@@ -38,7 +38,7 @@ describe Braintree::TestTransaction do
|
|
|
38
38
|
it "changes transaction status to settlement_declined" do
|
|
39
39
|
sale_result = Braintree::Transaction.sale(
|
|
40
40
|
:amount => "100",
|
|
41
|
-
:payment_method_nonce => Braintree::Test::Nonce::
|
|
41
|
+
:payment_method_nonce => Braintree::Test::Nonce::ApplePayVisa,
|
|
42
42
|
:options => {
|
|
43
43
|
:submit_for_settlement => true
|
|
44
44
|
},
|
|
@@ -54,7 +54,7 @@ describe Braintree::TestTransaction do
|
|
|
54
54
|
it "changes transaction status to settlement_pending" do
|
|
55
55
|
sale_result = Braintree::Transaction.sale(
|
|
56
56
|
:amount => "100",
|
|
57
|
-
:payment_method_nonce => Braintree::Test::Nonce::
|
|
57
|
+
:payment_method_nonce => Braintree::Test::Nonce::ApplePayVisa,
|
|
58
58
|
:options => {
|
|
59
59
|
:submit_for_settlement => true
|
|
60
60
|
},
|
|
@@ -70,7 +70,7 @@ describe Braintree::TestTransaction do
|
|
|
70
70
|
it "returns a validation error when invalid transition is specified" do
|
|
71
71
|
sale_result = Braintree::Transaction.sale(
|
|
72
72
|
:amount => "100",
|
|
73
|
-
:payment_method_nonce => Braintree::Test::Nonce::
|
|
73
|
+
:payment_method_nonce => Braintree::Test::Nonce::ApplePayVisa,
|
|
74
74
|
)
|
|
75
75
|
expect(sale_result.success?).to eq(true)
|
|
76
76
|
|
|
@@ -110,7 +110,7 @@ describe Braintree::TestTransaction do
|
|
|
110
110
|
|
|
111
111
|
sale_result = transaction_gateway.sale(
|
|
112
112
|
:amount => "100",
|
|
113
|
-
:payment_method_nonce => Braintree::Test::Nonce::
|
|
113
|
+
:payment_method_nonce => Braintree::Test::Nonce::ApplePayVisa,
|
|
114
114
|
)
|
|
115
115
|
testing_gateway.settle(sale_result.transaction.id)
|
|
116
116
|
end
|
|
@@ -812,6 +812,22 @@ describe Braintree::Transaction do
|
|
|
812
812
|
expect(result.transaction.foreign_retailer).to be_nil
|
|
813
813
|
end
|
|
814
814
|
|
|
815
|
+
it "returns true for partial_authorization if the processor_response_code is 1004" do
|
|
816
|
+
result = Braintree::Transaction.create(
|
|
817
|
+
:type => "sale",
|
|
818
|
+
:amount => Braintree::Test::TransactionAmounts::PartiallyAuthorized,
|
|
819
|
+
:accept_partial_authorization => true,
|
|
820
|
+
:credit_card => {
|
|
821
|
+
:number => Braintree::Test::CreditCardNumbers::Visa,
|
|
822
|
+
:expiration_date => "05/2029"
|
|
823
|
+
},
|
|
824
|
+
)
|
|
825
|
+
|
|
826
|
+
expect(result.success?).to eq(true)
|
|
827
|
+
expect(result.transaction.processor_response_code).to eq("1004")
|
|
828
|
+
expect(result.transaction.partially_authorized).to eq(true)
|
|
829
|
+
end
|
|
830
|
+
|
|
815
831
|
it "returns nil when foreign_retailer param is nil" do
|
|
816
832
|
result = Braintree::Transaction.create(
|
|
817
833
|
:type => "sale",
|
|
@@ -143,6 +143,24 @@ describe Braintree::Transaction do
|
|
|
143
143
|
expect(transaction.us_bank_account_details.ach_mandate.accepted_at).to be_a Time
|
|
144
144
|
end
|
|
145
145
|
|
|
146
|
+
it "returns ach_type and requested_ach_type on transaction create" do
|
|
147
|
+
result = Braintree::Transaction.create(
|
|
148
|
+
:type => "sale",
|
|
149
|
+
:amount => Braintree::Test::TransactionAmounts::Authorize,
|
|
150
|
+
:merchant_account_id => SpecHelper::UsBankMerchantAccountId,
|
|
151
|
+
:payment_method_nonce => non_plaid_nonce,
|
|
152
|
+
:options => {
|
|
153
|
+
:submit_for_settlement => true,
|
|
154
|
+
:us_bank_account => {
|
|
155
|
+
:ach_type => "same_day",
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
)
|
|
159
|
+
expect(result.success?).to eq(true)
|
|
160
|
+
expect(result.transaction.ach_type).to eq("same_day")
|
|
161
|
+
expect(result.transaction.requested_ach_type).to eq("same_day")
|
|
162
|
+
end
|
|
163
|
+
|
|
146
164
|
it "sale fails for invalid nonce" do
|
|
147
165
|
result = Braintree::Transaction.create(
|
|
148
166
|
:type => "sale",
|
|
@@ -192,4 +210,27 @@ describe Braintree::Transaction do
|
|
|
192
210
|
end
|
|
193
211
|
end
|
|
194
212
|
end
|
|
213
|
+
|
|
214
|
+
describe "self.find" do
|
|
215
|
+
it "returns ach_type and requested_ach_type for same_day ach with same_day requested" do
|
|
216
|
+
transaction = Braintree::Transaction.find("sameday_ach_sameday_requested")
|
|
217
|
+
|
|
218
|
+
expect(transaction.ach_type).to eq("same_day")
|
|
219
|
+
expect(transaction.requested_ach_type).to eq("same_day")
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
it "returns ach_type and requested_ach_type for standard ach with same_day requested" do
|
|
223
|
+
transaction = Braintree::Transaction.find("standard_ach_sameday_requested")
|
|
224
|
+
|
|
225
|
+
expect(transaction.ach_type).to eq("standard")
|
|
226
|
+
expect(transaction.requested_ach_type).to eq("same_day")
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
it "returns ach_type and requested_ach_type for standard ach with standard requested" do
|
|
230
|
+
transaction = Braintree::Transaction.find("standard_ach_standard_requested")
|
|
231
|
+
|
|
232
|
+
expect(transaction.ach_type).to eq("standard")
|
|
233
|
+
expect(transaction.requested_ach_type).to eq("standard")
|
|
234
|
+
end
|
|
235
|
+
end
|
|
195
236
|
end
|
|
@@ -1,110 +1,14 @@
|
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
|
|
2
2
|
require File.expand_path(File.dirname(__FILE__) + "/client_api/spec_helper")
|
|
3
3
|
|
|
4
|
+
# DEPRECATED: Visa Checkout is no longer supported for creating new transactions.
|
|
5
|
+
# Search functionality is retained for historical transactions only.
|
|
4
6
|
describe Braintree::VisaCheckoutCard do
|
|
5
|
-
it "can
|
|
6
|
-
customer = Braintree::Customer.create!
|
|
7
|
-
|
|
8
|
-
result = Braintree::PaymentMethod.create(
|
|
9
|
-
:payment_method_nonce => Braintree::Test::Nonce::VisaCheckoutDiscover,
|
|
10
|
-
:customer_id => customer.id,
|
|
11
|
-
)
|
|
12
|
-
expect(result).to be_success
|
|
13
|
-
|
|
14
|
-
visa_checkout_card = result.payment_method
|
|
15
|
-
expect(visa_checkout_card).to be_a(Braintree::VisaCheckoutCard)
|
|
16
|
-
expect(visa_checkout_card.call_id).to eq("abc123")
|
|
17
|
-
expect(visa_checkout_card.billing_address).not_to be_nil
|
|
18
|
-
expect(visa_checkout_card.bin).not_to be_nil
|
|
19
|
-
expect(visa_checkout_card.card_type).not_to be_nil
|
|
20
|
-
expect(visa_checkout_card.cardholder_name).not_to be_nil
|
|
21
|
-
expect(visa_checkout_card.commercial).not_to be_nil
|
|
22
|
-
expect(visa_checkout_card.country_of_issuance).not_to be_nil
|
|
23
|
-
expect(visa_checkout_card.created_at).not_to be_nil
|
|
24
|
-
expect(visa_checkout_card.customer_id).not_to be_nil
|
|
25
|
-
expect(visa_checkout_card.customer_location).not_to be_nil
|
|
26
|
-
expect(visa_checkout_card.debit).not_to be_nil
|
|
27
|
-
expect(visa_checkout_card.default?).not_to be_nil
|
|
28
|
-
expect(visa_checkout_card.durbin_regulated).not_to be_nil
|
|
29
|
-
expect(visa_checkout_card.expiration_date).not_to be_nil
|
|
30
|
-
expect(visa_checkout_card.expiration_month).not_to be_nil
|
|
31
|
-
expect(visa_checkout_card.expiration_year).not_to be_nil
|
|
32
|
-
expect(visa_checkout_card.expired?).not_to be_nil
|
|
33
|
-
expect(visa_checkout_card.healthcare).not_to be_nil
|
|
34
|
-
expect(visa_checkout_card.image_url).not_to be_nil
|
|
35
|
-
expect(visa_checkout_card.issuing_bank).not_to be_nil
|
|
36
|
-
expect(visa_checkout_card.last_4).not_to be_nil
|
|
37
|
-
expect(visa_checkout_card.payroll).not_to be_nil
|
|
38
|
-
expect(visa_checkout_card.prepaid).not_to be_nil
|
|
39
|
-
expect(visa_checkout_card.product_id).not_to be_nil
|
|
40
|
-
expect(visa_checkout_card.subscriptions).not_to be_nil
|
|
41
|
-
expect(visa_checkout_card.token).not_to be_nil
|
|
42
|
-
expect(visa_checkout_card.unique_number_identifier).not_to be_nil
|
|
43
|
-
expect(visa_checkout_card.updated_at).not_to be_nil
|
|
44
|
-
|
|
45
|
-
customer = Braintree::Customer.find(customer.id)
|
|
46
|
-
expect(customer.visa_checkout_cards.size).to eq(1)
|
|
47
|
-
expect(customer.visa_checkout_cards.first).to eq(visa_checkout_card)
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
it "can create with verification" do
|
|
51
|
-
customer = Braintree::Customer.create!
|
|
52
|
-
|
|
53
|
-
result = Braintree::PaymentMethod.create(
|
|
54
|
-
:payment_method_nonce => Braintree::Test::Nonce::VisaCheckoutDiscover,
|
|
55
|
-
:customer_id => customer.id,
|
|
56
|
-
:options => {:verify_card => true},
|
|
57
|
-
)
|
|
58
|
-
expect(result).to be_success
|
|
59
|
-
expect(result.payment_method.verification.status).to eq(Braintree::CreditCardVerification::Status::Verified)
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
it "can search for transactions" do
|
|
63
|
-
transaction_create_result = Braintree::Transaction.sale(
|
|
64
|
-
:payment_method_nonce => Braintree::Test::Nonce::VisaCheckoutDiscover,
|
|
65
|
-
:amount => "47.00",
|
|
66
|
-
)
|
|
67
|
-
expect(transaction_create_result).to be_success
|
|
68
|
-
transaction_id = transaction_create_result.transaction.id
|
|
69
|
-
|
|
7
|
+
it "can search by payment instrument type" do
|
|
70
8
|
search_results = Braintree::Transaction.search do |search|
|
|
71
|
-
search.id.is transaction_id
|
|
72
9
|
search.payment_instrument_type.is Braintree::PaymentInstrumentType::VisaCheckoutCard
|
|
73
10
|
end
|
|
74
|
-
expect(search_results.first.id).to eq(transaction_id)
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
it "can create transaction from nonce and vault" do
|
|
78
|
-
customer = Braintree::Customer.create!
|
|
79
|
-
|
|
80
|
-
result = Braintree::Transaction.sale(
|
|
81
|
-
:payment_method_nonce => Braintree::Test::Nonce::VisaCheckoutDiscover,
|
|
82
|
-
:customer_id => customer.id,
|
|
83
|
-
:amount => "47.00",
|
|
84
|
-
:options => {:store_in_vault => true},
|
|
85
|
-
)
|
|
86
|
-
expect(result).to be_success
|
|
87
11
|
|
|
88
|
-
|
|
89
|
-
expect(visa_checkout_card_details.call_id).to eq("abc123")
|
|
90
|
-
expect(visa_checkout_card_details.bin).not_to be_nil
|
|
91
|
-
expect(visa_checkout_card_details.card_type).not_to be_nil
|
|
92
|
-
expect(visa_checkout_card_details.cardholder_name).not_to be_nil
|
|
93
|
-
expect(visa_checkout_card_details.commercial).not_to be_nil
|
|
94
|
-
expect(visa_checkout_card_details.country_of_issuance).not_to be_nil
|
|
95
|
-
expect(visa_checkout_card_details.customer_location).not_to be_nil
|
|
96
|
-
expect(visa_checkout_card_details.debit).not_to be_nil
|
|
97
|
-
expect(visa_checkout_card_details.durbin_regulated).not_to be_nil
|
|
98
|
-
expect(visa_checkout_card_details.expiration_date).not_to be_nil
|
|
99
|
-
expect(visa_checkout_card_details.expiration_month).not_to be_nil
|
|
100
|
-
expect(visa_checkout_card_details.expiration_year).not_to be_nil
|
|
101
|
-
expect(visa_checkout_card_details.healthcare).not_to be_nil
|
|
102
|
-
expect(visa_checkout_card_details.image_url).not_to be_nil
|
|
103
|
-
expect(visa_checkout_card_details.issuing_bank).not_to be_nil
|
|
104
|
-
expect(visa_checkout_card_details.last_4).not_to be_nil
|
|
105
|
-
expect(visa_checkout_card_details.payroll).not_to be_nil
|
|
106
|
-
expect(visa_checkout_card_details.prepaid).not_to be_nil
|
|
107
|
-
expect(visa_checkout_card_details.product_id).not_to be_nil
|
|
108
|
-
expect(visa_checkout_card_details.token).not_to be_nil
|
|
12
|
+
expect(search_results).not_to be_nil
|
|
109
13
|
end
|
|
110
14
|
end
|
|
@@ -33,7 +33,7 @@ describe Braintree::TransactionGateway do
|
|
|
33
33
|
# three_d_secure_token has been deprecated in favor of three_d_secure_authentication_id
|
|
34
34
|
it "creates a transaction gateway signature" do
|
|
35
35
|
expect(Braintree::TransactionGateway._create_signature).to match([
|
|
36
|
-
:amount, :billing_address_id, :channel, :currency_iso_code, :customer_id, :device_data,
|
|
36
|
+
:accept_partial_authorization, :amount, :billing_address_id, :channel, :currency_iso_code, :customer_id, :device_data,
|
|
37
37
|
:discount_amount, :exchange_rate_quote_id, :foreign_retailer,
|
|
38
38
|
:merchant_account_id, :order_id, :payment_method_nonce, :payment_method_token, :processing_merchant_category_code,
|
|
39
39
|
:product_sku, :purchase_order_number, :service_fee_amount, :shared_billing_address_id,
|
|
@@ -89,6 +89,7 @@ describe Braintree::TransactionGateway do
|
|
|
89
89
|
:store_shipping_address_in_vault,
|
|
90
90
|
:submit_for_settlement,
|
|
91
91
|
{:three_d_secure => [:required]},
|
|
92
|
+
{:us_bank_account => [:ach_type]},
|
|
92
93
|
{:venmo => [:profile_id]},
|
|
93
94
|
:venmo_sdk_session, # Deprecated
|
|
94
95
|
]
|
|
@@ -347,6 +347,15 @@ describe Braintree::Transaction do
|
|
|
347
347
|
expect(transaction.network_transaction_id).to eq("123456789012345")
|
|
348
348
|
end
|
|
349
349
|
|
|
350
|
+
it "sets partially_authorized to true if processor_response_code is 1004" do
|
|
351
|
+
transaction = Braintree::Transaction._new(
|
|
352
|
+
:gateway,
|
|
353
|
+
:processor_response_code => "1004",
|
|
354
|
+
)
|
|
355
|
+
expect(transaction.processor_response_code).to eq("1004")
|
|
356
|
+
expect(transaction.partially_authorized).to eq(true)
|
|
357
|
+
end
|
|
358
|
+
|
|
350
359
|
it "accepts ach_return_code" do
|
|
351
360
|
transaction = Braintree::Transaction._new(
|
|
352
361
|
:gateway,
|
|
@@ -365,6 +374,16 @@ describe Braintree::Transaction do
|
|
|
365
374
|
expect(transaction.ach_reject_reason).to eq("some reject reason")
|
|
366
375
|
end
|
|
367
376
|
|
|
377
|
+
it "accepts ach_type" do
|
|
378
|
+
transaction = Braintree::Transaction._new(
|
|
379
|
+
:gateway,
|
|
380
|
+
:ach_type => "standard",
|
|
381
|
+
:requested_ach_type => "standard",
|
|
382
|
+
)
|
|
383
|
+
expect(transaction.ach_type).to eq("standard")
|
|
384
|
+
expect(transaction.requested_ach_type).to eq("standard")
|
|
385
|
+
end
|
|
386
|
+
|
|
368
387
|
it "accepts network_response code and network_response_text" do
|
|
369
388
|
transaction = Braintree::Transaction._new(
|
|
370
389
|
:gateway,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
|
|
2
2
|
|
|
3
|
+
# DEPRECATED: Visa Checkout Transactions are no longer supported
|
|
3
4
|
describe Braintree::VisaCheckoutCard do
|
|
4
5
|
it "initializes prepaid reloadable correctly" do
|
|
5
6
|
card = Braintree::VisaCheckoutCard._new(:gateway, {:prepaid_reloadable => "No"})
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: braintree
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.
|
|
4
|
+
version: 4.35.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Braintree
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-02-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: builder
|
|
@@ -405,7 +405,7 @@ metadata:
|
|
|
405
405
|
changelog_uri: https://github.com/braintree/braintree_ruby/blob/master/CHANGELOG.md
|
|
406
406
|
source_code_uri: https://github.com/braintree/braintree_ruby
|
|
407
407
|
documentation_uri: https://developer.paypal.com/braintree/docs
|
|
408
|
-
post_install_message:
|
|
408
|
+
post_install_message:
|
|
409
409
|
rdoc_options: []
|
|
410
410
|
require_paths:
|
|
411
411
|
- lib
|
|
@@ -420,8 +420,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
420
420
|
- !ruby/object:Gem::Version
|
|
421
421
|
version: '0'
|
|
422
422
|
requirements: []
|
|
423
|
-
rubygems_version: 3.
|
|
424
|
-
signing_key:
|
|
423
|
+
rubygems_version: 3.3.15
|
|
424
|
+
signing_key:
|
|
425
425
|
specification_version: 4
|
|
426
426
|
summary: Braintree Ruby Server SDK
|
|
427
427
|
test_files: []
|