Skip to content

Commit

Permalink
2.104.1
Browse files Browse the repository at this point in the history
  • Loading branch information
braintreeps committed Oct 12, 2020
1 parent dae568f commit 295b40a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.104.1

* Update `LocalPaymentCompleted` webhook to handle no transaction being created for unbranded local payment methods

## 2.104.0

* Deprecate Masterpass and American Express Checkout payment methods.
Expand Down
2 changes: 1 addition & 1 deletion lib/braintree/local_payment_completed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class LocalPaymentCompleted

def initialize(attributes) # :nodoc:
set_instance_variables_from_hash(attributes)
@transaction = Transaction._new(Configuration.gateway, transaction)
@transaction = Transaction._new(Configuration.gateway, transaction) unless transaction.nil?
end

class << self
Expand Down
2 changes: 1 addition & 1 deletion lib/braintree/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Braintree
module Version
Major = 2
Minor = 104
Tiny = 0
Tiny = 1

String = "#{Major}.#{Minor}.#{Tiny}"
end
Expand Down
14 changes: 14 additions & 0 deletions spec/unit/braintree/local_payment_completed_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,19 @@
local_payment_completed.transaction.order_id.should eq("an-order-id")
local_payment_completed.transaction.status.should eq(Braintree::Transaction::Status::Authorized)
end

it "initializes the object with the appropriate attributes set if no transaction is provided" do
params = {
payment_id: "a-payment-id",
payer_id: "a-payer-id",
payment_method_nonce: "a-nonce",
}
local_payment_completed = Braintree::LocalPaymentCompleted._new(params)

local_payment_completed.payment_id.should eq("a-payment-id")
local_payment_completed.payer_id.should eq("a-payer-id")
local_payment_completed.payment_method_nonce.should eq("a-nonce")
local_payment_completed.transaction.should be_nil
end
end
end

0 comments on commit 295b40a

Please sign in to comment.