braintree 2.23.0 → 2.24.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -78,8 +78,9 @@ module Braintree
78
78
  billing_address_params = AddressGateway._shared_signature
79
79
  options = [:make_default, :verification_merchant_account_id, :verify_card, :venmo_sdk_session]
80
80
  signature = [
81
- :billing_address_id, :cardholder_name, :cvv, :expiration_date,
81
+ :billing_address_id, :cardholder_name, :cvv, :device_session_id, :expiration_date,
82
82
  :expiration_month, :expiration_year, :number, :token, :venmo_sdk_payment_method_code,
83
+ :device_data,
83
84
  {:options => options},
84
85
  {:billing_address => billing_address_params}
85
86
  ]
@@ -74,6 +74,7 @@ module Braintree
74
74
  credit_card_signature = CreditCardGateway._create_signature - [:customer_id]
75
75
  [
76
76
  :company, :email, :fax, :first_name, :id, :last_name, :phone, :website,
77
+ :device_data,
77
78
  {:credit_card => credit_card_signature},
78
79
  {:custom_fields => :_any_key_}
79
80
  ]
@@ -122,6 +123,7 @@ module Braintree
122
123
  credit_card_options[:options] << :update_existing_token
123
124
  [
124
125
  :company, :email, :fax, :first_name, :id, :last_name, :phone, :website,
126
+ :device_data,
125
127
  {:credit_card => credit_card_signature},
126
128
  {:custom_fields => :_any_key_}
127
129
  ]
@@ -100,7 +100,8 @@ module Braintree
100
100
  def self._create_signature # :nodoc:
