braintree 3.0.1 → 3.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 65d2cc6a7357e4cb814afc85ad926832dc746e874a08583b7905cd8b3aa8b004
4
- data.tar.gz: 6c43487912cceb31dbeb1b0b9d73050f6b6179e2a99c062a632b04f8c7c9c866
3
+ metadata.gz: 8fd29c86922c84315bcc22c0318136adefa3b5023ffec6b805578ad9e9f9be0d
4
+ data.tar.gz: f35f8eef6ccc321816005117c7bd0323a3b1d1e707ddc93ea082f43597ad75e6
5
5
  SHA512:
6
- metadata.gz: bb38ff65933619995157992aba73994dac75a28f190e098c16cd3864215305710ffa8db7ada6ff3b88f5f78a6f65a1db0d9158672f1e277fa44dfe052e5be9da
7
- data.tar.gz: 70c01aac5d220f2b2d82b2dc7180071d4f8db67e8bd3622e512ccbd849fc19eecde5db6c6232f244b3495c2b2bdb0e3aff92121141d801e4722c1c004b1201f8
6
+ metadata.gz: a286c7e29b1f24de08aa3da6818f6061904f1ab52f581c44b7ce80e37fc7ff42a54a5bdcf39a70255c53965a3e580965d07677a56053d643652a56d39aef1f80
7
+ data.tar.gz: 7b9f4bef3725bd17dac212babe68a9382a23bde7bacb458c5ca970c2137d374792a84247c222168f5e68518f22917891efd1720d90e2786e85e3a1ba40edd6e1
@@ -17,10 +17,17 @@ module Braintree
17
17
  end
18
18
 
19
19
  def inspect
20
- formatted_attrs = self.class._attributes.map do |attr|
20
+ formatted_attributes = self.class._attributes.map do |attr|
21
21
  "#{attr}: #{send(attr).inspect}"
22
22
  end
23
- "#<BinData #{formatted_attrs.join(", ")}>"
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)
@@ -4,6 +4,7 @@ module Braintree
4
4
  include BaseModule
5
5
 
6
6
  attr_reader :authorization_id
7
+ attr_reader :billing_agreement_id
7
8
  attr_reader :capture_id
8
9
  attr_reader :custom_field
9
10
  attr_reader :debug_id
@@ -1,8 +1,8 @@
1
1
  module Braintree
2
2
  module Version
3
3
  Major = 3
4
- Minor = 0
5
- Tiny = 1
4
+ Minor = 1
5
+ Tiny = 0
6
6
 
7
7
  String = "#{Major}.#{Minor}.#{Tiny}"
8
8
  end
@@ -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 eq(1)
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.1
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-10-19 00:00:00.000000000 Z
11
+ date: 2020-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: builder