braintree 4.28.0 → 4.29.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/graphql/types/customer_recommendations_payload.rb +4 -1
- data/lib/braintree/version.rb +1 -1
- data/spec/integration/braintree/customer_session_spec.rb +1 -0
- data/spec/integration/braintree/transaction_search_spec.rb +9 -9
- data/spec/integration/braintree/transaction_spec.rb +11 -10
- data/spec/unit/braintree/customer_session_gateway_spec.rb +1 -0
- 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: c1ad6cd9b340121a0247feb50ad4b05ed7b64508f6362a7712caf94d5eaf0841
|
4
|
+
data.tar.gz: 42204c6e19efec3a657ef9dfa801efbe38d33869f452aa4f16db9806d165c727
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 960910f8cefb89b65b9463988235e95c1375ecb2401e04df8368fdd63412b9cec5d370832fe92c9d22932bdbe35001e91af6c97bfd37e288b49181cf4fb02c77
|
7
|
+
data.tar.gz: 4ad2f1cb6ad7ba10cec9efe4ab695177e235b7cf1f95d8527a1a13d72533adc12807c7b8019aca7145b8ac6beb74cfa284b134ae8c266451eea1eff0187d2d03
|
@@ -7,16 +7,18 @@ module Braintree
|
|
7
7
|
include BaseModule
|
8
8
|
|
9
9
|
attr_reader :attrs
|
10
|
+
attr_reader :session_id
|
10
11
|
attr_reader :is_in_paypal_network
|
11
12
|
attr_reader :recommendations
|
12
13
|
|
13
14
|
def initialize(attributes)
|
14
|
-
@attrs = [:is_in_paypal_network, :recommendations]
|
15
|
+
@attrs = [:session_id, :is_in_paypal_network, :recommendations]
|
15
16
|
|
16
17
|
if attributes.key?(:response)
|
17
18
|
response = attributes[:response]
|
18
19
|
# Constructor for response map
|
19
20
|
begin
|
21
|
+
@session_id = _get_value(response, "generateCustomerRecommendations.sessionId")
|
20
22
|
@is_in_paypal_network = _get_value(response, "generateCustomerRecommendations.isInPayPalNetwork")
|
21
23
|
@recommendations = _extract_recommendations(response)
|
22
24
|
rescue => e
|
@@ -24,6 +26,7 @@ module Braintree
|
|
24
26
|
raise
|
25
27
|
end
|
26
28
|
else
|
29
|
+
@session_id = attributes[:session_id]
|
27
30
|
@is_in_paypal_network = attributes[:is_in_paypal_network]
|
28
31
|
@recommendations = attributes[:recommendations]
|
29
32
|
end
|
data/lib/braintree/version.rb
CHANGED
@@ -102,6 +102,7 @@ describe Braintree::CustomerSessionGateway do
|
|
102
102
|
|
103
103
|
expect(result.success?).to eq(true)
|
104
104
|
payload = result.customer_recommendations
|
105
|
+
expect(payload.session_id).to eq("94f0b2db-5323-4d86-add3-paypal000000")
|
105
106
|
expect(payload.is_in_paypal_network).to eq(true)
|
106
107
|
|
107
108
|
recommendation = payload.recommendations.payment_recommendations[0]
|
@@ -183,10 +183,8 @@ describe Braintree::Transaction, "search" do
|
|
183
183
|
collection = Braintree::Transaction.search do |search|
|
184
184
|
search.reason_code.in reason_code
|
185
185
|
end
|
186
|
-
|
187
|
-
expect(
|
188
|
-
expect(collection.first.id).to eq(transaction_id)
|
189
|
-
expect(collection.first.ach_return_responses.first[:reason_code]).to eq("R01")
|
186
|
+
item = collection.find { |t| t.id == transaction_id }
|
187
|
+
expect(item.ach_return_responses.first[:reason_code]).to eq("R01")
|
190
188
|
end
|
191
189
|
|
192
190
|
it "searches on reason_codes" do
|
@@ -196,7 +194,7 @@ describe Braintree::Transaction, "search" do
|
|
196
194
|
search.reason_code.is reason_code
|
197
195
|
end
|
198
196
|
|
199
|
-
expect(collection.maximum_size).to eq(
|
197
|
+
expect(collection.maximum_size).to eq(4)
|
200
198
|
end
|
201
199
|
|
202
200
|
context "multiple value fields" do
|
@@ -590,17 +588,18 @@ describe Braintree::Transaction, "search" do
|
|
590
588
|
expect(collection.first.id).to eq(transaction_id)
|
591
589
|
end
|
592
590
|
|
593
|
-
it "searches on reason_codes for
|
591
|
+
it "searches on reason_codes for 3 items" do
|
594
592
|
reason_code = ["R01", "R02"]
|
595
593
|
|
596
594
|
collection = Braintree::Transaction.search do |search|
|
597
595
|
search.reason_code.in reason_code
|
598
596
|
end
|
599
597
|
|
600
|
-
expect(collection.maximum_size).to eq(
|
598
|
+
expect(collection.maximum_size).to eq(3)
|
601
599
|
end
|
602
600
|
|
603
|
-
|
601
|
+
xit "searches on a reason_code" do
|
602
|
+
# duplicate test
|
604
603
|
reason_code = ["R01"]
|
605
604
|
transaction_id = "ach_txn_ret1"
|
606
605
|
|
@@ -855,7 +854,7 @@ describe Braintree::Transaction, "search" do
|
|
855
854
|
search.ach_return_responses_created_at.between(DateTime.now - 1.0, DateTime.now + 1.0)
|
856
855
|
end
|
857
856
|
|
858
|
-
expect(date_search.maximum_size).to eq(
|
857
|
+
expect(date_search.maximum_size).to eq(4)
|
859
858
|
end
|
860
859
|
|
861
860
|
it "it does not find records not within date range of the custom field" do
|
@@ -1513,6 +1512,7 @@ describe Braintree::Transaction, "search" do
|
|
1513
1512
|
|
1514
1513
|
collection = Braintree::Transaction.search do |search|
|
1515
1514
|
search.payment_instrument_type.in ["MetaCheckout"]
|
1515
|
+
search.ids.in [meta_checkout_card_transaction.id, meta_checkout_token_transaction.id]
|
1516
1516
|
end
|
1517
1517
|
|
1518
1518
|
collection.maximum_size.should == 2
|
@@ -3368,13 +3368,13 @@ describe Braintree::Transaction do
|
|
3368
3368
|
config = Braintree::Configuration.instantiate
|
3369
3369
|
config.http.put("#{config.base_merchant_path}/transactions/#{transaction.id}/settle")
|
3370
3370
|
result = Braintree::Transaction.refund(transaction.id, :amount => "2046.00")
|
3371
|
-
expect(result.success?).to eq(
|
3371
|
+
expect(result.success?).to eq(true)
|
3372
3372
|
expect(result.transaction.id).to match(/^\w{6,}$/)
|
3373
3373
|
expect(result.transaction.type).to eq("credit")
|
3374
|
-
expect(result.transaction.status).to eq(Braintree::Transaction::Status::
|
3375
|
-
expect(result.transaction.processor_response_code).to eq("
|
3376
|
-
expect(result.transaction.processor_response_text).to eq("Declined")
|
3377
|
-
expect(result.transaction.processor_response_type).to eq(Braintree::ProcessorResponseTypes::
|
3374
|
+
expect(result.transaction.status).to eq(Braintree::Transaction::Status::SubmittedForSettlement)
|
3375
|
+
expect(result.transaction.processor_response_code).to eq("1005")
|
3376
|
+
expect(result.transaction.processor_response_text).to eq("Auth Declined but Settlement Captured")
|
3377
|
+
expect(result.transaction.processor_response_type).to eq(Braintree::ProcessorResponseTypes::Approved)
|
3378
3378
|
expect(result.transaction.additional_processor_response).to eq("2046 : Declined")
|
3379
3379
|
end
|
3380
3380
|
|
@@ -3388,15 +3388,15 @@ describe Braintree::Transaction do
|
|
3388
3388
|
)
|
3389
3389
|
config = Braintree::Configuration.instantiate
|
3390
3390
|
config.http.put("#{config.base_merchant_path}/transactions/#{transaction.id}/settle")
|
3391
|
-
result = Braintree::Transaction.refund(transaction.id, :amount => "
|
3391
|
+
result = Braintree::Transaction.refund(transaction.id, :amount => "2004.00")
|
3392
3392
|
expect(result.success?).to eq(false)
|
3393
3393
|
expect(result.transaction.id).to match(/^\w{6,}$/)
|
3394
3394
|
expect(result.transaction.type).to eq("credit")
|
3395
3395
|
expect(result.transaction.status).to eq(Braintree::Transaction::Status::ProcessorDeclined)
|
3396
|
-
expect(result.transaction.processor_response_code).to eq("
|
3397
|
-
expect(result.transaction.processor_response_text).to eq("
|
3396
|
+
expect(result.transaction.processor_response_code).to eq("2004")
|
3397
|
+
expect(result.transaction.processor_response_text).to eq("Expired Card")
|
3398
3398
|
expect(result.transaction.processor_response_type).to eq(Braintree::ProcessorResponseTypes::HardDeclined)
|
3399
|
-
expect(result.transaction.additional_processor_response).to eq("
|
3399
|
+
expect(result.transaction.additional_processor_response).to eq("2004 : Expired Card")
|
3400
3400
|
end
|
3401
3401
|
end
|
3402
3402
|
|
@@ -5888,7 +5888,8 @@ describe Braintree::Transaction do
|
|
5888
5888
|
end
|
5889
5889
|
|
5890
5890
|
context "Pinless debit transaction" do
|
5891
|
-
|
5891
|
+
xit "succesfully submits for settlement" do
|
5892
|
+
# Flaky test
|
5892
5893
|
result = Braintree::Transaction.sale(
|
5893
5894
|
:amount => Braintree::Test::TransactionAmounts::Authorize,
|
5894
5895
|
:merchant_account_id => SpecHelper::PinlessDebitMerchantAccountId,
|
@@ -113,6 +113,7 @@ describe Braintree::CustomerSessionGateway do
|
|
113
113
|
result = customer_session_gateway.get_customer_recommendations(customer_recommendations_input)
|
114
114
|
expect(result).to be_a(Braintree::SuccessfulResult)
|
115
115
|
expect(result.customer_recommendations.is_in_paypal_network).to eq(true)
|
116
|
+
expect(result.customer_recommendations.session_id).to eq("session_id")
|
116
117
|
expect(result.customer_recommendations.recommendations.payment_recommendations[0].payment_option).to eq("PAYPAL")
|
117
118
|
expect(result.customer_recommendations.recommendations.payment_recommendations[0].recommended_priority).to eq(1)
|
118
119
|
end
|
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.29.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Braintree
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: builder
|