Skip to content

Commit

Permalink
2.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
braintreeps committed Jan 10, 2011
1 parent bd0c618 commit 0bd31cd
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rdoc
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,7 @@
== 2.6.3

* Allow passing of existing shipping_address_id on new transactions

== 2.6.2 == 2.6.2


* Added billing_address_id to allowed parameters for credit cards create and update * Added billing_address_id to allowed parameters for credit cards create and update
Expand Down
2 changes: 1 addition & 1 deletion lib/braintree/transaction_gateway.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def void(transaction_id)


def self._create_signature # :nodoc: 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]}, {:credit_card => [:token, :cardholder_name, :cvv, :expiration_date, :expiration_month, :expiration_year, :number]},
{:customer => [:id, :company, :email, :fax, :first_name, :last_name, :phone, :website]}, {:customer => [:id, :company, :email, :fax, :first_name, :last_name, :phone, :website]},
{ {
Expand Down
2 changes: 1 addition & 1 deletion lib/braintree/version.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Braintree
module Version module Version
Major = 2 Major = 2
Minor = 6 Minor = 6
Tiny = 2 Tiny = 3


String = "#{Major}.#{Minor}.#{Tiny}" String = "#{Major}.#{Minor}.#{Tiny}"
end end
Expand Down
23 changes: 23 additions & 0 deletions spec/integration/braintree/transaction_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -904,6 +904,29 @@
transaction.vault_credit_card.token.should == payment_mehtod_token transaction.vault_credit_card.token.should == payment_mehtod_token
end 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 it "returns an error result if validations fail" do
params = { params = {
:transaction => { :transaction => {
Expand Down

0 comments on commit 0bd31cd

Please sign in to comment.