braintree 2.25.0 → 2.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,6 +17,32 @@ describe Braintree::Configuration do
17
17
  Braintree::Configuration.endpoint = Braintree::Configuration::DEFAULT_ENDPOINT
18
18
  end
19
19
 
20
+ describe "initialize" do
21
+ it "accepts merchant credentials" do
22
+ config = Braintree::Configuration.new(
23
+ :merchant_id => 'merchant_id',
24
+ :public_key => 'public_key',
25
+ :private_key => 'private_key'
26
+ )
27
+
28
+ config.merchant_id.should == 'merchant_id'
29
+ config.public_key.should == 'public_key'
30
+ config.private_key.should == 'private_key'
31
+ end
32
+
33
+ it "accepts partner credentials" do
34
+ config = Braintree::Configuration.new(
35
+ :partner_id => 'partner_id',
36
+ :public_key => 'public_key',
37
+ :private_key => 'private_key'
38
+ )
39
+
40
+ config.merchant_id.should == 'partner_id'
41
+ config.public_key.should == 'public_key'
42
+ config.private_key.should == 'private_key'
43
+ end
44
+ end
45
+
20
46
  describe "base_merchant_path" do
21
47
  it "returns /merchants/{merchant_id}" do
22
48
  Braintree::Configuration.instantiate.base_merchant_path.should == "/merchants/integration_merchant_id"
@@ -32,12 +58,12 @@ describe Braintree::Configuration do
32
58
 
33
59
  it "returns the expected url for the sandbox env" do
34
60
  Braintree::Configuration.environment = :sandbox
35
- Braintree::Configuration.instantiate.base_merchant_url.should == "https://sandbox.braintreegateway.com:443/merchants/integration_merchant_id"
61
+ Braintree::Configuration.instantiate.base_merchant_url.should == "https://api.sandbox.braintreegateway.com:443/merchants/integration_merchant_id"
36
62
  end
37
63
 
38
64
  it "returns the expected url for the production env" do
39
65
  Braintree::Configuration.environment = :production
40
- Braintree::Configuration.instantiate.base_merchant_url.should == "https://www.braintreegateway.com:443/merchants/integration_merchant_id"
66
+ Braintree::Configuration.instantiate.base_merchant_url.should == "https://api.braintreegateway.com:443/merchants/integration_merchant_id"
41
67
  end
42
68
  end
43
69
 
@@ -45,21 +71,21 @@ describe Braintree::Configuration do
45
71
  it "qa" do
46
72
  Braintree::Configuration.environment = :qa
47
73
  ca_file = Braintree::Configuration.instantiate.ca_file
48
- ca_file.should match(/sandbox_braintreegateway_com.ca.crt$/)
74
+ ca_file.should match(/api_braintreegateway_com\.ca\.crt$/)
49
75
  File.exists?(ca_file).should == true
50
76
  end
51
77
 
52
78
  it "sandbox" do
53
79
  Braintree::Configuration.environment = :sandbox
54
80
  ca_file = Braintree::Configuration.instantiate.ca_file
55
- ca_file.should match(/sandbox_braintreegateway_com.ca.crt$/)
81
+ ca_file.should match(/api_braintreegateway_com\.ca\.crt$/)
56
82
  File.exists?(ca_file).should == true
57
83
  end
58
84
 
59
85
  it "production" do
60
86
  Braintree::Configuration.environment = :production
61
87
  ca_file = Braintree::Configuration.instantiate.ca_file
62
- ca_file.should match(/www_braintreegateway_com.ca.crt$/)
88
+ ca_file.should match(/api_braintreegateway_com\.ca\.crt$/)
63
89
  File.exists?(ca_file).should == true
64
90
  end
65
91
  end
@@ -187,14 +213,14 @@ describe Braintree::Configuration do
187
213
  Braintree::Configuration.instantiate.server.should == "localhost"
188
214
  end
189
215
 
190
- it "is www.braintreegateway.com for production" do
216
+ it "is api.braintreegateway.com for production" do
191
217
  Braintree::Configuration.environment = :production
