braintree 3.0.1 → 3.1.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/bin_data.rb +9 -2
- data/lib/braintree/transaction.rb +3 -2
- data/lib/braintree/transaction/paypal_details.rb +1 -0
- data/lib/braintree/version.rb +2 -2
- data/spec/integration/braintree/dispute_search_spec.rb +1 -1
- data/spec/integration/braintree/transaction_spec.rb +23 -0
- data/spec/unit/braintree/transaction/paypal_details_spec.rb +2 -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: 8fd29c86922c84315bcc22c0318136adefa3b5023ffec6b805578ad9e9f9be0d
|
4
|
+
data.tar.gz: f35f8eef6ccc321816005117c7bd0323a3b1d1e707ddc93ea082f43597ad75e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a286c7e29b1f24de08aa3da6818f6061904f1ab52f581c44b7ce80e37fc7ff42a54a5bdcf39a70255c53965a3e580965d07677a56053d643652a56d39aef1f80
|
7
|
+
data.tar.gz: 7b9f4bef3725bd17dac212babe68a9382a23bde7bacb458c5ca970c2137d374792a84247c222168f5e68518f22917891efd1720d90e2786e85e3a1ba40edd6e1
|
data/lib/braintree/bin_data.rb
CHANGED
@@ -17,10 +17,17 @@ module Braintree
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def inspect
|
20
|
-
|
20
|
+
formatted_attributes = self.class._attributes.map do |attr|
|
21
21
|
"#{attr}: #{send(attr).inspect}"
|
22
22
|
end
|
23
|
-
"
|
23
|
+
"#<#{self.class} #{formatted_attributes.join(", ")}>"
|
24
|
+
end
|
25
|
+
|
26
|
+
def self._attributes # :nodoc:
|
27
|
+
[
|
28
|
+
:commercial, :country_of_issuance, :debit, :durbin_regulated, :healthcare,
|
29
|
+
:issuing_bank, :payroll, :prepaid, :product_id
|
30
|
+
]
|
24
31
|
end
|
25
32
|
end
|
26
33
|
end
|
@@ -90,10 +90,10 @@ module Braintree
|
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
93
|
+
attr_reader :acquirer_reference_number
|
93
94
|
attr_reader :add_ons
|
94
95
|
attr_reader :additional_processor_response # The raw response from the processor.
|
95
96
|
attr_reader :amount
|
96
|
-
attr_reader :google_pay_details
|
97
97
|
attr_reader :apple_pay_details
|
98
98
|
attr_reader :authorization_adjustments
|
99
99
|
attr_reader :authorization_expires_at
|
@@ -118,6 +118,7 @@ module Braintree
|
|
118
118
|
attr_reader :facilitated_details
|
119
119
|
attr_reader :facilitator_details
|
120
120
|
attr_reader :gateway_rejection_reason
|
121
|
+
attr_reader :google_pay_details
|
121
122
|
attr_reader :graphql_id
|
122
123
|
attr_reader :id
|
123
124
|
attr_reader :local_payment_details
|
@@ -142,6 +143,7 @@ module Braintree
|
|
142
143
|
attr_reader :recurring
|
143
144
|
attr_reader :refund_ids
|
144
145
|
attr_reader :refunded_transaction_id
|
146
|
+
attr_reader :retrieval_reference_number
|
145
147
|
attr_reader :risk_data
|
146
148
|
attr_reader :samsung_pay_card_details
|
147
149
|
attr_reader :service_fee_amount
|
@@ -162,7 +164,6 @@ module Braintree
|
|
162
164
|
attr_reader :venmo_account_details
|
163
165
|
attr_reader :visa_checkout_card_details
|
164
166
|
attr_reader :voice_referral_number
|
165
|
-
attr_reader :retrieval_reference_number
|
166
167
|
|
167
168
|
def self.create(*args)
|
168
169
|
Configuration.gateway.transaction.create(*args)
|
data/lib/braintree/version.rb
CHANGED
@@ -109,7 +109,7 @@ describe Braintree::Dispute, "search" do
|
|
109
109
|
search.received_date.between("03/03/2014", "03/05/2014")
|
110
110
|
end
|
111
111
|
|
112
|
-
expect(collection.disputes.count).to
|
112
|
+
expect(collection.disputes.count).to be >= 1
|
113
113
|
dispute = collection.disputes.first
|
114
114
|
|
115
115
|
expect(dispute.received_date).to eq(Date.new(2014, 3, 4))
|
@@ -445,6 +445,7 @@ describe Braintree::Transaction do
|
|
445
445
|
result.transaction.credit_card_details.expiration_date.should == "05/2009"
|
446
446
|
result.transaction.credit_card_details.customer_location.should == "US"
|
447
447
|
result.transaction.retrieval_reference_number.should_not be_nil
|
448
|
+
result.transaction.acquirer_reference_number.should be_nil
|
448
449
|
end
|
449
450
|
|
450
451
|
it "returns a successful network response code if successful" do
|
@@ -2663,6 +2664,22 @@ describe Braintree::Transaction do
|
|
2663
2664
|
end
|
2664
2665
|
end
|
2665
2666
|
|
2667
|
+
context "billing agreement" do
|
2668
|
+
it "can create a paypal billing agreement" do
|
2669
|
+
result = Braintree::Transaction.create(
|
2670
|
+
:type => "sale",
|
2671
|
+
:amount => Braintree::Test::TransactionAmounts::Authorize,
|
2672
|
+
:payment_method_nonce => Braintree::Test::Nonce::PayPalBillingAgreement,
|
2673
|
+
:options => {:store_in_vault => true}
|
2674
|
+
)
|
2675
|
+
|
2676
|
+
result.should be_success
|
2677
|
+
result.transaction.paypal_details.should_not be_nil
|
2678
|
+
result.transaction.paypal_details.debug_id.should_not be_nil
|
2679
|
+
result.transaction.paypal_details.billing_agreement_id.should_not be_nil
|
2680
|
+
end
|
2681
|
+
end
|
2682
|
+
|
2666
2683
|
context "local payments" do
|
2667
2684
|
it "can create a local payment transaction with a nonce" do
|
2668
2685
|
result = Braintree::Transaction.create(
|
@@ -6045,6 +6062,12 @@ describe Braintree::Transaction do
|
|
6045
6062
|
end.to raise_error(Braintree::NotFoundError, 'transaction with id "invalid-id" not found')
|
6046
6063
|
end
|
6047
6064
|
|
6065
|
+
it "finds a transaction and returns an acquirer_reference_number if the transaction has one" do
|
6066
|
+
transaction = Braintree::Transaction.find("transactionwithacquirerreferencenumber")
|
6067
|
+
|
6068
|
+
transaction.acquirer_reference_number.should == "123456789 091019"
|
6069
|
+
end
|
6070
|
+
|
6048
6071
|
context "disbursement_details" do
|
6049
6072
|
it "includes disbursement_details on found transactions" do
|
6050
6073
|
found_transaction = Braintree::Transaction.find("deposittransaction")
|
@@ -5,6 +5,7 @@ describe Braintree::Transaction::PayPalDetails do
|
|
5
5
|
it "sets all fields" do
|
6
6
|
details = Braintree::Transaction::PayPalDetails.new(
|
7
7
|
:authorization_id => "id",
|
8
|
+
:billing_agreement_id => "billing-agreement-id",
|
8
9
|
:capture_id => "capture-id",
|
9
10
|
:custom_field => "custom-field",
|
10
11
|
:debug_id => "debug-id",
|
@@ -30,6 +31,7 @@ describe Braintree::Transaction::PayPalDetails do
|
|
30
31
|
)
|
31
32
|
|
32
33
|
expect(details.authorization_id).to eq("id")
|
34
|
+
expect(details.billing_agreement_id).to eq("billing-agreement-id")
|
33
35
|
expect(details.capture_id).to eq("capture-id")
|
34
36
|
expect(details.custom_field).to eq("custom-field")
|
35
37
|
expect(details.debug_id).to eq("debug-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: 3.0
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Braintree
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: builder
|