Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

2.6.3

  • Loading branch information...
commit 0bd31cd05209efa7229a872a2630ef64ad39c3a2 1 parent bd0c618
@braintreeps braintreeps authored
View
4 CHANGELOG.rdoc
@@ -1,3 +1,7 @@
+== 2.6.3
+
+* Allow passing of existing shipping_address_id on new transactions
+
== 2.6.2
* Added billing_address_id to allowed parameters for credit cards create and update
View
2  lib/braintree/transaction_gateway.rb
@@ -89,7 +89,7 @@ def void(transaction_id)
def self._create_signature # :nodoc:
[
- :amount, :customer_id, :merchant_account_id, :order_id, :payment_method_token, :type,
+ :amount, :customer_id, :merchant_account_id, :order_id, :payment_method_token, :shipping_address_id, :type,
{:credit_card => [:token, :cardholder_name, :cvv, :expiration_date, :expiration_month, :expiration_year, :number]},
{:customer => [:id, :company, :email, :fax, :first_name, :last_name, :phone, :website]},
{
View
2  lib/braintree/version.rb
@@ -2,7 +2,7 @@ module Braintree
module Version
Major = 2
Minor = 6
- Tiny = 2
+ Tiny = 3
String = "#{Major}.#{Minor}.#{Tiny}"
end
View
23 spec/integration/braintree/transaction_spec.rb
@@ -904,6 +904,29 @@
transaction.vault_credit_card.token.should == payment_mehtod_token
end
+ it "can specify existing shipping address" do
+ customer = Braintree::Customer.create!(
+ :credit_card => {
+ :number => Braintree::Test::CreditCardNumbers::Visa,
+ :expiration_date => "05/2010"
+ }
+ )
+ address = Braintree::Address.create!(
+ :customer_id => customer.id,
+ :street_address => '123 Fake St.'
+ )
+ result = Braintree::Transaction.sale(
+ :amount => "100",
+ :customer_id => customer.id,
+ :shipping_address_id => address.id
+ )
+ result.success?.should == true
+ transaction = result.transaction
+ transaction.shipping_details.street_address.should == '123 Fake St.'
+ transaction.customer_details.id.should == customer.id
+ transaction.shipping_details.id.should == address.id
+ end
+
it "returns an error result if validations fail" do
params = {
:transaction => {
Please sign in to comment.
Something went wrong with that request. Please try again.