192
- Braintree::Configuration.instantiate.server.should == "www.braintreegateway.com"
218
+ Braintree::Configuration.instantiate.server.should == "api.braintreegateway.com"
193
219
  end
194
220
 
195
- it "is sandbox.braintreegateway.com for sandbox" do
221
+ it "is api.sandbox.braintreegateway.com for sandbox" do
196
222
  Braintree::Configuration.environment = :sandbox
197
- Braintree::Configuration.instantiate.server.should == "sandbox.braintreegateway.com"
223
+ Braintree::Configuration.instantiate.server.should == "api.sandbox.braintreegateway.com"
198
224
  end
199
225
 
200
226
  it "is qa.braintreegateway.com for qa" do
@@ -23,6 +23,7 @@ describe Braintree::CreditCard do
23
23
  :token,
24
24
  :venmo_sdk_payment_method_code,
25
25
  :device_data,
26
+ :fraud_merchant_id,
26
27
  {:options => [:make_default, :verification_merchant_account_id, :verify_card, :venmo_sdk_session, :fail_on_duplicate_payment_method]},
27
28
  {:billing_address => [
28
29
  :company,
@@ -57,6 +58,7 @@ describe Braintree::CreditCard do
57
58
  :token,
58
59
  :venmo_sdk_payment_method_code,
59
60
  :device_data,
61
+ :fraud_merchant_id,
60
62
  {:options => [:make_default, :verification_merchant_account_id, :verify_card, :venmo_sdk_session]},
61
63
  {:billing_address => [
62
64
  :company,
@@ -94,6 +94,7 @@ describe Braintree::Customer do
94
94
  :token,
95
95
  :venmo_sdk_payment_method_code,
96
96
  :device_data,
97
+ :fraud_merchant_id,
97
98
  {:options => [:make_default, :verification_merchant_account_id, :verify_card, :venmo_sdk_session, :fail_on_duplicate_payment_method]},
98
99
  {:billing_address => [
99
100
  :company,
@@ -139,6 +140,7 @@ describe Braintree::Customer do
139
140
  :token,
140
141
  :venmo_sdk_payment_method_code,
141
142
  :device_data,
143
+ :fraud_merchant_id,
142
144
  {:options => [
143
145
  :make_default,
144
146
  :verification_merchant_account_id,
@@ -15,19 +15,46 @@ describe Braintree::WebhookNotification do
15
15
  notification.timestamp.should be_close(Time.now.utc, 10)
16
16
  end
17
17
 
18
- it "builds a sample notification for a partner user created webhook" do
18
+ it "builds a sample notification for a partner merchant connected webhook" do
19
19
  signature, payload = Braintree::WebhookTesting.sample_notification(
20
- Braintree::WebhookNotification::Kind::PartnerUserCreated,
20
+ Braintree::WebhookNotification::Kind::PartnerMerchantConnected,
21
21
  "my_id"
22
22
  )
23
23
 
24
24
  notification = Braintree::WebhookNotification.parse(signature, payload)
25
25
 
26
- notification.kind.should == Braintree::WebhookNotification::Kind::PartnerUserCreated
27
- notification.partner_credentials.merchant_public_id.should == "public_id"
28
- notification.partner_credentials.public_key.should == "public_key"
29
- notification.partner_credentials.private_key.should == "private_key"
30
- notification.partner_credentials.partner_user_id.should == "abc123"
26
+ notification.kind.should == Braintree::WebhookNotification::Kind::PartnerMerchantConnected
27
+ notification.partner_merchant.merchant_public_id.should == "public_id"
28
+ notification.partner_merchant.public_key.should == "public_key"
29
+ notification.partner_merchant.private_key.should == "private_key"
30
+ notification.partner_merchant.partner_merchant_id.should == "abc123"
31
+ notification.partner_merchant.client_side_encryption_key.should == "cse_key"
32
+ notification.timestamp.should be_close(Time.now.utc, 10)
33
+ end
34
+
35
+ it "builds a sample notification for a partner merchant disconnected webhook" do
36
+ signature, payload = Braintree::WebhookTesting.sample_notification(
37
+ Braintree::WebhookNotification::Kind::PartnerMerchantDisconnected,
38
+ "my_id"
39
+ )
40
+
41
+ notification = Braintree::WebhookNotification.parse(signature, payload)
42
+
43
+ notification.kind.should == Braintree::WebhookNotification::Kind::PartnerMerchantDisconnected
44
+ notification.partner_merchant.partner_merchant_id.should == "abc123"
45
+ notification.timestamp.should be_close(Time.now.utc, 10)
46
+ end
47
+
48
+ it "builds a sample notification for a partner merchant declined webhook" do
49
+ signature, payload = Braintree::WebhookTesting.sample_notification(
50
+ Braintree::WebhookNotification::Kind::PartnerMerchantDeclined,
51
+ "my_id"
52
+ )
53
+
54
+ notification = Braintree::WebhookNotification.parse(signature, payload)
55
+
56
+ notification.kind.should == Braintree::WebhookNotification::Kind::PartnerMerchantDeclined
57
+ notification.partner_merchant.partner_merchant_id.should == "abc123"
31
58
  notification.timestamp.should be_close(Time.now.utc, 10)
32
59
  end
33
60
 
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: braintree
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.25.0
5
- prerelease:
4
+ version: 2.26.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Braintree
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-08-13 00:00:00.000000000 Z
11
+ date: 2013-10-28 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: builder
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ! '>='
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ! '>='
28
25
  - !ruby/object:Gem::Version
@@ -36,160 +33,160 @@ files:
36
33
  - README.rdoc
37
34
  - LICENSE
38
35
  - lib/braintree.rb
39
- - lib/braintree/subscription_search.rb
40
- - lib/braintree/modification.rb
41
- - lib/braintree/errors.rb
42
- - lib/braintree/test/credit_card.rb
43
- - lib/braintree/test/transaction_amounts.rb
44
- - lib/braintree/test/merchant_account.rb
45
- - lib/braintree/test/venmo_sdk.rb
46
- - lib/braintree/webhook_testing.rb
36
+ - lib/braintree/validation_error.rb
47
37
  - lib/braintree/webhook_testing_gateway.rb
48
- - lib/braintree/advanced_search.rb
49
- - lib/braintree/version.rb
50
- - lib/braintree/add_on.rb
51
- - lib/braintree/address.rb
52
- - lib/braintree/digest.rb
53
- - lib/braintree/settlement_batch_summary.rb
54
- - lib/braintree/error_codes.rb
55
- - lib/braintree/discount.rb
38
+ - lib/braintree/transparent_redirect.rb
56
39
  - lib/braintree/webhook_notification.rb
57
- - lib/braintree/settlement_batch_summary_gateway.rb
58
40
  - lib/braintree/validation_error_collection.rb
41
+ - lib/braintree/transaction.rb
59
42
  - lib/braintree/credit_card_verification_gateway.rb
60
- - lib/braintree/credit_card.rb
61
- - lib/braintree/customer_search.rb
62
- - lib/braintree/util.rb
63
- - lib/braintree/transparent_redirect.rb
43
+ - lib/braintree/webhook_notification_gateway.rb
44
+ - lib/braintree/transaction_search.rb
45
+ - lib/braintree/transaction_gateway.rb
46
+ - lib/braintree/add_on.rb
47
+ - lib/braintree/resource_collection.rb
48
+ - lib/braintree/address_gateway.rb
49
+ - lib/braintree/successful_result.rb
50
+ - lib/braintree/plan.rb
51
+ - lib/braintree/subscription_search.rb
52
+ - lib/braintree/descriptor.rb
53
+ - lib/braintree/error_codes.rb
54
+ - lib/braintree/xml.rb
55
+ - lib/braintree/discount_gateway.rb
64
56
  - lib/braintree/xml/generator.rb
57
+ - lib/braintree/xml/parser.rb
65
58
  - lib/braintree/xml/rexml.rb
66
59
  - lib/braintree/xml/libxml.rb
67
- - lib/braintree/xml/parser.rb
68
- - lib/braintree/exceptions.rb
69
- - lib/braintree/validation_error.rb
70
- - lib/braintree/resource_collection.rb
71
- - lib/braintree/xml.rb
72
- - lib/braintree/credit_card_verification.rb
73
- - lib/braintree/configuration.rb
74
- - lib/braintree/transaction.rb
60
+ - lib/braintree/version.rb
61
+ - lib/braintree/address.rb
62
+ - lib/braintree/modification.rb
75
63
  - lib/braintree/http.rb
76
- - lib/braintree/address_gateway.rb
77
- - lib/braintree/subscription_gateway.rb
64
+ - lib/braintree/digest.rb
65
+ - lib/braintree/customer.rb
66
+ - lib/braintree/gateway.rb
67
+ - lib/braintree/base_module.rb
68
+ - lib/braintree/advanced_search.rb
69
+ - lib/braintree/settlement_batch_summary.rb
70
+ - lib/braintree/errors.rb
78
71
  - lib/braintree/customer_gateway.rb
79
- - lib/braintree/plan_gateway.rb
72
+ - lib/braintree/webhook_testing.rb
73
+ - lib/braintree/credit_card.rb
74
+ - lib/braintree/settlement_batch_summary_gateway.rb
75
+ - lib/braintree/customer_search.rb
76
+ - lib/braintree/address/country_names.rb
77
+ - lib/braintree/util.rb
78
+ - lib/braintree/subscription_gateway.rb
79
+ - lib/braintree/discount.rb
80
+ - lib/braintree/credit_card_verification.rb
81
+ - lib/braintree/credit_card_gateway.rb
80
82
  - lib/braintree/credit_card_verification_search.rb
81
- - lib/braintree/successful_result.rb
83
+ - lib/braintree/merchant_account_gateway.rb
84
+ - lib/braintree/add_on_gateway.rb
82
85
  - lib/braintree/settlement_batch.rb
83
- - lib/braintree/plan.rb
84
- - lib/braintree/gateway.rb
85
86
  - lib/braintree/transparent_redirect_gateway.rb
86
- - lib/braintree/base_module.rb
87
- - lib/braintree/add_on_gateway.rb
87
+ - lib/braintree/test/venmo_sdk.rb
88
+ - lib/braintree/test/transaction_amounts.rb
89
+ - lib/braintree/test/credit_card.rb
90
+ - lib/braintree/test/merchant_account.rb
91
+ - lib/braintree/merchant_account.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
88
97
  - lib/braintree/transaction/subscription_details.rb
89
- - lib/braintree/transaction/disbursement_details.rb
98
+ - lib/braintree/transaction/address_details.rb
99
+ - lib/braintree/transaction/status_details.rb
90
100
  - lib/braintree/transaction/customer_details.rb
91
101
  - lib/braintree/transaction/credit_card_details.rb
92
- - lib/braintree/transaction/status_details.rb
93
- - lib/braintree/transaction/address_details.rb
94
- - lib/braintree/transaction_search.rb
95
- - lib/braintree/error_result.rb
96
- - lib/braintree/credit_card_gateway.rb
97
- - lib/braintree/descriptor.rb
98
- - lib/braintree/transaction_gateway.rb
99
- - lib/braintree/subscription.rb
100
- - lib/braintree/merchant_account.rb
101
- - lib/braintree/address/country_names.rb
102
- - lib/braintree/webhook_notification_gateway.rb
103
- - lib/braintree/merchant_account_gateway.rb
104
- - lib/braintree/customer.rb
105
- - lib/braintree/discount_gateway.rb
102
+ - lib/braintree/transaction/disbursement_details.rb
106
103
  - lib/ssl/www_braintreegateway_com.ca.crt
107
- - lib/ssl/sandbox_braintreegateway_com.ca.crt
108
104
  - lib/ssl/securetrust_ca.crt
109
- - spec/script/httpsd.rb
105
+ - lib/ssl/api_braintreegateway_com.ca.crt
106
+ - lib/ssl/sandbox_braintreegateway_com.ca.crt
107
+ - spec/integration/spec_helper.rb
108
+ - spec/integration/braintree/error_codes_spec.rb
109
+ - spec/integration/braintree/transparent_redirect_spec.rb
110
+ - spec/integration/braintree/credit_card_verification_search_spec.rb
111
+ - spec/integration/braintree/advanced_search_spec.rb
112
+ - spec/integration/braintree/discount_spec.rb
113
+ - spec/integration/braintree/credit_card_spec.rb
114
+ - spec/integration/braintree/settlement_batch_summary_spec.rb
115
+ - spec/integration/braintree/address_spec.rb
116
+ - spec/integration/braintree/customer_search_spec.rb
117
+ - spec/integration/braintree/credit_card_verification_spec.rb
118
+ - spec/integration/braintree/plan_spec.rb
119
+ - spec/integration/braintree/http_spec.rb
120
+ - spec/integration/braintree/customer_spec.rb
121
+ - spec/integration/braintree/add_on_spec.rb
122
+ - spec/integration/braintree/transaction_spec.rb
123
+ - spec/integration/braintree/transaction_search_spec.rb
124
+ - spec/integration/braintree/subscription_spec.rb
125
+ - spec/integration/braintree/test/transaction_amounts_spec.rb
126
+ - spec/integration/braintree/merchant_account_spec.rb
110
127
  - spec/spec_helper.rb
128
+ - spec/ssl/certificate.crt
129
+ - spec/ssl/geotrust_global.crt
130
+ - spec/ssl/privateKey.key
131
+ - spec/httpsd.pid
132
+ - spec/unit/braintree_spec.rb
111
133
  - spec/unit/spec_helper.rb
112
- - spec/unit/braintree/transaction_search_spec.rb
113
- - spec/unit/braintree/error_result_spec.rb
114
- - spec/unit/braintree/xml_spec.rb
115
- - spec/unit/braintree/customer_spec.rb
116
- - spec/unit/braintree/transaction_spec.rb
117
- - spec/unit/braintree/webhook_notification_spec.rb
118
- - spec/unit/braintree/http_spec.rb
119
- - spec/unit/braintree/subscription_spec.rb
134
+ - spec/unit/braintree/transparent_redirect_spec.rb
120
135
  - spec/unit/braintree/credit_card_verification_search_spec.rb
121
- - spec/unit/braintree/subscription_search_spec.rb
122
- - spec/unit/braintree/successful_result_spec.rb
136
+ - spec/unit/braintree/base_module_spec.rb
137
+ - spec/unit/braintree/credit_card_spec.rb
138
+ - spec/unit/braintree/xml_spec.rb
139
+ - spec/unit/braintree/address_spec.rb
140
+ - spec/unit/braintree/validation_error_collection_spec.rb
141
+ - spec/unit/braintree/util_spec.rb
142
+ - spec/unit/braintree/error_result_spec.rb
123
143
  - spec/unit/braintree/credit_card_verification_spec.rb
124
- - spec/unit/braintree/validation_error_spec.rb
125
- - spec/unit/braintree/resource_collection_spec.rb
126
- - spec/unit/braintree/xml/libxml_spec.rb
127
- - spec/unit/braintree/xml/parser_spec.rb
128
144
  - spec/unit/braintree/xml/rexml_spec.rb
145
+ - spec/unit/braintree/xml/parser_spec.rb
146
+ - spec/unit/braintree/xml/libxml_spec.rb
129
147
  - spec/unit/braintree/configuration_spec.rb
130
- - spec/unit/braintree/validation_error_collection_spec.rb
131
- - spec/unit/braintree/merchant_account_spec.rb
132
148
  - spec/unit/braintree/errors_spec.rb
149
+ - spec/unit/braintree/digest_spec.rb
150
+ - spec/unit/braintree/validation_error_spec.rb
151
+ - spec/unit/braintree/webhook_notification_spec.rb
152
+ - spec/unit/braintree/subscription_search_spec.rb
153
+ - spec/unit/braintree/http_spec.rb
154
+ - spec/unit/braintree/customer_spec.rb
133
155
  - spec/unit/braintree/modification_spec.rb
134
- - spec/unit/braintree/util_spec.rb
135
- - spec/unit/braintree/base_module_spec.rb
136
- - spec/unit/braintree/address_spec.rb
137
- - spec/unit/braintree/transparent_redirect_spec.rb
156
+ - spec/unit/braintree/transaction_spec.rb
157
+ - spec/unit/braintree/resource_collection_spec.rb
158
+ - spec/unit/braintree/successful_result_spec.rb
159
+ - spec/unit/braintree/transaction_search_spec.rb
160
+ - spec/unit/braintree/subscription_spec.rb
161
+ - spec/unit/braintree/merchant_account_spec.rb
138
162
  - spec/unit/braintree/transaction/deposit_details_spec.rb
139
- - spec/unit/braintree/transaction/credit_card_details_spec.rb
140
163
  - spec/unit/braintree/transaction/customer_details_spec.rb
141
- - spec/unit/braintree/credit_card_spec.rb
142
- - spec/unit/braintree/digest_spec.rb
143
- - spec/unit/braintree_spec.rb
144
- - spec/hacks/tcp_socket.rb
145
- - spec/httpsd.pid
146
- - spec/integration/spec_helper.rb
147
- - spec/integration/braintree/settlement_batch_summary_spec.rb
148
- - spec/integration/braintree/transaction_search_spec.rb
149
- - spec/integration/braintree/test/transaction_amounts_spec.rb
150
- - spec/integration/braintree/customer_spec.rb
151
- - spec/integration/braintree/transaction_spec.rb
152
- - spec/integration/braintree/add_on_spec.rb
153
- - spec/integration/braintree/http_spec.rb
154
- - spec/integration/braintree/subscription_spec.rb
155
- - spec/integration/braintree/credit_card_verification_search_spec.rb
156
- - spec/integration/braintree/credit_card_verification_spec.rb
157
- - spec/integration/braintree/advanced_search_spec.rb
158
- - spec/integration/braintree/customer_search_spec.rb
159
- - spec/integration/braintree/merchant_account_spec.rb
160
- - spec/integration/braintree/plan_spec.rb
161
- - spec/integration/braintree/error_codes_spec.rb
162
- - spec/integration/braintree/address_spec.rb
163
- - spec/integration/braintree/transparent_redirect_spec.rb
164
- - spec/integration/braintree/credit_card_spec.rb
165
- - spec/integration/braintree/discount_spec.rb
164
+ - spec/unit/braintree/transaction/credit_card_details_spec.rb
166
165
  - spec/spec.opts
167
- - spec/ssl/geotrust_global.crt
168
- - spec/ssl/certificate.crt
169
- - spec/ssl/privateKey.key
166
+ - spec/hacks/tcp_socket.rb
167
+ - spec/script/httpsd.rb
170
168
  - braintree.gemspec
171
169
  homepage: http://www.braintreepayments.com/
172
170
  licenses: []
171
+ metadata: {}
173
172
  post_install_message:
174
173
  rdoc_options: []
175
174
  require_paths:
176
175
  - lib
177
176
  required_ruby_version: !ruby/object:Gem::Requirement
178
- none: false
179
177
  requirements:
180
178
  - - ! '>='
181
179
  - !ruby/object:Gem::Version
182
180
  version: '0'
183
181
  required_rubygems_version: !ruby/object:Gem::Requirement
184
- none: false
185
182
  requirements:
186
183
  - - ! '>='
187
184
  - !ruby/object:Gem::Version
188
185
  version: '0'
189
186
  requirements: []
190
187
  rubyforge_project: braintree
191
- rubygems_version: 1.8.25
188
+ rubygems_version: 2.0.6
192
189
  signing_key:
193
- specification_version: 3
190
+ specification_version: 4
194
191
  summary: Braintree Gateway Ruby Client Library
195
192
  test_files: []