101
101
  [
102
102
  :amount, :customer_id, :merchant_account_id, :order_id, :channel, :payment_method_token,
103
- :purchase_order_number, :recurring, :shipping_address_id, :type, :tax_amount, :tax_exempt, :venmo_sdk_payment_method_code,
103
+ :purchase_order_number, :recurring, :shipping_address_id, :type, :tax_amount, :tax_exempt,
104
+ :venmo_sdk_payment_method_code, :device_session_id, :device_data,
104
105
  {:credit_card => [:token, :cardholder_name, :cvv, :expiration_date, :expiration_month, :expiration_year, :number]},
105
106
  {:customer => [:id, :company, :email, :fax, :first_name, :last_name, :phone, :website]},
106
107
  {
@@ -1,7 +1,7 @@
1
1
  module Braintree
2
2
  module Version
3
3
  Major = 2
4
- Minor = 23
4
+ Minor = 24
5
5
  Tiny = 0
6
6
 
7
7
  String = "#{Major}.#{Minor}.#{Tiny}"
@@ -1 +1 @@
1
- 11041
1
+ 28977
@@ -27,6 +27,18 @@ describe Braintree::CreditCard do
27
27
  credit_card.image_url.should_not be_nil
28
28
  end
29
29
 
30
+ it "supports creation of cards with security params" do
31
+ customer = Braintree::Customer.create!
32
+ result = Braintree::CreditCard.create(
33
+ :customer_id => customer.id,
34
+ :number => Braintree::Test::CreditCardNumbers::Visa,
35
+ :expiration_date => "05/2009",
36
+ :cvv => "100",
37
+ :device_session_id => "abc123"
38
+ )
39
+ result.success?.should == true
40
+ end
41
+
30
42
  it "can provide expiration month and year separately" do
31
43
  customer = Braintree::Customer.create!
32
44
  result = Braintree::CreditCard.create(
@@ -53,6 +53,19 @@ describe Braintree::Customer do
53
53
  result.customer.updated_at.between?(Time.now - 10, Time.now).should == true
54
54
  end
55
55
 
56
+ it "supports creation with a device session ID" do
57
+ result = Braintree::Customer.create(
58
+ :credit_card => {
59
+ :number => Braintree::Test::CreditCardNumbers::MasterCard,
60
+ :expiration_date => "05/2010",
61
+ :cvv => "100",
62
+ :device_session_id => "abc123"
63
+ }
64
+ )
65
+
66
+ result.should be_success
67
+ end
68
+
56
69
  it "can create without any attributes" do
57
70
  result = Braintree::Customer.create
58
71
  result.success?.should == true
@@ -155,6 +155,20 @@ describe Braintree::Transaction do
155
155
  result.transaction.credit_card_details.customer_location.should == "US"
156
156
  end
157
157
 
158
+ it "accepts additional security parameters like device_session_id" do
159
+ result = Braintree::Transaction.create(
160
+ :type => "sale",
161
+ :amount => Braintree::Test::TransactionAmounts::Authorize,
162
+ :credit_card => {
163
+ :number => Braintree::Test::CreditCardNumbers::Visa,
164
+ :expiration_date => "05/2009"
165
+ },
166
+ :device_session_id => "abc123"
167
+ )
168
+
169
+ result.success?.should == true
170
+ end
171
+
158
172
  it "returns processor response code and text if declined" do
159
173
  result = Braintree::Transaction.create(
160
174
  :type => "sale",
@@ -15,12 +15,14 @@ describe Braintree::CreditCard do
15
15
  :billing_address_id,
16
16
  :cardholder_name,
17
17
  :cvv,
18
+ :device_session_id,
18
19
  :expiration_date,
19
20
  :expiration_month,
20
21
  :expiration_year,
21
22
  :number,
22
23
  :token,
23
24
  :venmo_sdk_payment_method_code,
25
+ :device_data,
24
26
  {:options => [:make_default, :verification_merchant_account_id, :verify_card, :venmo_sdk_session, :fail_on_duplicate_payment_method]},
25
27
  {:billing_address => [
26
28
  :company,
@@ -47,12 +49,14 @@ describe Braintree::CreditCard do
47
49
  :billing_address_id,
48
50
  :cardholder_name,
49
51
  :cvv,
52
+ :device_session_id,
50
53
  :expiration_date,
51
54
  :expiration_month,
52
55
  :expiration_year,
53
56
  :number,
54
57
  :token,
55
58
  :venmo_sdk_payment_method_code,
59
+ :device_data,
56
60
  {:options => [:make_default, :verification_merchant_account_id, :verify_card, :venmo_sdk_session]},
57
61
  {:billing_address => [
58
62
  :company,
@@ -81,16 +81,19 @@ describe Braintree::Customer do
81
81
  :last_name,
82
82
  :phone,
83
83
  :website,
84
+ :device_data,
84
85
  {:credit_card => [
85
86
  :billing_address_id,
86
87
  :cardholder_name,
87
88
  :cvv,
89
+ :device_session_id,
88
90
  :expiration_date,
89
91
  :expiration_month,
90
92
  :expiration_year,
91
93
  :number,
92
94
  :token,
93
95
  :venmo_sdk_payment_method_code,
96
+ :device_data,
94
97
  {:options => [:make_default, :verification_merchant_account_id, :verify_card, :venmo_sdk_session, :fail_on_duplicate_payment_method]},
95
98
  {:billing_address => [
96
99
  :company,
@@ -123,16 +126,19 @@ describe Braintree::Customer do
123
126
  :last_name,
124
127
  :phone,
125
128
  :website,
129
+ :device_data,
126
130
  {:credit_card => [
127
131
  :billing_address_id,
128
132
  :cardholder_name,
129
133
  :cvv,
134
+ :device_session_id,
130
135
  :expiration_date,
131
136
  :expiration_month,
132
137
  :expiration_year,
133
138
  :number,
134
139
  :token,
135
140
  :venmo_sdk_payment_method_code,
141
+ :device_data,
136
142
  {:options => [
137
143
  :make_default,
138
144
  :verification_merchant_account_id,
metadata CHANGED
@@ -1,209 +1,190 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: braintree
3
- version: !ruby/object:Gem::Version
4
- hash: 83
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.24.0
5
5
  prerelease:
6
- segments:
7
- - 2
8
- - 23
9
- - 0
10
- version: 2.23.0
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Braintree
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2013-05-01 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2013-07-18 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: builder
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 15
29
- segments:
30
- - 2
31
- - 0
32
- - 0
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
33
21
  version: 2.0.0
34
22
  type: :runtime
35
- version_requirements: *id001
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 2.0.0
36
30
  description: Ruby library for integrating with the Braintree Gateway
37
31
  email: code@getbraintree.com
38
32
  executables: []
39
-
40
33
  extensions: []
41
-
42
34
  extra_rdoc_files: []
43
-
44
- files:
35
+ files:
45
36
  - README.rdoc
46
37
  - LICENSE
47
38
  - lib/braintree.rb
48
- - lib/braintree/subscription_search.rb
49
- - lib/braintree/modification.rb
50
- - lib/braintree/errors.rb
51
- - lib/braintree/test/credit_card.rb
52
- - lib/braintree/test/transaction_amounts.rb
53
- - lib/braintree/test/venmo_sdk.rb
54
- - lib/braintree/webhook_testing.rb
39
+ - lib/braintree/validation_error.rb
55
40
  - lib/braintree/webhook_testing_gateway.rb
56
- - lib/braintree/advanced_search.rb
57
- - lib/braintree/version.rb
58
- - lib/braintree/add_on.rb
59
- - lib/braintree/address.rb
60
- - lib/braintree/digest.rb
61
- - lib/braintree/settlement_batch_summary.rb
62
- - lib/braintree/error_codes.rb
63
- - lib/braintree/discount.rb
41
+ - lib/braintree/transparent_redirect.rb
64
42
  - lib/braintree/webhook_notification.rb
65
- - lib/braintree/settlement_batch_summary_gateway.rb
66
43
  - lib/braintree/validation_error_collection.rb
44
+ - lib/braintree/transaction.rb
67
45
  - lib/braintree/credit_card_verification_gateway.rb
68
- - lib/braintree/credit_card.rb
69
- - lib/braintree/customer_search.rb
70
- - lib/braintree/util.rb
71
- - lib/braintree/transparent_redirect.rb
46
+ - lib/braintree/webhook_notification_gateway.rb
47
+ - lib/braintree/transaction_search.rb
48
+ - lib/braintree/transaction_gateway.rb
49
+ - lib/braintree/add_on.rb
50
+ - lib/braintree/resource_collection.rb
51
+ - lib/braintree/address_gateway.rb
52
+ - lib/braintree/successful_result.rb
53
+ - lib/braintree/plan.rb
54
+ - lib/braintree/subscription_search.rb
55
+ - lib/braintree/descriptor.rb
56
+ - lib/braintree/error_codes.rb
57
+ - lib/braintree/xml.rb
58
+ - lib/braintree/discount_gateway.rb
72
59
  - lib/braintree/xml/generator.rb
60
+ - lib/braintree/xml/parser.rb
73
61
  - lib/braintree/xml/rexml.rb
74
62
  - lib/braintree/xml/libxml.rb
75
- - lib/braintree/xml/parser.rb
76
- - lib/braintree/exceptions.rb
77
- - lib/braintree/validation_error.rb
78
- - lib/braintree/resource_collection.rb
79
- - lib/braintree/xml.rb
80
- - lib/braintree/credit_card_verification.rb
81
- - lib/braintree/configuration.rb
82
- - lib/braintree/transaction.rb
63
+ - lib/braintree/version.rb
64
+ - lib/braintree/address.rb
65
+ - lib/braintree/modification.rb
83
66
  - lib/braintree/http.rb
84
- - lib/braintree/address_gateway.rb
85
- - lib/braintree/subscription_gateway.rb
67
+ - lib/braintree/digest.rb
68
+ - lib/braintree/customer.rb
69
+ - lib/braintree/gateway.rb
70
+ - lib/braintree/base_module.rb
71
+ - lib/braintree/advanced_search.rb
72
+ - lib/braintree/settlement_batch_summary.rb
73
+ - lib/braintree/errors.rb
86
74
  - lib/braintree/customer_gateway.rb
87
- - lib/braintree/plan_gateway.rb
75
+ - lib/braintree/webhook_testing.rb
76
+ - lib/braintree/credit_card.rb
77
+ - lib/braintree/settlement_batch_summary_gateway.rb
78
+ - lib/braintree/customer_search.rb
79
+ - lib/braintree/address/country_names.rb
80
+ - lib/braintree/util.rb
81
+ - lib/braintree/subscription_gateway.rb
82
+ - lib/braintree/discount.rb
83
+ - lib/braintree/credit_card_verification.rb
84
+ - lib/braintree/credit_card_gateway.rb
88
85
  - lib/braintree/credit_card_verification_search.rb
89
- - lib/braintree/successful_result.rb
86
+ - lib/braintree/add_on_gateway.rb
90
87
  - lib/braintree/settlement_batch.rb
91
- - lib/braintree/plan.rb
92
- - lib/braintree/gateway.rb
93
88
  - lib/braintree/transparent_redirect_gateway.rb
94
- - lib/braintree/base_module.rb
95
- - lib/braintree/add_on_gateway.rb
89
+ - lib/braintree/test/venmo_sdk.rb
90
+ - lib/braintree/test/transaction_amounts.rb
91
+ - lib/braintree/test/credit_card.rb
92
+ - lib/braintree/subscription.rb
93
+ - lib/braintree/plan_gateway.rb
94
+ - lib/braintree/exceptions.rb
95
+ - lib/braintree/error_result.rb
96
+ - lib/braintree/configuration.rb
96
97
  - lib/braintree/transaction/subscription_details.rb
97
- - lib/braintree/transaction/disbursement_details.rb
98
+ - lib/braintree/transaction/address_details.rb
99
+ - lib/braintree/transaction/status_details.rb
98
100
  - lib/braintree/transaction/customer_details.rb
99
101
  - lib/braintree/transaction/credit_card_details.rb
100
- - lib/braintree/transaction/status_details.rb
101
- - lib/braintree/transaction/address_details.rb
102
- - lib/braintree/transaction_search.rb
103
- - lib/braintree/error_result.rb
104
- - lib/braintree/credit_card_gateway.rb
105
- - lib/braintree/descriptor.rb
106
- - lib/braintree/transaction_gateway.rb
107
- - lib/braintree/subscription.rb
108
- - lib/braintree/address/country_names.rb
109
- - lib/braintree/webhook_notification_gateway.rb
110
- - lib/braintree/customer.rb
111
- - lib/braintree/discount_gateway.rb
102
+ - lib/braintree/transaction/disbursement_details.rb
112
103
  - lib/ssl/www_braintreegateway_com.ca.crt
113
- - lib/ssl/sandbox_braintreegateway_com.ca.crt
114
104
  - lib/ssl/securetrust_ca.crt
115
- - spec/script/httpsd.rb
105
+ - lib/ssl/sandbox_braintreegateway_com.ca.crt
106
+ - spec/integration/spec_helper.rb
107
+ - spec/integration/braintree/error_codes_spec.rb
108
+ - spec/integration/braintree/transparent_redirect_spec.rb
109
+ - spec/integration/braintree/credit_card_verification_search_spec.rb
110
+ - spec/integration/braintree/advanced_search_spec.rb
111
+ - spec/integration/braintree/discount_spec.rb
112
+ - spec/integration/braintree/credit_card_spec.rb
113
+ - spec/integration/braintree/settlement_batch_summary_spec.rb
114
+ - spec/integration/braintree/address_spec.rb
115
+ - spec/integration/braintree/customer_search_spec.rb
116
+ - spec/integration/braintree/credit_card_verification_spec.rb
117
+ - spec/integration/braintree/plan_spec.rb
118
+ - spec/integration/braintree/http_spec.rb
119
+ - spec/integration/braintree/customer_spec.rb
120
+ - spec/integration/braintree/add_on_spec.rb
121
+ - spec/integration/braintree/transaction_spec.rb
122
+ - spec/integration/braintree/transaction_search_spec.rb
123
+ - spec/integration/braintree/subscription_spec.rb
124
+ - spec/integration/braintree/test/transaction_amounts_spec.rb
116
125
  - spec/spec_helper.rb
126
+ - spec/ssl/certificate.crt
127
+ - spec/ssl/geotrust_global.crt
128
+ - spec/ssl/privateKey.key
129
+ - spec/httpsd.pid
130
+ - spec/unit/braintree_spec.rb
117
131
  - spec/unit/spec_helper.rb
118
- - spec/unit/braintree/transaction_search_spec.rb
119
- - spec/unit/braintree/error_result_spec.rb
120
- - spec/unit/braintree/xml_spec.rb
121
- - spec/unit/braintree/customer_spec.rb
122
- - spec/unit/braintree/transaction_spec.rb
123
- - spec/unit/braintree/webhook_notification_spec.rb
124
- - spec/unit/braintree/http_spec.rb
125
- - spec/unit/braintree/subscription_spec.rb
132
+ - spec/unit/braintree/transparent_redirect_spec.rb
126
133
  - spec/unit/braintree/credit_card_verification_search_spec.rb
127
- - spec/unit/braintree/subscription_search_spec.rb
128
- - spec/unit/braintree/successful_result_spec.rb
134
+ - spec/unit/braintree/base_module_spec.rb
135
+ - spec/unit/braintree/credit_card_spec.rb
136
+ - spec/unit/braintree/xml_spec.rb
137
+ - spec/unit/braintree/address_spec.rb
138
+ - spec/unit/braintree/validation_error_collection_spec.rb
139
+ - spec/unit/braintree/util_spec.rb
140
+ - spec/unit/braintree/error_result_spec.rb
129
141
  - spec/unit/braintree/credit_card_verification_spec.rb
130
- - spec/unit/braintree/validation_error_spec.rb
131
- - spec/unit/braintree/resource_collection_spec.rb
132
- - spec/unit/braintree/xml/libxml_spec.rb
133
- - spec/unit/braintree/xml/parser_spec.rb
134
142
  - spec/unit/braintree/xml/rexml_spec.rb
143
+ - spec/unit/braintree/xml/parser_spec.rb
144
+ - spec/unit/braintree/xml/libxml_spec.rb
135
145
  - spec/unit/braintree/configuration_spec.rb
136
- - spec/unit/braintree/validation_error_collection_spec.rb
137
146
  - spec/unit/braintree/errors_spec.rb
147
+ - spec/unit/braintree/digest_spec.rb
148
+ - spec/unit/braintree/validation_error_spec.rb
149
+ - spec/unit/braintree/webhook_notification_spec.rb
150
+ - spec/unit/braintree/subscription_search_spec.rb
151
+ - spec/unit/braintree/http_spec.rb
152
+ - spec/unit/braintree/customer_spec.rb
138
153
  - spec/unit/braintree/modification_spec.rb
139
- - spec/unit/braintree/util_spec.rb
140
- - spec/unit/braintree/base_module_spec.rb
141
- - spec/unit/braintree/address_spec.rb
142
- - spec/unit/braintree/transparent_redirect_spec.rb
154
+ - spec/unit/braintree/transaction_spec.rb
155
+ - spec/unit/braintree/resource_collection_spec.rb
156
+ - spec/unit/braintree/successful_result_spec.rb
157
+ - spec/unit/braintree/transaction_search_spec.rb
158
+ - spec/unit/braintree/subscription_spec.rb
143
159
  - spec/unit/braintree/transaction/deposit_details_spec.rb
144
- - spec/unit/braintree/transaction/credit_card_details_spec.rb
145
160
  - spec/unit/braintree/transaction/customer_details_spec.rb
146
- - spec/unit/braintree/credit_card_spec.rb
147
- - spec/unit/braintree/digest_spec.rb
148
- - spec/unit/braintree_spec.rb
149
- - spec/hacks/tcp_socket.rb
150
- - spec/httpsd.pid
151
- - spec/integration/spec_helper.rb
152
- - spec/integration/braintree/settlement_batch_summary_spec.rb
153
- - spec/integration/braintree/transaction_search_spec.rb
154
- - spec/integration/braintree/test/transaction_amounts_spec.rb
155
- - spec/integration/braintree/customer_spec.rb
156
- - spec/integration/braintree/transaction_spec.rb
157
- - spec/integration/braintree/add_on_spec.rb
158
- - spec/integration/braintree/http_spec.rb
159
- - spec/integration/braintree/subscription_spec.rb
160
- - spec/integration/braintree/credit_card_verification_search_spec.rb
161
- - spec/integration/braintree/credit_card_verification_spec.rb
162
- - spec/integration/braintree/advanced_search_spec.rb
163
- - spec/integration/braintree/customer_search_spec.rb
164
- - spec/integration/braintree/plan_spec.rb
165
- - spec/integration/braintree/error_codes_spec.rb
166
- - spec/integration/braintree/address_spec.rb
167
- - spec/integration/braintree/transparent_redirect_spec.rb
168
- - spec/integration/braintree/credit_card_spec.rb
169
- - spec/integration/braintree/discount_spec.rb
161
+ - spec/unit/braintree/transaction/credit_card_details_spec.rb
170
162
  - spec/spec.opts
171
- - spec/ssl/geotrust_global.crt
172
- - spec/ssl/certificate.crt
173
- - spec/ssl/privateKey.key
163
+ - spec/hacks/tcp_socket.rb
164
+ - spec/script/httpsd.rb
174
165
  - braintree.gemspec
175
166
  homepage: http://www.braintreepayments.com/
176
167
  licenses: []
177
-
178
168
  post_install_message:
179
169
  rdoc_options: []
180
-
181
- require_paths:
170
+ require_paths:
182
171
  - lib
183
- required_ruby_version: !ruby/object:Gem::Requirement
172
+ required_ruby_version: !ruby/object:Gem::Requirement
184
173
  none: false
185
- requirements:
186
- - - ">="
187
- - !ruby/object:Gem::Version
188
- hash: 3
189
- segments:
190
- - 0
191
- version: "0"
192
- required_rubygems_version: !ruby/object:Gem::Requirement
174
+ requirements:
175
+ - - ! '>='
176
+ - !ruby/object:Gem::Version
177
+ version: '0'
178
+ required_rubygems_version: !ruby/object:Gem::Requirement
193
179
  none: false
194
- requirements:
195
- - - ">="
196
- - !ruby/object:Gem::Version
197
- hash: 3
198
- segments:
199
- - 0
200
- version: "0"
180
+ requirements:
181
+ - - ! '>='
182
+ - !ruby/object:Gem::Version
183
+ version: '0'
201
184
  requirements: []
202
-
203
185
  rubyforge_project: braintree
204
186
  rubygems_version: 1.8.25
205
187
  signing_key:
206
188
  specification_version: 3
207
189
  summary: Braintree Gateway Ruby Client Library
208
190
  test_files: []
209
-