Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Don't try and add billing address if there is no billing address attached to credit card #120

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion app/models/solidus_paypal_braintree/gateway.rb
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def transaction_options(source, options, submit_for_settlement = false)
params[:shipping] = braintree_shipping_address(options)
end

if source.credit_card?
if source.credit_card? && options[:bliing_address].present?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great to have a test for this.

Then you actually would have found your typo as well ;)

params[:billing] = braintree_billing_address(options)
end

Expand Down