braintree 4.39.0 → 4.41.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.
- checksums.yaml +4 -4
- data/lib/braintree/address_gateway.rb +13 -3
- data/lib/braintree/client_token_gateway.rb +10 -1
- data/lib/braintree/credit_card_gateway.rb +9 -2
- data/lib/braintree/credit_card_verification_gateway.rb +3 -0
- data/lib/braintree/customer_gateway.rb +11 -3
- data/lib/braintree/dispute_gateway.rb +7 -7
- data/lib/braintree/error_codes.rb +11 -0
- data/lib/braintree/http.rb +4 -2
- data/lib/braintree/merchant_account_gateway.rb +2 -0
- data/lib/braintree/payment_method_gateway.rb +7 -1
- data/lib/braintree/payment_method_nonce_gateway.rb +4 -0
- data/lib/braintree/paypal_account_gateway.rb +6 -1
- data/lib/braintree/plan_gateway.rb +4 -0
- data/lib/braintree/sepa_direct_debit_account_gateway.rb +4 -0
- data/lib/braintree/subscription_gateway.rb +6 -0
- data/lib/braintree/testing_gateway.rb +4 -0
- data/lib/braintree/three_d_secure_pass_thru.rb +11 -0
- data/lib/braintree/transaction.rb +6 -0
- data/lib/braintree/transaction_gateway.rb +17 -7
- data/lib/braintree/transaction_line_item_gateway.rb +3 -1
- data/lib/braintree/transaction_search.rb +1 -0
- data/lib/braintree/us_bank_account_gateway.rb +2 -0
- data/lib/braintree/us_bank_account_verification_gateway.rb +4 -0
- data/lib/braintree/util.rb +5 -0
- data/lib/braintree/version.rb +1 -1
- data/lib/braintree.rb +1 -0
- data/spec/integration/braintree/advanced_search_spec.rb +4 -7
- data/spec/integration/braintree/braintree_gateway_spec.rb +1 -2
- data/spec/integration/braintree/client_api/client_token_spec.rb +14 -0
- data/spec/integration/braintree/credit_card_spec.rb +94 -2
- data/spec/integration/braintree/credit_card_verification_spec.rb +33 -0
- data/spec/integration/braintree/customer_spec.rb +196 -5
- data/spec/integration/braintree/http_spec.rb +1 -1
- data/spec/integration/braintree/payment_method_spec.rb +77 -7
- data/spec/integration/braintree/samsung_pay_card_spec.rb +1 -1
- data/spec/integration/braintree/transaction_search_spec.rb +113 -13
- data/spec/integration/braintree/transaction_spec.rb +197 -17
- data/spec/unit/braintree/address_spec.rb +32 -0
- data/spec/unit/braintree/client_token_spec.rb +72 -0
- data/spec/unit/braintree/credit_card_spec.rb +28 -0
- data/spec/unit/braintree/credit_card_verification_spec.rb +8 -0
- data/spec/unit/braintree/customer_spec.rb +28 -0
- data/spec/unit/braintree/dispute_spec.rb +38 -0
- data/spec/unit/braintree/http_spec.rb +44 -0
- data/spec/unit/braintree/merchant_account_spec.rb +11 -0
- data/spec/unit/braintree/package_tracking_spec.rb +2 -2
- data/spec/unit/braintree/payment_method_nonce_spec.rb +14 -0
- data/spec/unit/braintree/payment_method_spec.rb +20 -0
- data/spec/unit/braintree/paypal_account_spec.rb +20 -0
- data/spec/unit/braintree/plan_gateway_spec.rb +30 -0
- data/spec/unit/braintree/sepa_debit_account_spec.rb +14 -0
- data/spec/unit/braintree/subscription_spec.rb +20 -0
- data/spec/unit/braintree/test_transaction_spec.rb +18 -0
- data/spec/unit/braintree/transaction_gateway_spec.rb +11 -0
- data/spec/unit/braintree/transaction_line_item_spec.rb +11 -0
- data/spec/unit/braintree/transaction_search_spec.rb +25 -0
- data/spec/unit/braintree/transaction_spec.rb +68 -6
- data/spec/unit/braintree/us_bank_account_spec.rb +8 -0
- data/spec/unit/braintree/us_bank_account_verification_spec.rb +14 -0
- data/spec/unit/braintree/util_spec.rb +37 -0
- metadata +8 -3
|
@@ -95,4 +95,18 @@ describe Braintree::UsBankAccountVerification do
|
|
|
95
95
|
expect(verification).not_to eq(same_id_different_object)
|
|
96
96
|
end
|
|
97
97
|
end
|
|
98
|
+
|
|
99
|
+
describe "path traversal" do
|
|
100
|
+
it "self.find raises an exception if the id is a traversal segment" do
|
|
101
|
+
expect do
|
|
102
|
+
Braintree::UsBankAccountVerification.find("../verifications/victim_id")
|
|
103
|
+
end.to raise_error(ArgumentError, "id contains invalid characters")
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
it "self.confirm_micro_transfer_amounts raises an exception if the id is a traversal segment" do
|
|
107
|
+
expect do
|
|
108
|
+
Braintree::UsBankAccountVerification.confirm_micro_transfer_amounts("../verifications/victim_id", ["0.01", "0.02"])
|
|
109
|
+
end.to raise_error(ArgumentError, "id contains invalid characters")
|
|
110
|
+
end
|
|
111
|
+
end
|
|
98
112
|
end
|
|
@@ -417,4 +417,41 @@ describe Braintree::Util do
|
|
|
417
417
|
expect(Braintree::Util.url_decode("foo%3Fbar")).to eq("foo?bar")
|
|
418
418
|
end
|
|
419
419
|
end
|
|
420
|
+
|
|
421
|
+
describe "self.invalid_path_segment?" do
|
|
422
|
+
[
|
|
423
|
+
"customer123",
|
|
424
|
+
"CUSTOMER_123",
|
|
425
|
+
"a-b_c-D9",
|
|
426
|
+
"1234567890",
|
|
427
|
+
"a",
|
|
428
|
+
123,
|
|
429
|
+
].each do |valid_segment|
|
|
430
|
+
it "returns false for a valid segment #{valid_segment.inspect}" do
|
|
431
|
+
expect(Braintree::Util.invalid_path_segment?(valid_segment)).to eq(false)
|
|
432
|
+
end
|
|
433
|
+
end
|
|
434
|
+
|
|
435
|
+
[
|
|
436
|
+
"",
|
|
437
|
+
" ",
|
|
438
|
+
".",
|
|
439
|
+
"..",
|
|
440
|
+
"foo/bar",
|
|
441
|
+
"foo\\bar",
|
|
442
|
+
"foo%bar",
|
|
443
|
+
"..%2f..%2fvictim",
|
|
444
|
+
"%2e%2e",
|
|
445
|
+
"../../victim_customer/addresses/victim_address",
|
|
446
|
+
"abc.def",
|
|
447
|
+
"abc def",
|
|
448
|
+
nil,
|
|
449
|
+
{},
|
|
450
|
+
[],
|
|
451
|
+
].each do |invalid_segment|
|
|
452
|
+
it "returns true for an invalid segment #{invalid_segment.inspect}" do
|
|
453
|
+
expect(Braintree::Util.invalid_path_segment?(invalid_segment)).to eq(true)
|
|
454
|
+
end
|
|
455
|
+
end
|
|
456
|
+
end
|
|
420
457
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: braintree
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.
|
|
4
|
+
version: 4.41.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Braintree
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-09-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: builder
|
|
@@ -195,6 +195,7 @@ files:
|
|
|
195
195
|
- lib/braintree/test_transaction.rb
|
|
196
196
|
- lib/braintree/testing_gateway.rb
|
|
197
197
|
- lib/braintree/three_d_secure_info.rb
|
|
198
|
+
- lib/braintree/three_d_secure_pass_thru.rb
|
|
198
199
|
- lib/braintree/transaction.rb
|
|
199
200
|
- lib/braintree/transaction/address_details.rb
|
|
200
201
|
- lib/braintree/transaction/apple_pay_details.rb
|
|
@@ -355,6 +356,7 @@ files:
|
|
|
355
356
|
- spec/unit/braintree/local_payment_context_spec.rb
|
|
356
357
|
- spec/unit/braintree/local_payment_expired_spec.rb
|
|
357
358
|
- spec/unit/braintree/local_payment_funded_spec.rb
|
|
359
|
+
- spec/unit/braintree/merchant_account_spec.rb
|
|
358
360
|
- spec/unit/braintree/meta_checkout_card_details_spec.rb
|
|
359
361
|
- spec/unit/braintree/meta_checkout_card_spec.rb
|
|
360
362
|
- spec/unit/braintree/meta_checkout_token_details_spec.rb
|
|
@@ -369,6 +371,7 @@ files:
|
|
|
369
371
|
- spec/unit/braintree/payment_method_spec.rb
|
|
370
372
|
- spec/unit/braintree/paypal_account_spec.rb
|
|
371
373
|
- spec/unit/braintree/paypal_payment_resource_spec.rb
|
|
374
|
+
- spec/unit/braintree/plan_gateway_spec.rb
|
|
372
375
|
- spec/unit/braintree/resource_collection_spec.rb
|
|
373
376
|
- spec/unit/braintree/risk_data/liability_shift.rb
|
|
374
377
|
- spec/unit/braintree/risk_data_spec.rb
|
|
@@ -379,6 +382,7 @@ files:
|
|
|
379
382
|
- spec/unit/braintree/subscription_search_spec.rb
|
|
380
383
|
- spec/unit/braintree/subscription_spec.rb
|
|
381
384
|
- spec/unit/braintree/successful_result_spec.rb
|
|
385
|
+
- spec/unit/braintree/test_transaction_spec.rb
|
|
382
386
|
- spec/unit/braintree/three_d_secure_info_spec.rb
|
|
383
387
|
- spec/unit/braintree/transaction/apple_pay_details_spec.rb
|
|
384
388
|
- spec/unit/braintree/transaction/credit_card_details_spec.rb
|
|
@@ -395,6 +399,7 @@ files:
|
|
|
395
399
|
- spec/unit/braintree/transaction/visa_checkout_card_details_spec.rb
|
|
396
400
|
- spec/unit/braintree/transaction_ach_mandate_spec.rb
|
|
397
401
|
- spec/unit/braintree/transaction_gateway_spec.rb
|
|
402
|
+
- spec/unit/braintree/transaction_line_item_spec.rb
|
|
398
403
|
- spec/unit/braintree/transaction_search_spec.rb
|
|
399
404
|
- spec/unit/braintree/transaction_spec.rb
|
|
400
405
|
- spec/unit/braintree/unknown_payment_method_spec.rb
|
|
@@ -437,7 +442,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
437
442
|
- !ruby/object:Gem::Version
|
|
438
443
|
version: '0'
|
|
439
444
|
requirements: []
|
|
440
|
-
rubygems_version: 3.
|
|
445
|
+
rubygems_version: 3.5.22
|
|
441
446
|
signing_key:
|
|
442
447
|
specification_version: 4
|
|
443
448
|
summary: Braintree Ruby Server SDK
|