Skip to content

Commit

Permalink
3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
braintreeps committed Nov 9, 2020
1 parent 43e4c7a commit e40844f
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 7 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Changelog

## unreleased

## 3.1.0
* Add `acquirer_reference_number` to `Transaction`
* Add `billing_agreement_id` to `PayPalDetails`
* Update `BinData` class to correctly execute the `inspect` method.(Thanks @kinduff)

## 3.0.1
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Braintree employs a deprecation policy for our SDKs. For more information on the

* [Official documentation](https://developers.braintreepayments.com/start/hello-server/ruby)

Updating from an Inactive, Deprecated, or Unsupported version of this SDK? Check our [Migration Guide](https://developers.braintreepayments.com/reference/general/server-sdk-migration-guide/ruby) for tips.

## Quick Start Example

```ruby
Expand Down
5 changes: 3 additions & 2 deletions lib/braintree/transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ module Status
end
end

attr_reader :acquirer_reference_number
attr_reader :add_ons
attr_reader :additional_processor_response # The raw response from the processor.
attr_reader :amount
attr_reader :google_pay_details
attr_reader :apple_pay_details
attr_reader :authorization_adjustments
attr_reader :authorization_expires_at
Expand All @@ -118,6 +118,7 @@ module Status
attr_reader :facilitated_details
attr_reader :facilitator_details
attr_reader :gateway_rejection_reason
attr_reader :google_pay_details
attr_reader :graphql_id
attr_reader :id
attr_reader :local_payment_details
Expand All @@ -142,6 +143,7 @@ module Status
attr_reader :recurring
attr_reader :refund_ids
attr_reader :refunded_transaction_id
attr_reader :retrieval_reference_number
attr_reader :risk_data
attr_reader :samsung_pay_card_details
attr_reader :service_fee_amount
Expand All @@ -162,7 +164,6 @@ module Status
attr_reader :venmo_account_details
attr_reader :visa_checkout_card_details
attr_reader :voice_referral_number
attr_reader :retrieval_reference_number

def self.create(*args)
Configuration.gateway.transaction.create(*args)
Expand Down
1 change: 1 addition & 0 deletions lib/braintree/transaction/paypal_details.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class PayPalDetails
include BaseModule

attr_reader :authorization_id
attr_reader :billing_agreement_id
attr_reader :capture_id
attr_reader :custom_field
attr_reader :debug_id
Expand Down
4 changes: 2 additions & 2 deletions lib/braintree/version.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module Braintree
module Version
Major = 3
Minor = 0
Tiny = 1
Minor = 1
Tiny = 0

String = "#{Major}.#{Minor}.#{Tiny}"
end
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/braintree/dispute_search_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
search.received_date.between("03/03/2014", "03/05/2014")
end

expect(collection.disputes.count).to eq(1)
expect(collection.disputes.count).to be >= 1
dispute = collection.disputes.first

expect(dispute.received_date).to eq(Date.new(2014, 3, 4))
Expand Down
23 changes: 23 additions & 0 deletions spec/integration/braintree/transaction_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@
result.transaction.credit_card_details.expiration_date.should == "05/2009"
result.transaction.credit_card_details.customer_location.should == "US"
result.transaction.retrieval_reference_number.should_not be_nil
result.transaction.acquirer_reference_number.should be_nil
end

it "returns a successful network response code if successful" do
Expand Down Expand Up @@ -2663,6 +2664,22 @@
end
end

context "billing agreement" do
it "can create a paypal billing agreement" do
result = Braintree::Transaction.create(
:type => "sale",
:amount => Braintree::Test::TransactionAmounts::Authorize,
:payment_method_nonce => Braintree::Test::Nonce::PayPalBillingAgreement,
:options => {:store_in_vault => true}
)

result.should be_success
result.transaction.paypal_details.should_not be_nil
result.transaction.paypal_details.debug_id.should_not be_nil
result.transaction.paypal_details.billing_agreement_id.should_not be_nil
end
end

context "local payments" do
it "can create a local payment transaction with a nonce" do
result = Braintree::Transaction.create(
Expand Down Expand Up @@ -6045,6 +6062,12 @@
end.to raise_error(Braintree::NotFoundError, 'transaction with id "invalid-id" not found')
end

it "finds a transaction and returns an acquirer_reference_number if the transaction has one" do
transaction = Braintree::Transaction.find("transactionwithacquirerreferencenumber")

transaction.acquirer_reference_number.should == "123456789 091019"
end

context "disbursement_details" do
it "includes disbursement_details on found transactions" do
found_transaction = Braintree::Transaction.find("deposittransaction")
Expand Down
2 changes: 2 additions & 0 deletions spec/unit/braintree/transaction/paypal_details_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
it "sets all fields" do
details = Braintree::Transaction::PayPalDetails.new(
:authorization_id => "id",
:billing_agreement_id => "billing-agreement-id",
:capture_id => "capture-id",
:custom_field => "custom-field",
:debug_id => "debug-id",
Expand All @@ -30,6 +31,7 @@
)

expect(details.authorization_id).to eq("id")
expect(details.billing_agreement_id).to eq("billing-agreement-id")
expect(details.capture_id).to eq("capture-id")
expect(details.custom_field).to eq("custom-field")
expect(details.debug_id).to eq("debug-id")
Expand Down

0 comments on commit e40844f

Please sign in to comment.