braintree 4.23.0 → 4.24.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/transaction/paypal_details.rb +2 -0
- data/lib/braintree/transaction_gateway.rb +10 -10
- data/lib/braintree/version.rb +1 -1
- data/spec/integration/braintree/advanced_search_spec.rb +7 -4
- data/spec/integration/braintree/credit_card_spec.rb +2 -1
- data/spec/integration/braintree/customer_spec.rb +2 -1
- data/spec/integration/braintree/transaction_search_spec.rb +9 -6
- data/spec/integration/braintree/transaction_spec.rb +38 -0
- data/spec/unit/braintree/transaction/paypal_details_spec.rb +5 -0
- data/spec/unit/braintree/transaction_gateway_spec.rb +10 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d1f769a1e530039399adceb1214c04b7050dd00ab43943dfc15e267907be9bc
|
4
|
+
data.tar.gz: dab377d31b453bbfc98fe210704e309f83628d8eef18f6458f04101bcf7f7407
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab3bf0f9dd88d510a99094899535a8505ac0532fc6bc74ab2fefaa0c02f56910bc25a85d7faebc212a4260b256b8fa2e70fd69336eb9647a46621bfaaadd8581
|
7
|
+
data.tar.gz: ed8a75dd5a0826383440975466f966b7c0ffd232b778499c2de28ac330defd6eb53390873a63e25e89869c2a609626010f9db13cfbd55e3ce8f189e9e7c223e9
|
@@ -20,6 +20,8 @@ module Braintree
|
|
20
20
|
attr_reader :payer_last_name
|
21
21
|
attr_reader :payer_status
|
22
22
|
attr_reader :payment_id
|
23
|
+
attr_reader :recipient_email
|
24
|
+
attr_reader :recipient_phone
|
23
25
|
attr_reader :refund_from_transaction_fee_amount
|
24
26
|
attr_reader :refund_from_transaction_fee_currency_iso_code
|
25
27
|
attr_reader :refund_id
|
@@ -254,24 +254,24 @@ module Braintree
|
|
254
254
|
{:installments => [:count]},
|
255
255
|
{:line_items => [:commodity_code, :description, :discount_amount, :image_url, :kind, :name, :product_code, :quantity, :tax_amount, :total_amount, :unit_amount, :unit_of_measure, :unit_tax_amount, :upc_code, :upc_type, :url]},
|
256
256
|
{:options => [
|
257
|
-
:hold_in_escrow,
|
258
|
-
:store_in_vault,
|
259
|
-
:store_in_vault_on_success,
|
260
|
-
:submit_for_settlement,
|
261
257
|
:add_billing_address_to_payment_method,
|
262
|
-
:
|
263
|
-
:
|
258
|
+
{:amex_rewards => [:request_id, :points, :currency_amount, :currency_iso_code]},
|
259
|
+
{:credit_card => [:account_type, :process_debit_as_credit]},
|
260
|
+
:hold_in_escrow,
|
264
261
|
:payee_id,
|
265
262
|
:payee_email,
|
263
|
+
{:paypal => [:custom_field, :description, :payee_id, :payee_email, :recipient_email, {:recipient_phone => [:country_code, :national_number]}, {:supplementary_data => :_any_key_}]},
|
264
|
+
{:processing_overrides => [:customer_email, :customer_first_name, :customer_last_name, :customer_tax_identifier]},
|
266
265
|
:skip_advanced_fraud_checking,
|
267
266
|
:skip_avs,
|
268
267
|
:skip_cvv,
|
269
|
-
|
270
|
-
|
268
|
+
:store_in_vault,
|
269
|
+
:store_in_vault_on_success,
|
270
|
+
:store_shipping_address_in_vault,
|
271
|
+
:submit_for_settlement,
|
271
272
|
{:three_d_secure => [:required]},
|
272
|
-
{:amex_rewards => [:request_id, :points, :currency_amount, :currency_iso_code]},
|
273
273
|
{:venmo => [:profile_id]},
|
274
|
-
|
274
|
+
:venmo_sdk_session, # Deprecated
|
275
275
|
]
|
276
276
|
},
|
277
277
|
{:paypal_account => [:email, :token, :paypal_data, :payee_id, :payee_email, :payer_id, :payment_id]},
|
data/lib/braintree/version.rb
CHANGED
@@ -33,7 +33,8 @@ describe Braintree::AdvancedSearch do
|
|
33
33
|
expect(collection).not_to include(subscription2)
|
34
34
|
end
|
35
35
|
|
36
|
-
|
36
|
+
# we are temporarily skipping this test until we have a more stable CI env
|
37
|
+
xit "is_not" do
|
37
38
|
id = rand(36**8).to_s(36)
|
38
39
|
subscription1 = Braintree::Subscription.create(
|
39
40
|
:payment_method_token => @credit_card.token,
|
@@ -80,7 +81,8 @@ describe Braintree::AdvancedSearch do
|
|
80
81
|
expect(collection).not_to include(subscription2)
|
81
82
|
end
|
82
83
|
|
83
|
-
|
84
|
+
# we are temporarily skipping this test until we have a more stable CI env
|
85
|
+
xit "ends_with" do
|
84
86
|
id = rand(36**8).to_s(36)
|
85
87
|
subscription1 = Braintree::Subscription.create(
|
86
88
|
:payment_method_token => @credit_card.token,
|
@@ -175,7 +177,8 @@ describe Braintree::AdvancedSearch do
|
|
175
177
|
expect(collection).not_to include(subscription2)
|
176
178
|
end
|
177
179
|
|
178
|
-
|
180
|
+
# ignore until more stable CI
|
181
|
+
xit "returns only matching results given an argument list" do
|
179
182
|
subscription1 = Braintree::Subscription.create(
|
180
183
|
:payment_method_token => @credit_card.token,
|
181
184
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
@@ -262,7 +265,7 @@ describe Braintree::AdvancedSearch do
|
|
262
265
|
|
263
266
|
context "multiple_value_or_text_field" do
|
264
267
|
describe "in" do
|
265
|
-
|
268
|
+
xit "works for the in operator(temporarily disabling until more stable CI)" do
|
266
269
|
Braintree::Subscription.create(
|
267
270
|
:payment_method_token => @credit_card.token,
|
268
271
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
@@ -1203,7 +1203,8 @@ describe Braintree::CreditCard do
|
|
1203
1203
|
end
|
1204
1204
|
|
1205
1205
|
describe "self.expiring_between" do
|
1206
|
-
|
1206
|
+
#Disabling this test until we have a more stable CI
|
1207
|
+
xit "finds payment methods expiring between the given dates" do
|
1207
1208
|
next_year = Time.now.year + 1
|
1208
1209
|
collection = Braintree::CreditCard.expiring_between(Time.mktime(next_year, 1), Time.mktime(next_year, 12))
|
1209
1210
|
expect(collection.maximum_size).to be > 0
|
@@ -4,7 +4,8 @@ require File.expand_path(File.dirname(__FILE__) + "/client_api/spec_helper")
|
|
4
4
|
|
5
5
|
describe Braintree::Customer do
|
6
6
|
describe "self.all" do
|
7
|
-
|
7
|
+
#Disabling test until we have a more stable CI
|
8
|
+
xit "gets more than a page of customers" do
|
8
9
|
customers = Braintree::Customer.all
|
9
10
|
expect(customers.maximum_size).to be > 100
|
10
11
|
|
@@ -11,7 +11,8 @@ describe Braintree::Transaction, "search" do
|
|
11
11
|
expect(collection.maximum_size).to eq(0)
|
12
12
|
end
|
13
13
|
|
14
|
-
|
14
|
+
#Disabling test until we have more stable CI
|
15
|
+
xit "can search on text fields" do
|
15
16
|
first_name = "Tim_#{rand(10**10)}"
|
16
17
|
token = "creditcard_#{rand(10**10)}"
|
17
18
|
customer_id = "customer_#{rand(10**10)}"
|
@@ -130,7 +131,8 @@ describe Braintree::Transaction, "search" do
|
|
130
131
|
expect(collection.first.id).to eq(transaction.id)
|
131
132
|
end
|
132
133
|
|
133
|
-
|
134
|
+
#Disabling test until we have more stable CI
|
135
|
+
xit "searches on users" do
|
134
136
|
transaction = Braintree::Transaction.sale!(
|
135
137
|
:amount => Braintree::Test::TransactionAmounts::Authorize,
|
136
138
|
:payment_method_nonce => Braintree::Test::Nonce::PayPalBillingAgreement,
|
@@ -1002,7 +1004,7 @@ describe Braintree::Transaction, "search" do
|
|
1002
1004
|
}
|
1003
1005
|
end
|
1004
1006
|
|
1005
|
-
|
1007
|
+
xit "searches on dispute_date in UTC" do
|
1006
1008
|
collection = Braintree::Transaction.search do |search|
|
1007
1009
|
search.id.is @disputed_transaction.id
|
1008
1010
|
search.dispute_date.between(
|
@@ -1039,7 +1041,7 @@ describe Braintree::Transaction, "search" do
|
|
1039
1041
|
expect(collection.first.id).to eq(@disputed_transaction.id)
|
1040
1042
|
end
|
1041
1043
|
|
1042
|
-
|
1044
|
+
xit "searches on dispute_date in local time" do
|
1043
1045
|
now = @disputed_time.localtime("-06:00")
|
1044
1046
|
|
1045
1047
|
collection = Braintree::Transaction.search do |search|
|
@@ -1069,7 +1071,7 @@ describe Braintree::Transaction, "search" do
|
|
1069
1071
|
expect(collection.maximum_size).to eq(1)
|
1070
1072
|
end
|
1071
1073
|
|
1072
|
-
|
1074
|
+
xit "searches on dispute_date with date ranges" do
|
1073
1075
|
collection = Braintree::Transaction.search do |search|
|
1074
1076
|
search.id.is @disputed_transaction.id
|
1075
1077
|
search.dispute_date.between(
|
@@ -1375,7 +1377,8 @@ describe Braintree::Transaction, "search" do
|
|
1375
1377
|
end
|
1376
1378
|
end
|
1377
1379
|
|
1378
|
-
|
1380
|
+
#Disabling until we have a more stable CI
|
1381
|
+
xit "returns multiple results" do
|
1379
1382
|
collection = Braintree::Transaction.search
|
1380
1383
|
expect(collection.maximum_size).to be > 100
|
1381
1384
|
|
@@ -5765,6 +5765,32 @@ describe Braintree::Transaction do
|
|
5765
5765
|
expect(result.success?).to eq(false)
|
5766
5766
|
expect(result.errors.for(:transaction).for(:credit_card).map { |e| e.code }.sort).to eq [Braintree::ErrorCodes::CreditCard::NetworkTokenizationAttributeCryptogramIsRequired]
|
5767
5767
|
end
|
5768
|
+
|
5769
|
+
it "Works with missing cryptogram and specified previous_network_transaction_id" do
|
5770
|
+
params = {
|
5771
|
+
:amount => Braintree::Test::TransactionAmounts::Authorize,
|
5772
|
+
:credit_card => {
|
5773
|
+
:number => Braintree::Test::CreditCardNumbers::Visa,
|
5774
|
+
:expiration_date => "05/2009",
|
5775
|
+
:network_tokenization_attributes => {
|
5776
|
+
:ecommerce_indicator => "05",
|
5777
|
+
:token_requestor_id => "45310020105"
|
5778
|
+
},
|
5779
|
+
},
|
5780
|
+
:external_vault => {
|
5781
|
+
:status => Braintree::Transaction::ExternalVault::Status::Vaulted,
|
5782
|
+
:previous_network_transaction_id => "123456789012345"
|
5783
|
+
},
|
5784
|
+
:transaction_source => "recurring"
|
5785
|
+
}
|
5786
|
+
result = Braintree::Transaction.sale(params)
|
5787
|
+
expect(result.success?).to eq true
|
5788
|
+
expect(result.transaction.status).to eq Braintree::Transaction::Status::Authorized
|
5789
|
+
expect(result.transaction.processed_with_network_token?).to eq true
|
5790
|
+
|
5791
|
+
network_token_details = result.transaction.network_token_details
|
5792
|
+
expect(network_token_details.is_network_tokenized?).to eq true
|
5793
|
+
end
|
5768
5794
|
end
|
5769
5795
|
|
5770
5796
|
xit "Amex Pay with Points" do
|
@@ -7139,6 +7165,18 @@ describe Braintree::Transaction do
|
|
7139
7165
|
expect(result.transaction.status).to eq(Braintree::Transaction::Status::Voided)
|
7140
7166
|
end
|
7141
7167
|
|
7168
|
+
it "returns a successful result if contact details passed in" do
|
7169
|
+
result = Braintree::Transaction.sale(
|
7170
|
+
:payment_method_nonce => Braintree::Test::Nonce::PayPalOneTimePayment,
|
7171
|
+
:amount => "10",
|
7172
|
+
:options => {
|
7173
|
+
:paypal => {}
|
7174
|
+
},
|
7175
|
+
)
|
7176
|
+
expect(result.success?).to eq(true)
|
7177
|
+
expect(result.transaction.paypal_details.recipient_email).to eq("test@paypal.com")
|
7178
|
+
end
|
7179
|
+
|
7142
7180
|
it "returns an error result if unsuccessful" do
|
7143
7181
|
transaction = Braintree::Transaction.sale(
|
7144
7182
|
:amount => Braintree::Test::TransactionAmounts::Decline,
|
@@ -21,6 +21,8 @@ describe Braintree::Transaction::PayPalDetails do
|
|
21
21
|
:payer_last_name => "Hopper",
|
22
22
|
:payer_status =>"status",
|
23
23
|
:payment_id => "payment-id",
|
24
|
+
:recipient_email => "test@paypal.com",
|
25
|
+
:recipient_phone => [:country_code => "1", :national_number => "4082222222"],
|
24
26
|
:refund_from_transaction_fee_amount => "1.00",
|
25
27
|
:refund_from_transaction_fee_currency_iso_code => "123",
|
26
28
|
:refund_id => "refund-id",
|
@@ -49,6 +51,9 @@ describe Braintree::Transaction::PayPalDetails do
|
|
49
51
|
expect(details.payer_last_name).to eq("Hopper")
|
50
52
|
expect(details.payer_status).to eq("status")
|
51
53
|
expect(details.payment_id).to eq("payment-id")
|
54
|
+
expect(details.recipient_email).to eq("test@paypal.com")
|
55
|
+
expect(details.recipient_phone.country_code).to eq("1")
|
56
|
+
expect(details.recipient_phone.national_number).to eq("4082222222")
|
52
57
|
expect(details.refund_from_transaction_fee_amount).to eq("1.00")
|
53
58
|
expect(details.refund_from_transaction_fee_currency_iso_code).to eq("123")
|
54
59
|
expect(details.refund_id).to eq("refund-id")
|
@@ -73,24 +73,24 @@ describe Braintree::TransactionGateway do
|
|
73
73
|
{:installments => [:count]},
|
74
74
|
{:line_items => [:commodity_code, :description, :discount_amount, :image_url, :kind, :name, :product_code, :quantity, :tax_amount, :total_amount, :unit_amount, :unit_of_measure, :unit_tax_amount, :upc_code, :upc_type, :url]},
|
75
75
|
{:options => [
|
76
|
-
:hold_in_escrow,
|
77
|
-
:store_in_vault,
|
78
|
-
:store_in_vault_on_success,
|
79
|
-
:submit_for_settlement,
|
80
76
|
:add_billing_address_to_payment_method,
|
81
|
-
:
|
82
|
-
:
|
77
|
+
{:amex_rewards => [:request_id, :points, :currency_amount, :currency_iso_code]},
|
78
|
+
{:credit_card => [:account_type, :process_debit_as_credit]},
|
79
|
+
:hold_in_escrow,
|
83
80
|
:payee_id,
|
84
81
|
:payee_email,
|
82
|
+
{:paypal => [:custom_field, :description, :payee_id, :payee_email, :recipient_email, {:recipient_phone => [:country_code, :national_number]}, {:supplementary_data => :_any_key_}]},
|
83
|
+
{:processing_overrides => [:customer_email, :customer_first_name, :customer_last_name, :customer_tax_identifier]},
|
85
84
|
:skip_advanced_fraud_checking,
|
86
85
|
:skip_avs,
|
87
86
|
:skip_cvv,
|
88
|
-
|
89
|
-
|
87
|
+
:store_in_vault,
|
88
|
+
:store_in_vault_on_success,
|
89
|
+
:store_shipping_address_in_vault,
|
90
|
+
:submit_for_settlement,
|
90
91
|
{:three_d_secure => [:required]},
|
91
|
-
{:amex_rewards => [:request_id, :points, :currency_amount, :currency_iso_code]},
|
92
92
|
{:venmo => [:profile_id]},
|
93
|
-
|
93
|
+
:venmo_sdk_session, # Deprecated
|
94
94
|
]
|
95
95
|
},
|
96
96
|
{:paypal_account => [:email, :token, :paypal_data, :payee_id, :payee_email, :payer_id, :payment_id]},
|
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.24.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Braintree
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: builder
|