braintree 2.21.0 → 2.22.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -167,6 +167,7 @@ module Braintree
167
167
  CannotRefundUnlessSettled = "91506"
168
168
  CannotRefundWithSuspendedMerchantAccount = "91538"
169
169
  CannotSubmitForSettlement = "91507"
170
+ ChannelIsTooLong = "91550"
170
171
  CreditCardIsRequired = "91508"
171
172
  CustomFieldIsInvalid = "91526"
172
173
  CustomFieldIsTooLong = "81527"
@@ -52,6 +52,7 @@ module Braintree
52
52
  attr_reader :gateway_rejection_reason
53
53
  attr_reader :merchant_account_id
54
54
  attr_reader :order_id
55
+ attr_reader :channel
55
56
  attr_reader :billing_details, :shipping_details
56
57
  attr_reader :plan_id
57
58
  # The authorization code from the processor.
@@ -94,12 +94,12 @@ module Braintree
94
94
  end
95
95
 
96
96
  def self._clone_signature # :nodoc:
97
- [:amount, {:options => [:submit_for_settlement]}]
97
+ [:amount, :channel, {:options => [:submit_for_settlement]}]
98
98
  end
99
99
 
100
100
  def self._create_signature # :nodoc:
101
101
  [
102
- :amount, :customer_id, :merchant_account_id, :order_id, :payment_method_token,
102
+ :amount, :customer_id, :merchant_account_id, :order_id, :channel, :payment_method_token,
103
103
  :purchase_order_number, :recurring, :shipping_address_id, :type, :tax_amount, :tax_exempt, :venmo_sdk_payment_method_code,
104
104
  {:credit_card => [:token, :cardholder_name, :cvv, :expiration_date, :expiration_month, :expiration_year, :number]},
105
105
  {:customer => [:id, :company, :email, :fax, :first_name, :last_name, :phone, :website]},
@@ -1,7 +1,7 @@
1
1
  module Braintree
2
2
  module Version
3
3
  Major = 2
4
- Minor = 21
4
+ Minor = 22
5
5
  Tiny = 0
6
6
 
7
7
  String = "#{Major}.#{Minor}.#{Tiny}"
@@ -1 +1 @@
1
- 44961
1
+ 95171
@@ -27,15 +27,21 @@ describe Braintree::Transaction do
27
27
  )
28
28
  result.success?.should == true
29
29
 
30
- clone_result = Braintree::Transaction.clone_transaction(result.transaction.id, :amount => "112.44", :options => {
31
- :submit_for_settlement => false
32
- })
30
+ clone_result = Braintree::Transaction.clone_transaction(
31
+ result.transaction.id,
32
+ :amount => "112.44",
33
+ :channel => "MyShoppingCartProvider",
34
+ :options => {
35
+ :submit_for_settlement => false
36
+ }
37
+ )
33
38
  clone_result.success?.should == true
34
39
 
35
40
  transaction = clone_result.transaction
36
41
 
37
42
  transaction.id.should_not == result.transaction.id
38
43
  transaction.amount.should == BigDecimal.new("112.44")
44
+ transaction.channel.should == "MyShoppingCartProvider"
39
45
 
40
46
  transaction.billing_details.country_name.should == "Botswana"
41
47
  transaction.billing_details.country_code_alpha2.should == "BW"
@@ -471,6 +477,7 @@ describe Braintree::Transaction do
471
477
  },
472
478
  :customer_id => "invalid",
473
479
  :order_id => "too long" * 250,
480
+ :channel => "too long" * 250,
474
481
  :payment_method_token => "too long and doesn't belong to customer" * 250
475
482
  }
476
483
  }
@@ -481,6 +488,7 @@ describe Braintree::Transaction do
481
488
  result.errors.for(:transaction).on(:amount)[0].code.should == Braintree::ErrorCodes::Transaction::AmountIsRequired
482
489
  result.errors.for(:transaction).on(:customer_id)[0].code.should == Braintree::ErrorCodes::Transaction::CustomerIdIsInvalid
483
490
  result.errors.for(:transaction).on(:order_id)[0].code.should == Braintree::ErrorCodes::Transaction::OrderIdIsTooLong
491
+ result.errors.for(:transaction).on(:channel)[0].code.should == Braintree::ErrorCodes::Transaction::ChannelIsTooLong
484
492
  result.errors.for(:transaction).on(:payment_method_token)[0].code.should == Braintree::ErrorCodes::Transaction::PaymentMethodTokenIsInvalid
485
493
  result.errors.for(:transaction).on(:type)[0].code.should == Braintree::ErrorCodes::Transaction::TypeIsInvalid
486
494
  end
@@ -1008,6 +1016,7 @@ describe Braintree::Transaction do
1008
1016
  result = Braintree::Transaction.sale(
1009
1017
  :amount => "100.00",
1010
1018
  :order_id => "123",
1019
+ :channel => "MyShoppingCartProvider",
1011
1020
  :credit_card => {
1012
1021
  :cardholder_name => "The Cardholder",
1013
1022
  :number => "5105105105105100",
@@ -1054,6 +1063,7 @@ describe Braintree::Transaction do
1054
1063
  transaction.amount.should == BigDecimal.new("100.00")
1055
1064
  transaction.currency_iso_code.should == "USD"
1056
1065
  transaction.order_id.should == "123"
1066
+ transaction.channel.should == "MyShoppingCartProvider"
1057
1067
  transaction.processor_response_code.should == "1000"
1058
1068
  transaction.created_at.between?(Time.now - 60, Time.now).should == true
1059
1069
  transaction.updated_at.between?(Time.now - 60, Time.now).should == true
@@ -1586,6 +1596,7 @@ describe Braintree::Transaction do
1586
1596
  :transaction => {
1587
1597
  :amount => "100.00",
1588
1598
  :order_id => "123",
1599
+ :channel => "MyShoppingCartProvider",
1589
1600
  :type => "sale",
1590
1601
  :credit_card => {
1591
1602
  :cardholder_name => "The Cardholder",
@@ -1636,6 +1647,7 @@ describe Braintree::Transaction do
1636
1647
  transaction.status.should == Braintree::Transaction::Status::Authorized
1637
1648
  transaction.amount.should == BigDecimal.new("100.00")
1638
1649
  transaction.order_id.should == "123"
1650
+ transaction.channel.should == "MyShoppingCartProvider"
1639
1651
  transaction.processor_response_code.should == "1000"
1640
1652
  transaction.created_at.between?(Time.now - 60, Time.now).should == true
1641
1653
  transaction.updated_at.between?(Time.now - 60, Time.now).should == true
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: braintree
3
3
  version: !ruby/object:Gem::Version
4
- hash: 91
4
+ hash: 87
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
- - 21
8
+ - 22
9
9
  - 0
10
- version: 2.21.0
10
+ version: 2.22.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Braintree
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-12-05 00:00:00 -06:00
18
+ date: 2012-12-20 00:00:00 -06:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency