From e40844f64101a9f508aa128b0b316febd64f05dc Mon Sep 17 00:00:00 2001 From: Braintree Date: Mon, 9 Nov 2020 20:42:44 +0000 Subject: [PATCH] 3.1.0 --- CHANGELOG.md | 5 ++-- README.md | 2 ++ lib/braintree/transaction.rb | 5 ++-- lib/braintree/transaction/paypal_details.rb | 1 + lib/braintree/version.rb | 4 ++-- .../braintree/dispute_search_spec.rb | 2 +- .../integration/braintree/transaction_spec.rb | 23 +++++++++++++++++++ .../transaction/paypal_details_spec.rb | 2 ++ 8 files changed, 37 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9fb17cd..6ca45a70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index f8cb5483..7dc858c8 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/lib/braintree/transaction.rb b/lib/braintree/transaction.rb index b6375008..18c440f0 100644 --- a/lib/braintree/transaction.rb +++ b/lib/braintree/transaction.rb @@ -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 @@ -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 @@ -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 @@ -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) diff --git a/lib/braintree/transaction/paypal_details.rb b/lib/braintree/transaction/paypal_details.rb index bedf759d..39b901c8 100644 --- a/lib/braintree/transaction/paypal_details.rb +++ b/lib/braintree/transaction/paypal_details.rb @@ -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 diff --git a/lib/braintree/version.rb b/lib/braintree/version.rb index 699a3d6c..0a8c0a93 100644 --- a/lib/braintree/version.rb +++ b/lib/braintree/version.rb @@ -1,8 +1,8 @@ module Braintree module Version Major = 3 - Minor = 0 - Tiny = 1 + Minor = 1 + Tiny = 0 String = "#{Major}.#{Minor}.#{Tiny}" end diff --git a/spec/integration/braintree/dispute_search_spec.rb b/spec/integration/braintree/dispute_search_spec.rb index c290308c..9f736499 100644 --- a/spec/integration/braintree/dispute_search_spec.rb +++ b/spec/integration/braintree/dispute_search_spec.rb @@ -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)) diff --git a/spec/integration/braintree/transaction_spec.rb b/spec/integration/braintree/transaction_spec.rb index 9e642340..c69d1f74 100644 --- a/spec/integration/braintree/transaction_spec.rb +++ b/spec/integration/braintree/transaction_spec.rb @@ -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 @@ -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( @@ -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") diff --git a/spec/unit/braintree/transaction/paypal_details_spec.rb b/spec/unit/braintree/transaction/paypal_details_spec.rb index b7d0c1fe..611a7293 100644 --- a/spec/unit/braintree/transaction/paypal_details_spec.rb +++ b/spec/unit/braintree/transaction/paypal_details_spec.rb @@ -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", @@ -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")