braintree 4.36.0 → 4.37.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/credit_card_verification.rb +1 -0
- data/lib/braintree/transaction.rb +1 -0
- data/lib/braintree/version.rb +1 -1
- data/spec/integration/braintree/credit_card_verification_spec.rb +36 -0
- data/spec/integration/braintree/transaction_spec.rb +35 -1
- data/spec/unit/braintree/credit_card_verification_spec.rb +7 -0
- data/spec/unit/braintree/transaction_spec.rb +10 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f6caf45c8c01ed96cbda734799d6af4445fb48aeb96d04dcd261cdb8986a0c3d
|
|
4
|
+
data.tar.gz: 28cddb63bbe271008adeac7541458a147c2b536acebd61492e7f803fe01a54c7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0a649a80b6d11cc600f6e5eb2feea91aec32a1c808e6786a5a05121eb0f0b149e9937dfd8ecdfd18b5bcadc605f2ac7b89e9341383db29d31f2541331dc956b8
|
|
7
|
+
data.tar.gz: 037444564b51d29d4631cc8f7f39280a72a99db13ebc76d5f02c14d28e839606123c773e2b3ccd32b43ceee262ffd9535381fe20686dd0497720c26564bd818f
|
|
@@ -40,6 +40,7 @@ module Braintree
|
|
|
40
40
|
attr_reader :gateway_rejection_reason
|
|
41
41
|
attr_reader :graphql_id
|
|
42
42
|
attr_reader :id
|
|
43
|
+
attr_reader :mastercard_transaction_link_id
|
|
43
44
|
attr_reader :merchant_account_id
|
|
44
45
|
attr_reader :network_response_code
|
|
45
46
|
attr_reader :network_response_text
|
|
@@ -122,6 +122,7 @@ module Braintree
|
|
|
122
122
|
attr_reader :installment_count
|
|
123
123
|
attr_reader :installments
|
|
124
124
|
attr_reader :local_payment_details
|
|
125
|
+
attr_reader :mastercard_transaction_link_id
|
|
125
126
|
attr_reader :merchant_account_id
|
|
126
127
|
attr_reader :merchant_advice_code
|
|
127
128
|
attr_reader :merchant_advice_code_text
|
data/lib/braintree/version.rb
CHANGED
|
@@ -48,6 +48,42 @@ describe Braintree::CreditCardVerification, "search" do
|
|
|
48
48
|
expect(result.credit_card_verification.processor_response_type).to eq(Braintree::ProcessorResponseTypes::Approved)
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
+
it "returns mastercard transaction link id in response" do
|
|
52
|
+
verification_params = {
|
|
53
|
+
:credit_card => {
|
|
54
|
+
:expiration_date => "05/2032",
|
|
55
|
+
:number => Braintree::Test::CreditCardNumbers::MasterCard,
|
|
56
|
+
},
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
result = Braintree::CreditCardVerification.create(verification_params)
|
|
60
|
+
|
|
61
|
+
expect(result).to be_success
|
|
62
|
+
expect(result.credit_card_verification.status).to eq(Braintree::CreditCardVerification::Status::Verified)
|
|
63
|
+
expect(result.credit_card_verification.processor_response_code).to eq("1000")
|
|
64
|
+
expect(result.credit_card_verification.processor_response_text).to eq("Approved")
|
|
65
|
+
expect(result.credit_card_verification.processor_response_type).to eq(Braintree::ProcessorResponseTypes::Approved)
|
|
66
|
+
expect(result.credit_card_verification.mastercard_transaction_link_id).to match(/\A[a-zA-Z0-9]{22}\z/)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
it "doesnot return mastercard transaction link id in response for a non mastercard" do
|
|
70
|
+
verification_params = {
|
|
71
|
+
:credit_card => {
|
|
72
|
+
:expiration_date => "05/2032",
|
|
73
|
+
:number => Braintree::Test::CreditCardNumbers::Visa,
|
|
74
|
+
},
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
result = Braintree::CreditCardVerification.create(verification_params)
|
|
78
|
+
|
|
79
|
+
expect(result).to be_success
|
|
80
|
+
expect(result.credit_card_verification.status).to eq(Braintree::CreditCardVerification::Status::Verified)
|
|
81
|
+
expect(result.credit_card_verification.processor_response_code).to eq("1000")
|
|
82
|
+
expect(result.credit_card_verification.processor_response_text).to eq("Approved")
|
|
83
|
+
expect(result.credit_card_verification.processor_response_type).to eq(Braintree::ProcessorResponseTypes::Approved)
|
|
84
|
+
expect(result.credit_card_verification.mastercard_transaction_link_id).to be_nil
|
|
85
|
+
end
|
|
86
|
+
|
|
51
87
|
it "creates a new verification for Visa ANI" do
|
|
52
88
|
verification_params = {
|
|
53
89
|
:credit_card => {
|
|
@@ -336,7 +336,7 @@ describe Braintree::Transaction do
|
|
|
336
336
|
|
|
337
337
|
describe "sca_exemption" do
|
|
338
338
|
context "with a valid request" do
|
|
339
|
-
|
|
339
|
+
xit "succeeds" do
|
|
340
340
|
requested_exemption = "low_value"
|
|
341
341
|
result = Braintree::Transaction.create(
|
|
342
342
|
:type => "sale",
|
|
@@ -7960,6 +7960,40 @@ describe Braintree::Transaction do
|
|
|
7960
7960
|
end
|
|
7961
7961
|
end
|
|
7962
7962
|
|
|
7963
|
+
describe "mastercard_transaction_link_id" do
|
|
7964
|
+
it "is available in response for mastercard" do
|
|
7965
|
+
result = Braintree::Transaction.create(
|
|
7966
|
+
:type => "sale",
|
|
7967
|
+
:amount => Braintree::Test::TransactionAmounts::Authorize,
|
|
7968
|
+
:accept_partial_authorization => true,
|
|
7969
|
+
:credit_card => {
|
|
7970
|
+
:number => Braintree::Test::CreditCardNumbers::MasterCard,
|
|
7971
|
+
:expiration_date => "05/2029"
|
|
7972
|
+
},
|
|
7973
|
+
)
|
|
7974
|
+
|
|
7975
|
+
expect(result.success?).to eq(true)
|
|
7976
|
+
expect(result.transaction.processor_response_code).to eq("1000")
|
|
7977
|
+
expect(result.transaction.mastercard_transaction_link_id).to match(/\A[a-zA-Z0-9]{22}\z/)
|
|
7978
|
+
end
|
|
7979
|
+
|
|
7980
|
+
it "is not available in response for non mastercard" do
|
|
7981
|
+
result = Braintree::Transaction.create(
|
|
7982
|
+
:type => "sale",
|
|
7983
|
+
:amount => Braintree::Test::TransactionAmounts::Authorize,
|
|
7984
|
+
:accept_partial_authorization => true,
|
|
7985
|
+
:credit_card => {
|
|
7986
|
+
:number => Braintree::Test::CreditCardNumbers::Visa,
|
|
7987
|
+
:expiration_date => "05/2029"
|
|
7988
|
+
},
|
|
7989
|
+
)
|
|
7990
|
+
|
|
7991
|
+
expect(result.success?).to eq(true)
|
|
7992
|
+
expect(result.transaction.processor_response_code).to eq("1000")
|
|
7993
|
+
expect(result.transaction.mastercard_transaction_link_id).to be_nil
|
|
7994
|
+
end
|
|
7995
|
+
end
|
|
7996
|
+
|
|
7963
7997
|
context "Surcharge Amount" do
|
|
7964
7998
|
it "accepts surcharge_amount field" do
|
|
7965
7999
|
result = Braintree::Transaction.create(
|
|
@@ -60,6 +60,13 @@ describe Braintree::CreditCardVerification do
|
|
|
60
60
|
expect(verification.network_transaction_id).to eq "123456789012345"
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
+
it "sets mastercard_transaction_link_id" do
|
|
64
|
+
verification = Braintree::CreditCardVerification._new(
|
|
65
|
+
:mastercard_transaction_link_id => "ZairABg6CIFekPMsnK0cJ2",
|
|
66
|
+
)
|
|
67
|
+
expect(verification.mastercard_transaction_link_id).to eq "ZairABg6CIFekPMsnK0cJ2"
|
|
68
|
+
end
|
|
69
|
+
|
|
63
70
|
describe "self.create" do
|
|
64
71
|
it "rejects invalid parameters" do
|
|
65
72
|
expect do
|
|
@@ -577,6 +577,16 @@ describe Braintree::Transaction do
|
|
|
577
577
|
end
|
|
578
578
|
end
|
|
579
579
|
|
|
580
|
+
describe "mastercard transaction link id" do
|
|
581
|
+
it "is correctly set" do
|
|
582
|
+
transaction = Braintree::Transaction._new(
|
|
583
|
+
:gateway,
|
|
584
|
+
:mastercard_transaction_link_id => "ZairABg6CIFekPMsnK0cJ2",
|
|
585
|
+
)
|
|
586
|
+
expect(transaction.mastercard_transaction_link_id).to eq("ZairABg6CIFekPMsnK0cJ2")
|
|
587
|
+
end
|
|
588
|
+
end
|
|
589
|
+
|
|
580
590
|
describe "request includes surcharge amount" do
|
|
581
591
|
it "if the surcharge_amount is present" do
|
|
582
592
|
transaction = Braintree::Transaction._new(:gateway, :surcharge_amount => "1.00")
|
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.37.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Braintree
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-05-
|
|
11
|
+
date: 2026-05-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: builder
|
|
@@ -437,7 +437,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
437
437
|
- !ruby/object:Gem::Version
|
|
438
438
|
version: '0'
|
|
439
439
|
requirements: []
|
|
440
|
-
rubygems_version: 3.
|
|
440
|
+
rubygems_version: 3.4.19
|
|
441
441
|
signing_key:
|
|
442
442
|
specification_version: 4
|
|
443
443
|
summary: Braintree Ruby Server SDK
|