Permalink
Browse files

2.22.0

  • Loading branch information...
1 parent 7439e3b commit 85dbf811d5ee9f4814c5afc91b18eb6d2b40dc93 @braintreeps braintreeps committed Dec 20, 2012
View
@@ -1,3 +1,6 @@
+== 2.22.0
+* Adds channel field to transactions.
+
== 2.21.0
* Add card type indicators to transactions and verifications
@@ -167,6 +167,7 @@ module Transaction
CannotRefundUnlessSettled = "91506"
CannotRefundWithSuspendedMerchantAccount = "91538"
CannotSubmitForSettlement = "91507"
+ ChannelIsTooLong = "91550"
CreditCardIsRequired = "91508"
CustomFieldIsInvalid = "91526"
CustomFieldIsTooLong = "81527"
@@ -52,6 +52,7 @@ module Type # :nodoc:
attr_reader :gateway_rejection_reason
attr_reader :merchant_account_id
attr_reader :order_id
+ attr_reader :channel
attr_reader :billing_details, :shipping_details
attr_reader :plan_id
# The authorization code from the processor.
@@ -94,12 +94,12 @@ def void(transaction_id)
end
def self._clone_signature # :nodoc:
- [:amount, {:options => [:submit_for_settlement]}]
+ [:amount, :channel, {:options => [:submit_for_settlement]}]
end
def self._create_signature # :nodoc:
[
- :amount, :customer_id, :merchant_account_id, :order_id, :payment_method_token,
+ :amount, :customer_id, :merchant_account_id, :order_id, :channel, :payment_method_token,
:purchase_order_number, :recurring, :shipping_address_id, :type, :tax_amount, :tax_exempt, :venmo_sdk_payment_method_code,
{:credit_card => [:token, :cardholder_name, :cvv, :expiration_date, :expiration_month, :expiration_year, :number]},
{:customer => [:id, :company, :email, :fax, :first_name, :last_name, :phone, :website]},
@@ -1,7 +1,7 @@
module Braintree
module Version
Major = 2
- Minor = 21
+ Minor = 22
Tiny = 0
String = "#{Major}.#{Minor}.#{Tiny}"
@@ -27,15 +27,21 @@
)
result.success?.should == true
- clone_result = Braintree::Transaction.clone_transaction(result.transaction.id, :amount => "112.44", :options => {
- :submit_for_settlement => false
- })
+ clone_result = Braintree::Transaction.clone_transaction(
+ result.transaction.id,
+ :amount => "112.44",
+ :channel => "MyShoppingCartProvider",
+ :options => {
+ :submit_for_settlement => false
+ }
+ )
clone_result.success?.should == true
transaction = clone_result.transaction
transaction.id.should_not == result.transaction.id
transaction.amount.should == BigDecimal.new("112.44")
+ transaction.channel.should == "MyShoppingCartProvider"
transaction.billing_details.country_name.should == "Botswana"
transaction.billing_details.country_code_alpha2.should == "BW"
@@ -471,6 +477,7 @@
},
:customer_id => "invalid",
:order_id => "too long" * 250,
+ :channel => "too long" * 250,
:payment_method_token => "too long and doesn't belong to customer" * 250
}
}
@@ -481,6 +488,7 @@
result.errors.for(:transaction).on(:amount)[0].code.should == Braintree::ErrorCodes::Transaction::AmountIsRequired
result.errors.for(:transaction).on(:customer_id)[0].code.should == Braintree::ErrorCodes::Transaction::CustomerIdIsInvalid
result.errors.for(:transaction).on(:order_id)[0].code.should == Braintree::ErrorCodes::Transaction::OrderIdIsTooLong
+ result.errors.for(:transaction).on(:channel)[0].code.should == Braintree::ErrorCodes::Transaction::ChannelIsTooLong
result.errors.for(:transaction).on(:payment_method_token)[0].code.should == Braintree::ErrorCodes::Transaction::PaymentMethodTokenIsInvalid
result.errors.for(:transaction).on(:type)[0].code.should == Braintree::ErrorCodes::Transaction::TypeIsInvalid
end
@@ -1008,6 +1016,7 @@
result = Braintree::Transaction.sale(
:amount => "100.00",
:order_id => "123",
+ :channel => "MyShoppingCartProvider",
:credit_card => {
:cardholder_name => "The Cardholder",
:number => "5105105105105100",
@@ -1054,6 +1063,7 @@
transaction.amount.should == BigDecimal.new("100.00")
transaction.currency_iso_code.should == "USD"
transaction.order_id.should == "123"
+ transaction.channel.should == "MyShoppingCartProvider"
transaction.processor_response_code.should == "1000"
transaction.created_at.between?(Time.now - 60, Time.now).should == true
transaction.updated_at.between?(Time.now - 60, Time.now).should == true
@@ -1586,6 +1596,7 @@
:transaction => {
:amount => "100.00",
:order_id => "123",
+ :channel => "MyShoppingCartProvider",
:type => "sale",
:credit_card => {
:cardholder_name => "The Cardholder",
@@ -1636,6 +1647,7 @@
transaction.status.should == Braintree::Transaction::Status::Authorized
transaction.amount.should == BigDecimal.new("100.00")
transaction.order_id.should == "123"
+ transaction.channel.should == "MyShoppingCartProvider"
transaction.processor_response_code.should == "1000"
transaction.created_at.between?(Time.now - 60, Time.now).should == true
transaction.updated_at.between?(Time.now - 60, Time.now).should == true

0 comments on commit 85dbf81

Please sign in to comment.