braintree 3.3.0 → 3.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/braintree.gemspec +1 -1
- data/lib/braintree.rb +2 -1
- data/lib/braintree/account_updater_daily_report.rb +1 -1
- data/lib/braintree/address.rb +1 -1
- data/lib/braintree/apple_pay.rb +1 -1
- data/lib/braintree/apple_pay_card.rb +1 -1
- data/lib/braintree/apple_pay_options.rb +1 -1
- data/lib/braintree/authorization_adjustment.rb +1 -1
- data/lib/braintree/client_token.rb +1 -1
- data/lib/braintree/configuration.rb +11 -11
- data/lib/braintree/connected_merchant_paypal_status_changed.rb +1 -1
- data/lib/braintree/connected_merchant_status_transitioned.rb +1 -1
- data/lib/braintree/credit_card.rb +2 -2
- data/lib/braintree/credit_card_gateway.rb +3 -3
- data/lib/braintree/credit_card_verification.rb +5 -5
- data/lib/braintree/credit_card_verification_search.rb +1 -1
- data/lib/braintree/customer.rb +2 -2
- data/lib/braintree/customer_search.rb +1 -1
- data/lib/braintree/disbursement.rb +1 -1
- data/lib/braintree/dispute.rb +1 -1
- data/lib/braintree/dispute_gateway.rb +2 -2
- data/lib/braintree/dispute_search.rb +2 -2
- data/lib/braintree/document_upload.rb +1 -1
- data/lib/braintree/error_codes.rb +7 -0
- data/lib/braintree/google_pay_card.rb +1 -1
- data/lib/braintree/granted_payment_instrument_update.rb +1 -1
- data/lib/braintree/graphql_client.rb +7 -7
- data/lib/braintree/http.rb +3 -3
- data/lib/braintree/local_payment_completed.rb +1 -1
- data/lib/braintree/local_payment_reversed.rb +19 -0
- data/lib/braintree/merchant.rb +1 -1
- data/lib/braintree/merchant_account.rb +1 -1
- data/lib/braintree/merchant_account_gateway.rb +1 -1
- data/lib/braintree/merchant_gateway.rb +1 -1
- data/lib/braintree/modification.rb +1 -1
- data/lib/braintree/oauth_credentials.rb +1 -1
- data/lib/braintree/oauth_gateway.rb +5 -5
- data/lib/braintree/payment_instrument_type.rb +10 -10
- data/lib/braintree/payment_method_gateway.rb +3 -3
- data/lib/braintree/payment_method_nonce_gateway.rb +1 -1
- data/lib/braintree/plan.rb +1 -1
- data/lib/braintree/processor_response_types.rb +3 -3
- data/lib/braintree/revoked_payment_method_metadata.rb +1 -1
- data/lib/braintree/samsung_pay_card.rb +1 -1
- data/lib/braintree/settlement_batch_summary.rb +2 -2
- data/lib/braintree/subscription.rb +6 -6
- data/lib/braintree/transaction.rb +32 -24
- data/lib/braintree/transaction_gateway.rb +23 -4
- data/lib/braintree/transaction_line_item.rb +1 -1
- data/lib/braintree/transaction_search.rb +3 -1
- data/lib/braintree/unknown_payment_method.rb +1 -1
- data/lib/braintree/us_bank_account.rb +3 -3
- data/lib/braintree/us_bank_account_verification.rb +1 -1
- data/lib/braintree/us_bank_account_verification_gateway.rb +1 -1
- data/lib/braintree/util.rb +4 -4
- data/lib/braintree/venmo_account.rb +1 -1
- data/lib/braintree/version.rb +1 -1
- data/lib/braintree/visa_checkout_card.rb +2 -2
- data/lib/braintree/webhook_notification.rb +28 -19
- data/lib/braintree/webhook_notification_gateway.rb +5 -5
- data/lib/braintree/webhook_testing_gateway.rb +10 -0
- data/lib/braintree/xml/generator.rb +5 -4
- data/lib/braintree/xml/libxml.rb +1 -1
- data/lib/braintree/xml/parser.rb +10 -10
- data/spec/integration/braintree/add_on_spec.rb +1 -1
- data/spec/integration/braintree/address_spec.rb +24 -24
- data/spec/integration/braintree/advanced_search_spec.rb +45 -45
- data/spec/integration/braintree/apple_pay_spec.rb +3 -3
- data/spec/integration/braintree/braintree_gateway_spec.rb +2 -1
- data/spec/integration/braintree/client_api/client_token_spec.rb +14 -14
- data/spec/integration/braintree/client_api/spec_helper.rb +5 -5
- data/spec/integration/braintree/credit_card_spec.rb +119 -119
- data/spec/integration/braintree/credit_card_verification_search_spec.rb +2 -2
- data/spec/integration/braintree/credit_card_verification_spec.rb +1 -1
- data/spec/integration/braintree/customer_search_spec.rb +8 -8
- data/spec/integration/braintree/customer_spec.rb +165 -165
- data/spec/integration/braintree/dispute_search_spec.rb +3 -3
- data/spec/integration/braintree/dispute_spec.rb +6 -6
- data/spec/integration/braintree/error_codes_spec.rb +1 -1
- data/spec/integration/braintree/http_spec.rb +2 -2
- data/spec/integration/braintree/merchant_account_spec.rb +25 -26
- data/spec/integration/braintree/merchant_spec.rb +12 -12
- data/spec/integration/braintree/oauth_spec.rb +11 -11
- data/spec/integration/braintree/payment_method_nonce_spec.rb +12 -12
- data/spec/integration/braintree/payment_method_spec.rb +165 -165
- data/spec/integration/braintree/payment_method_us_bank_account_spec.rb +9 -9
- data/spec/integration/braintree/paypal_account_spec.rb +28 -28
- data/spec/integration/braintree/samsung_pay_card_spec.rb +9 -9
- data/spec/integration/braintree/settlement_batch_summary_spec.rb +8 -8
- data/spec/integration/braintree/subscription_spec.rb +133 -133
- data/spec/integration/braintree/test/transaction_amounts_spec.rb +2 -2
- data/spec/integration/braintree/test_transaction_spec.rb +10 -10
- data/spec/integration/braintree/transaction_search_spec.rb +93 -67
- data/spec/integration/braintree/transaction_spec.rb +498 -344
- data/spec/integration/braintree/transaction_us_bank_account_spec.rb +20 -20
- data/spec/integration/braintree/us_bank_account_spec.rb +6 -6
- data/spec/integration/braintree/us_bank_account_verification_search_spec.rb +7 -7
- data/spec/integration/braintree/us_bank_account_verification_spec.rb +8 -8
- data/spec/integration/braintree/visa_checkout_card_spec.rb +5 -5
- data/spec/integration/spec_helper.rb +2 -2
- data/spec/oauth_test_helper.rb +1 -1
- data/spec/script/httpsd.rb +6 -6
- data/spec/spec_helper.rb +4 -3
- data/spec/unit/braintree/address_spec.rb +1 -1
- data/spec/unit/braintree/apple_pay_card_spec.rb +1 -1
- data/spec/unit/braintree/client_token_spec.rb +2 -2
- data/spec/unit/braintree/configuration_spec.rb +42 -42
- data/spec/unit/braintree/credit_card_spec.rb +7 -7
- data/spec/unit/braintree/credit_card_verification_search_spec.rb +1 -1
- data/spec/unit/braintree/credit_card_verification_spec.rb +2 -2
- data/spec/unit/braintree/customer_spec.rb +3 -3
- data/spec/unit/braintree/disbursement_spec.rb +7 -7
- data/spec/unit/braintree/dispute_spec.rb +8 -8
- data/spec/unit/braintree/error_result_spec.rb +5 -5
- data/spec/unit/braintree/errors_spec.rb +8 -8
- data/spec/unit/braintree/http_spec.rb +5 -5
- data/spec/unit/braintree/merchant_account_spec.rb +1 -1
- data/spec/unit/braintree/payment_method_spec.rb +1 -1
- data/spec/unit/braintree/paypal_account_spec.rb +2 -2
- data/spec/unit/braintree/resource_collection_spec.rb +9 -9
- data/spec/unit/braintree/subscription_search_spec.rb +1 -1
- data/spec/unit/braintree/successful_result_spec.rb +1 -1
- data/spec/unit/braintree/three_d_secure_info_spec.rb +1 -1
- data/spec/unit/braintree/transaction/credit_card_details_spec.rb +3 -3
- data/spec/unit/braintree/transaction/customer_details_spec.rb +1 -1
- data/spec/unit/braintree/transaction/deposit_details_spec.rb +2 -2
- data/spec/unit/braintree/transaction/paypal_details_spec.rb +1 -1
- data/spec/unit/braintree/transaction_search_spec.rb +12 -12
- data/spec/unit/braintree/transaction_spec.rb +25 -17
- data/spec/unit/braintree/util_spec.rb +18 -18
- data/spec/unit/braintree/validation_error_collection_spec.rb +36 -36
- data/spec/unit/braintree/webhook_notification_spec.rb +72 -56
- data/spec/unit/braintree/xml_spec.rb +31 -31
- metadata +3 -3
- data/lib/braintree/settlement_batch.rb +0 -0
@@ -18,16 +18,16 @@ describe Braintree::Dispute, "search" do
|
|
18
18
|
|
19
19
|
let(:transaction) do
|
20
20
|
result = Braintree::Transaction.sale(
|
21
|
-
:amount =>
|
21
|
+
:amount => "10.00",
|
22
22
|
:credit_card => {
|
23
|
-
:expiration_date =>
|
23
|
+
:expiration_date => "01/2020",
|
24
24
|
:number => Braintree::Test::CreditCardNumbers::Disputes::Chargeback,
|
25
25
|
},
|
26
26
|
:customer_id => customer.id,
|
27
27
|
:merchant_account_id => "14LaddersLLC_instant",
|
28
28
|
:options => {
|
29
29
|
:submit_for_settlement => true,
|
30
|
-
}
|
30
|
+
},
|
31
31
|
)
|
32
32
|
|
33
33
|
result.transaction
|
@@ -11,14 +11,14 @@ describe Braintree::Dispute do
|
|
11
11
|
|
12
12
|
let(:transaction) do
|
13
13
|
result = Braintree::Transaction.sale(
|
14
|
-
:amount =>
|
14
|
+
:amount => "10.00",
|
15
15
|
:credit_card => {
|
16
|
-
:expiration_date =>
|
16
|
+
:expiration_date => "01/2020",
|
17
17
|
:number => Braintree::Test::CreditCardNumbers::Disputes::Chargeback
|
18
18
|
},
|
19
19
|
:options => {
|
20
20
|
:submit_for_settlement => true
|
21
|
-
}
|
21
|
+
},
|
22
22
|
)
|
23
23
|
|
24
24
|
result.transaction
|
@@ -50,7 +50,7 @@ describe Braintree::Dispute do
|
|
50
50
|
it "raises a NotFound exception if the dispute cannot be found" do
|
51
51
|
expect do
|
52
52
|
Braintree::Dispute.accept("invalid-id")
|
53
|
-
end.to raise_error(Braintree::NotFoundError,
|
53
|
+
end.to raise_error(Braintree::NotFoundError, "dispute with id invalid-id not found")
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
@@ -141,7 +141,7 @@ describe Braintree::Dispute do
|
|
141
141
|
end
|
142
142
|
|
143
143
|
it "creates text evidence for the dispute with optional parameters" do
|
144
|
-
result = Braintree::Dispute.add_text_evidence(dispute.id, {
|
144
|
+
result = Braintree::Dispute.add_text_evidence(dispute.id, {content: "123456789", category: "REFUND_ID", sequence_number: 7})
|
145
145
|
|
146
146
|
result.success?.should == true
|
147
147
|
result.evidence.category.should == "REFUND_ID"
|
@@ -174,7 +174,7 @@ describe Braintree::Dispute do
|
|
174
174
|
it "raises a NotFound exception if the dispute cannot be found" do
|
175
175
|
expect do
|
176
176
|
Braintree::Dispute.finalize("invalid-id")
|
177
|
-
end.to raise_error(Braintree::NotFoundError,
|
177
|
+
end.to raise_error(Braintree::NotFoundError, "dispute with id invalid-id not found")
|
178
178
|
end
|
179
179
|
end
|
180
180
|
|
@@ -54,7 +54,7 @@ describe Braintree::Http do
|
|
54
54
|
:customer_id => customer.id,
|
55
55
|
:cardholder_name => "Sam Jones",
|
56
56
|
:number => Braintree::Test::CreditCardNumbers::Visa,
|
57
|
-
:expiration_date => "05/2009"
|
57
|
+
:expiration_date => "05/2009",
|
58
58
|
)
|
59
59
|
result.success?.should == true
|
60
60
|
utc_or_gmt = Time.now.utc.strftime("%Z")
|
@@ -156,7 +156,7 @@ describe Braintree::Http do
|
|
156
156
|
# Random CA root file from a different certificate authority
|
157
157
|
config = Braintree::Configuration.instantiate
|
158
158
|
config.stub(:ca_file).and_return(
|
159
|
-
File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "ssl", "geotrust_global.crt"))
|
159
|
+
File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "ssl", "geotrust_global.crt")),
|
160
160
|
)
|
161
161
|
config.stub(:ssl?).and_return(true)
|
162
162
|
config.stub(:port).and_return(SSL_TEST_PORT)
|
@@ -65,7 +65,7 @@ describe Braintree::MerchantAccount do
|
|
65
65
|
gateway = Braintree::Gateway.new(
|
66
66
|
:client_id => "client_id$#{Braintree::Configuration.environment}$integration_client_id",
|
67
67
|
:client_secret => "client_secret$#{Braintree::Configuration.environment}$integration_client_secret",
|
68
|
-
:logger => Logger.new("/dev/null")
|
68
|
+
:logger => Logger.new("/dev/null"),
|
69
69
|
)
|
70
70
|
|
71
71
|
code = Braintree::OAuthTestHelper.create_grant(gateway, {
|
@@ -75,12 +75,12 @@ describe Braintree::MerchantAccount do
|
|
75
75
|
|
76
76
|
result = gateway.oauth.create_token_from_code(
|
77
77
|
:code => code,
|
78
|
-
:scope => "read_write"
|
78
|
+
:scope => "read_write",
|
79
79
|
)
|
80
80
|
|
81
81
|
gateway = Braintree::Gateway.new(
|
82
82
|
:access_token => result.credentials.access_token,
|
83
|
-
:logger => Logger.new("/dev/null")
|
83
|
+
:logger => Logger.new("/dev/null"),
|
84
84
|
)
|
85
85
|
|
86
86
|
result = gateway.merchant_account.all
|
@@ -92,18 +92,18 @@ describe Braintree::MerchantAccount do
|
|
92
92
|
gateway = Braintree::Gateway.new(
|
93
93
|
:client_id => "client_id$#{Braintree::Configuration.environment}$integration_client_id",
|
94
94
|
:client_secret => "client_secret$#{Braintree::Configuration.environment}$integration_client_secret",
|
95
|
-
:logger => Logger.new("/dev/null")
|
95
|
+
:logger => Logger.new("/dev/null"),
|
96
96
|
)
|
97
97
|
|
98
98
|
result = gateway.merchant.create(
|
99
99
|
:email => "name@email.com",
|
100
100
|
:country_code_alpha3 => "USA",
|
101
|
-
:payment_methods => ["credit_card", "paypal"]
|
101
|
+
:payment_methods => ["credit_card", "paypal"],
|
102
102
|
)
|
103
103
|
|
104
104
|
gateway = Braintree::Gateway.new(
|
105
105
|
:access_token => result.credentials.access_token,
|
106
|
-
:logger => Logger.new("/dev/null")
|
106
|
+
:logger => Logger.new("/dev/null"),
|
107
107
|
)
|
108
108
|
|
109
109
|
result = gateway.merchant_account.all
|
@@ -118,7 +118,7 @@ describe Braintree::MerchantAccount do
|
|
118
118
|
gateway = Braintree::Gateway.new(
|
119
119
|
:client_id => "client_id$#{Braintree::Configuration.environment}$integration_client_id",
|
120
120
|
:client_secret => "client_secret$#{Braintree::Configuration.environment}$integration_client_secret",
|
121
|
-
:logger => Logger.new("/dev/null")
|
121
|
+
:logger => Logger.new("/dev/null"),
|
122
122
|
)
|
123
123
|
|
124
124
|
code = Braintree::OAuthTestHelper.create_grant(gateway, {
|
@@ -128,12 +128,12 @@ describe Braintree::MerchantAccount do
|
|
128
128
|
|
129
129
|
result = gateway.oauth.create_token_from_code(
|
130
130
|
:code => code,
|
131
|
-
:scope => "read_only"
|
131
|
+
:scope => "read_only",
|
132
132
|
)
|
133
133
|
|
134
134
|
gateway = Braintree::Gateway.new(
|
135
135
|
:access_token => result.credentials.access_token,
|
136
|
-
:logger => Logger.new("/dev/null")
|
136
|
+
:logger => Logger.new("/dev/null"),
|
137
137
|
)
|
138
138
|
|
139
139
|
result = gateway.merchant_account.all
|
@@ -164,8 +164,8 @@ describe Braintree::MerchantAccount do
|
|
164
164
|
sub_merchant_account_id = "sub_merchant_account_id#{random_number}"
|
165
165
|
result = Braintree::MerchantAccount.create(
|
166
166
|
VALID_APPLICATION_PARAMS.merge(
|
167
|
-
:id => sub_merchant_account_id
|
168
|
-
)
|
167
|
+
:id => sub_merchant_account_id,
|
168
|
+
),
|
169
169
|
)
|
170
170
|
|
171
171
|
result.should be_success
|
@@ -182,7 +182,7 @@ describe Braintree::MerchantAccount do
|
|
182
182
|
|
183
183
|
it "requires all fields" do
|
184
184
|
result = Braintree::MerchantAccount.create(
|
185
|
-
:master_merchant_account_id => "sandbox_master_merchant_account"
|
185
|
+
:master_merchant_account_id => "sandbox_master_merchant_account",
|
186
186
|
)
|
187
187
|
result.should_not be_success
|
188
188
|
result.errors.for(:merchant_account).on(:tos_accepted).first.code.should == Braintree::ErrorCodes::MerchantAccount::TosAcceptedIsRequired
|
@@ -233,11 +233,11 @@ describe Braintree::MerchantAccount do
|
|
233
233
|
|
234
234
|
gateway = Braintree::Gateway.new(
|
235
235
|
:access_token => result.credentials.access_token,
|
236
|
-
:logger => Logger.new("/dev/null")
|
236
|
+
:logger => Logger.new("/dev/null"),
|
237
237
|
)
|
238
238
|
|
239
239
|
result = gateway.merchant_account.create_for_currency(
|
240
|
-
:currency => "JPY"
|
240
|
+
:currency => "JPY",
|
241
241
|
)
|
242
242
|
result.should be_success
|
243
243
|
result.merchant_account.currency_iso_code.should == "JPY"
|
@@ -249,16 +249,16 @@ describe Braintree::MerchantAccount do
|
|
249
249
|
|
250
250
|
gateway = Braintree::Gateway.new(
|
251
251
|
:access_token => result.credentials.access_token,
|
252
|
-
:logger => Logger.new("/dev/null")
|
252
|
+
:logger => Logger.new("/dev/null"),
|
253
253
|
)
|
254
254
|
|
255
255
|
result = gateway.merchant_account.create_for_currency(
|
256
|
-
:currency => "USD"
|
256
|
+
:currency => "USD",
|
257
257
|
)
|
258
258
|
result.should be_success
|
259
259
|
|
260
260
|
result = gateway.merchant_account.create_for_currency(
|
261
|
-
:currency => "USD"
|
261
|
+
:currency => "USD",
|
262
262
|
)
|
263
263
|
result.should_not be_success
|
264
264
|
|
@@ -272,11 +272,11 @@ describe Braintree::MerchantAccount do
|
|
272
272
|
|
273
273
|
gateway = Braintree::Gateway.new(
|
274
274
|
:access_token => result.credentials.access_token,
|
275
|
-
:logger => Logger.new("/dev/null")
|
275
|
+
:logger => Logger.new("/dev/null"),
|
276
276
|
)
|
277
277
|
|
278
278
|
result = gateway.merchant_account.create_for_currency(
|
279
|
-
:currency => nil
|
279
|
+
:currency => nil,
|
280
280
|
)
|
281
281
|
result.should_not be_success
|
282
282
|
|
@@ -296,11 +296,11 @@ describe Braintree::MerchantAccount do
|
|
296
296
|
|
297
297
|
gateway = Braintree::Gateway.new(
|
298
298
|
:access_token => result.credentials.access_token,
|
299
|
-
:logger => Logger.new("/dev/null")
|
299
|
+
:logger => Logger.new("/dev/null"),
|
300
300
|
)
|
301
301
|
|
302
302
|
result = gateway.merchant_account.create_for_currency(
|
303
|
-
:currency => "FAKE_CURRENCY"
|
303
|
+
:currency => "FAKE_CURRENCY",
|
304
304
|
)
|
305
305
|
result.should_not be_success
|
306
306
|
|
@@ -314,13 +314,13 @@ describe Braintree::MerchantAccount do
|
|
314
314
|
|
315
315
|
gateway = Braintree::Gateway.new(
|
316
316
|
:access_token => result.credentials.access_token,
|
317
|
-
:logger => Logger.new("/dev/null")
|
317
|
+
:logger => Logger.new("/dev/null"),
|
318
318
|
)
|
319
319
|
|
320
320
|
merchant = result.merchant
|
321
321
|
result = gateway.merchant_account.create_for_currency(
|
322
322
|
:currency => "USD",
|
323
|
-
:id => merchant.merchant_accounts.first.id
|
323
|
+
:id => merchant.merchant_accounts.first.id,
|
324
324
|
)
|
325
325
|
result.should_not be_success
|
326
326
|
|
@@ -338,7 +338,6 @@ describe Braintree::MerchantAccount do
|
|
338
338
|
id = result.merchant_account.id
|
339
339
|
merchant_account = Braintree::MerchantAccount.find(id)
|
340
340
|
|
341
|
-
merchant_account.status.should == Braintree::MerchantAccount::Status::Active
|
342
341
|
merchant_account.individual_details.first_name.should == VALID_APPLICATION_PARAMS[:individual][:first_name]
|
343
342
|
merchant_account.individual_details.last_name.should == VALID_APPLICATION_PARAMS[:individual][:last_name]
|
344
343
|
end
|
@@ -352,7 +351,7 @@ describe Braintree::MerchantAccount do
|
|
352
351
|
it "raises a NotFoundError exception if merchant account cannot be found" do
|
353
352
|
expect do
|
354
353
|
Braintree::MerchantAccount.find("non-existant")
|
355
|
-
end.to raise_error(Braintree::NotFoundError,
|
354
|
+
end.to raise_error(Braintree::NotFoundError, "Merchant account with id non-existant not found")
|
356
355
|
end
|
357
356
|
end
|
358
357
|
|
@@ -412,7 +411,7 @@ describe Braintree::MerchantAccount do
|
|
412
411
|
end
|
413
412
|
|
414
413
|
it "does not require all fields" do
|
415
|
-
result = Braintree::MerchantAccount.update("sandbox_sub_merchant_account", {
|
414
|
+
result = Braintree::MerchantAccount.update("sandbox_sub_merchant_account", {:individual => {:first_name => "Jose"}})
|
416
415
|
result.should be_success
|
417
416
|
end
|
418
417
|
|
@@ -6,13 +6,13 @@ describe Braintree::MerchantGateway do
|
|
6
6
|
gateway = Braintree::Gateway.new(
|
7
7
|
:client_id => "client_id$#{Braintree::Configuration.environment}$integration_client_id",
|
8
8
|
:client_secret => "client_secret$#{Braintree::Configuration.environment}$integration_client_secret",
|
9
|
-
:logger => Logger.new("/dev/null")
|
9
|
+
:logger => Logger.new("/dev/null"),
|
10
10
|
)
|
11
11
|
|
12
12
|
result = gateway.merchant.create(
|
13
13
|
:email => "name@email.com",
|
14
14
|
:country_code_alpha3 => "USA",
|
15
|
-
:payment_methods => ["credit_card", "paypal"]
|
15
|
+
:payment_methods => ["credit_card", "paypal"],
|
16
16
|
)
|
17
17
|
|
18
18
|
result.should be_success
|
@@ -37,13 +37,13 @@ describe Braintree::MerchantGateway do
|
|
37
37
|
gateway = Braintree::Gateway.new(
|
38
38
|
:client_id => "client_id$#{Braintree::Configuration.environment}$integration_client_id",
|
39
39
|
:client_secret => "client_secret$#{Braintree::Configuration.environment}$integration_client_secret",
|
40
|
-
:logger => Logger.new("/dev/null")
|
40
|
+
:logger => Logger.new("/dev/null"),
|
41
41
|
)
|
42
42
|
|
43
43
|
result = gateway.merchant.create(
|
44
44
|
:email => "name@email.com",
|
45
45
|
:country_code_alpha3 => "USA",
|
46
|
-
:payment_methods => ["fake_money"]
|
46
|
+
:payment_methods => ["fake_money"],
|
47
47
|
)
|
48
48
|
|
49
49
|
result.should_not be_success
|
@@ -71,7 +71,7 @@ describe Braintree::MerchantGateway do
|
|
71
71
|
result = gateway.merchant.create(
|
72
72
|
:email => "name@email.com",
|
73
73
|
:country_code_alpha3 => "USA",
|
74
|
-
:payment_methods => ["credit_card", "paypal"]
|
74
|
+
:payment_methods => ["credit_card", "paypal"],
|
75
75
|
)
|
76
76
|
|
77
77
|
result.should be_success
|
@@ -83,7 +83,7 @@ describe Braintree::MerchantGateway do
|
|
83
83
|
@gateway = Braintree::Gateway.new(
|
84
84
|
:client_id => "client_id$development$signup_client_id",
|
85
85
|
:client_secret => "client_secret$development$signup_client_secret",
|
86
|
-
:logger => Logger.new("/dev/null")
|
86
|
+
:logger => Logger.new("/dev/null"),
|
87
87
|
)
|
88
88
|
end
|
89
89
|
|
@@ -92,7 +92,7 @@ describe Braintree::MerchantGateway do
|
|
92
92
|
:email => "name@email.com",
|
93
93
|
:country_code_alpha3 => "USA",
|
94
94
|
:payment_methods => ["credit_card", "paypal"],
|
95
|
-
:currencies => ["GBP", "USD"]
|
95
|
+
:currencies => ["GBP", "USD"],
|
96
96
|
)
|
97
97
|
|
98
98
|
merchant = result.merchant
|
@@ -127,7 +127,7 @@ describe Braintree::MerchantGateway do
|
|
127
127
|
:email => "name@email.com",
|
128
128
|
:country_code_alpha3 => "GBR",
|
129
129
|
:payment_methods => ["credit_card", "paypal"],
|
130
|
-
:currencies => ["GBP", "USD"]
|
130
|
+
:currencies => ["GBP", "USD"],
|
131
131
|
)
|
132
132
|
|
133
133
|
merchant = result.merchant
|
@@ -167,7 +167,7 @@ describe Braintree::MerchantGateway do
|
|
167
167
|
:paypal_account => {
|
168
168
|
:client_id => "paypal_client_id",
|
169
169
|
:client_secret => "paypal_client_secret",
|
170
|
-
}
|
170
|
+
},
|
171
171
|
)
|
172
172
|
|
173
173
|
result.should be_success
|
@@ -207,7 +207,7 @@ describe Braintree::MerchantGateway do
|
|
207
207
|
:paypal_account => {
|
208
208
|
:client_id => "paypal_client_id",
|
209
209
|
:client_secret => "paypal_client_secret",
|
210
|
-
}
|
210
|
+
},
|
211
211
|
)
|
212
212
|
|
213
213
|
result.should be_success
|
@@ -243,7 +243,7 @@ describe Braintree::MerchantGateway do
|
|
243
243
|
:paypal_account => {
|
244
244
|
:client_id => "paypal_client_id",
|
245
245
|
:client_secret => "paypal_client_secret",
|
246
|
-
}
|
246
|
+
},
|
247
247
|
)
|
248
248
|
|
249
249
|
result.should be_success
|
@@ -280,7 +280,7 @@ describe Braintree::MerchantGateway do
|
|
280
280
|
:paypal_account => {
|
281
281
|
:client_id => "paypal_client_id",
|
282
282
|
:client_secret => "paypal_client_secret",
|
283
|
-
}
|
283
|
+
},
|
284
284
|
)
|
285
285
|
|
286
286
|
result.should_not be_success
|
@@ -5,7 +5,7 @@ describe "OAuth" do
|
|
5
5
|
@gateway = Braintree::Gateway.new(
|
6
6
|
:client_id => "client_id$#{Braintree::Configuration.environment}$integration_client_id",
|
7
7
|
:client_secret => "client_secret$#{Braintree::Configuration.environment}$integration_client_secret",
|
8
|
-
:logger => Logger.new("/dev/null")
|
8
|
+
:logger => Logger.new("/dev/null"),
|
9
9
|
)
|
10
10
|
end
|
11
11
|
|
@@ -18,7 +18,7 @@ describe "OAuth" do
|
|
18
18
|
|
19
19
|
result = @gateway.oauth.create_token_from_code(
|
20
20
|
:code => code,
|
21
|
-
:scope => "read_write"
|
21
|
+
:scope => "read_write",
|
22
22
|
)
|
23
23
|
|
24
24
|
result.should be_success
|
@@ -32,7 +32,7 @@ describe "OAuth" do
|
|
32
32
|
it "returns validation errors for bad params" do
|
33
33
|
result = @gateway.oauth.create_token_from_code(
|
34
34
|
:code => "bad_code",
|
35
|
-
:scope => "read_write"
|
35
|
+
:scope => "read_write",
|
36
36
|
)
|
37
37
|
|
38
38
|
result.should_not be_success
|
@@ -43,13 +43,13 @@ describe "OAuth" do
|
|
43
43
|
it "raises with a helpful error if client_id and client_secret are not set" do
|
44
44
|
gateway = Braintree::Gateway.new(
|
45
45
|
:access_token => "access_token$development$integration_merchant_id$fb27c79dd",
|
46
|
-
:logger => Logger.new("/dev/null")
|
46
|
+
:logger => Logger.new("/dev/null"),
|
47
47
|
)
|
48
48
|
|
49
49
|
expect do
|
50
50
|
gateway.oauth.create_token_from_code(
|
51
51
|
:code => "some code",
|
52
|
-
:scope => "read_write"
|
52
|
+
:scope => "read_write",
|
53
53
|
)
|
54
54
|
end.to raise_error(Braintree::ConfigurationError, /client_id and client_secret are required/);
|
55
55
|
end
|
@@ -63,12 +63,12 @@ describe "OAuth" do
|
|
63
63
|
})
|
64
64
|
refresh_token = @gateway.oauth.create_token_from_code(
|
65
65
|
:code => code,
|
66
|
-
:scope => "read_write"
|
66
|
+
:scope => "read_write",
|
67
67
|
).credentials.refresh_token
|
68
68
|
|
69
69
|
result = @gateway.oauth.create_token_from_refresh_token(
|
70
70
|
:refresh_token => refresh_token,
|
71
|
-
:scope => "read_write"
|
71
|
+
:scope => "read_write",
|
72
72
|
)
|
73
73
|
|
74
74
|
result.should be_success
|
@@ -88,7 +88,7 @@ describe "OAuth" do
|
|
88
88
|
})
|
89
89
|
access_token = @gateway.oauth.create_token_from_code(
|
90
90
|
:code => code,
|
91
|
-
:scope => "read_write"
|
91
|
+
:scope => "read_write",
|
92
92
|
).credentials.access_token
|
93
93
|
|
94
94
|
result = @gateway.oauth.revoke_access_token(access_token)
|
@@ -96,7 +96,7 @@ describe "OAuth" do
|
|
96
96
|
|
97
97
|
gateway = Braintree::Gateway.new(
|
98
98
|
:access_token => access_token,
|
99
|
-
:logger => Logger.new("/dev/null")
|
99
|
+
:logger => Logger.new("/dev/null"),
|
100
100
|
)
|
101
101
|
|
102
102
|
expect do
|
@@ -146,7 +146,7 @@ describe "OAuth" do
|
|
146
146
|
:currency => "USD",
|
147
147
|
:website => "http://example.com"
|
148
148
|
},
|
149
|
-
:payment_methods => ["credit_card", "paypal"]
|
149
|
+
:payment_methods => ["credit_card", "paypal"],
|
150
150
|
)
|
151
151
|
|
152
152
|
uri = URI.parse(url)
|
@@ -201,7 +201,7 @@ describe "OAuth" do
|
|
201
201
|
:redirect_uri => "http://bar.example.com",
|
202
202
|
:scope => "read_write",
|
203
203
|
:state => "baz_state",
|
204
|
-
:payment_methods => ["credit_card", "paypal"]
|
204
|
+
:payment_methods => ["credit_card", "paypal"],
|
205
205
|
)
|
206
206
|
|
207
207
|
uri = URI.parse(url)
|