braintree 4.37.0 → 4.38.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6caf45c8c01ed96cbda734799d6af4445fb48aeb96d04dcd261cdb8986a0c3d
4
- data.tar.gz: 28cddb63bbe271008adeac7541458a147c2b536acebd61492e7f803fe01a54c7
3
+ metadata.gz: 9847c722f0454ca6210b66fd3c083214b2f81947e2b8e2aa3ffd31e7892ae5c1
4
+ data.tar.gz: 0faf0a4519808b21007000b57e353fbf6fd89c02a64551f6fa5560fa00f9fbde
5
5
  SHA512:
6
- metadata.gz: 0a649a80b6d11cc600f6e5eb2feea91aec32a1c808e6786a5a05121eb0f0b149e9937dfd8ecdfd18b5bcadc605f2ac7b89e9341383db29d31f2541331dc956b8
7
- data.tar.gz: 037444564b51d29d4631cc8f7f39280a72a99db13ebc76d5f02c14d28e839606123c773e2b3ccd32b43ceee262ffd9535381fe20686dd0497720c26564bd818f
6
+ metadata.gz: 91921d4cd7aabff1e758003dc4de8e715c5dd3ba704d5682b9adb74340012eb94eb7c328e40a6620985b1ad129006d62d2c15160f49b483f9b34d3ea8e441d6b
7
+ data.tar.gz: 384b5dcaf3a750f916b1cfb49bc60b625d8cc8c2fc729f3999fe81e6b5c0fcdba32de94cdceb7fde1a1184a12fb3eeaf95eac2dfbfb46c58b38935d578e82b78
@@ -344,6 +344,8 @@ module Braintree
344
344
  :tax_amount,
345
345
  :tax_exempt,
346
346
  :discount_amount,
347
+ {:shipping => AddressGateway._shared_signature},
348
+ :shipping_address_id,
347
349
  :shipping_amount,
348
350
  :shipping_tax_amount,
349
351
  :ships_from_postal_code,
@@ -1,7 +1,7 @@
1
1
  module Braintree
2
2
  module Version
3
3
  Major = 4
4
- Minor = 37
4
+ Minor = 38
5
5
  Tiny = 0
6
6
 
7
7
  String = "#{Major}.#{Minor}.#{Tiny}"
@@ -6206,6 +6206,90 @@ describe Braintree::Transaction do
6206
6206
  end.to raise_error(ArgumentError)
6207
6207
  end
6208
6208
 
6209
+ it "succeeds when a vaulted shipping_address_id is passed" do
6210
+ customer = Braintree::Customer.create!(
6211
+ :credit_card => {
6212
+ :number => Braintree::Test::CreditCardNumbers::Visa,
6213
+ :expiration_date => "06/2009"
6214
+ },
6215
+ )
6216
+ address = Braintree::Address.create!(
6217
+ :customer_id => customer.id,
6218
+ :street_address => "1 Main St",
6219
+ :locality => "Chicago",
6220
+ :region => "IL",
6221
+ :postal_code => "60601",
6222
+ )
6223
+ transaction = Braintree::Transaction.create(
6224
+ :type => "sale",
6225
+ :amount => Braintree::Test::TransactionAmounts::Authorize,
6226
+ :customer_id => customer.id,
6227
+ :payment_method_token => customer.credit_cards.first.token,
6228
+ :options => {
6229
+ :submit_for_settlement => false
6230
+ },
6231
+ ).transaction
6232
+
6233
+ result = Braintree::Transaction.submit_for_settlement(transaction.id, nil, {
6234
+ :shipping_address_id => address.id,
6235
+ })
6236
+
6237
+ expect(result.success?).to be_truthy
6238
+ expect(result.transaction.shipping_details.street_address).to eq("1 Main St")
6239
+ expect(result.transaction.shipping_details.postal_code).to eq("60601")
6240
+ end
6241
+
6242
+ it "raises an ArgumentError if an invalid shipping sub-key is passed" do
6243
+ transaction = Braintree::Transaction.sale!(
6244
+ :amount => Braintree::Test::TransactionAmounts::Authorize,
6245
+ :credit_card => {
6246
+ :number => Braintree::Test::CreditCardNumbers::Visa,
6247
+ :expiration_date => "06/2009"
6248
+ },
6249
+ )
6250
+
6251
+ expect do
6252
+ Braintree::Transaction.submit_for_settlement(transaction.id, nil, {
6253
+ :shipping => {:invalid_field => "bad"}
6254
+ })
6255
+ end.to raise_error(ArgumentError)
6256
+ end
6257
+
6258
+ it "succeeds when shipping address data is passed" do
6259
+ transaction = Braintree::Transaction.sale!(
6260
+ :amount => Braintree::Test::TransactionAmounts::Authorize,
6261
+ :credit_card => {
6262
+ :number => Braintree::Test::CreditCardNumbers::Visa,
6263
+ :expiration_date => "06/2009"
6264
+ },
6265
+ :options => {
6266
+ :submit_for_settlement => false
6267
+ },
6268
+ )
6269
+
6270
+ result = Braintree::Transaction.submit_for_settlement(transaction.id, nil, {
6271
+ :discount_amount => "12.33",
6272
+ :shipping_amount => "5.00",
6273
+ :ships_from_postal_code => "90210",
6274
+ :shipping => {
6275
+ :first_name => "Andrew",
6276
+ :last_name => "Mason",
6277
+ :company => "Braintree",
6278
+ :street_address => "456 W Main St",
6279
+ :extended_address => "Apt 2F",
6280
+ :locality => "Bartlett",
6281
+ :region => "IL",
6282
+ :postal_code => "60103",
6283
+ :country_name => "United States of America",
6284
+ },
6285
+ })
6286
+
6287
+ expect(result.success?).to be_truthy
6288
+ expect(result.transaction.status).to eq(Braintree::Transaction::Status::SubmittedForSettlement)
6289
+ expect(result.transaction.shipping_details.first_name).to eq("Andrew")
6290
+ expect(result.transaction.shipping_details.postal_code).to eq("60103")
6291
+ end
6292
+
6209
6293
  it "returns an error result if settlement is too large" do
6210
6294
  transaction = Braintree::Transaction.sale!(
6211
6295
  :amount => Braintree::Test::TransactionAmounts::Authorize,
@@ -185,6 +185,8 @@ describe Braintree::TransactionGateway do
185
185
  :tax_amount,
186
186
  :tax_exempt,
187
187
  :discount_amount,
188
+ {:shipping => Braintree::AddressGateway._shared_signature},
189
+ :shipping_address_id,
188
190
  :shipping_amount,
189
191
  :shipping_tax_amount,
190
192
  :ships_from_postal_code,
@@ -43,6 +43,12 @@ describe Braintree::Transaction do
43
43
  Braintree::Transaction.submit_for_settlement("invalid-transaction-id")
44
44
  end.to raise_error(ArgumentError, "transaction_id is invalid")
45
45
  end
46
+
47
+ it "raises an ArgumentError if options hash includes an invalid key" do
48
+ expect do
49
+ Braintree::Transaction.submit_for_settlement("validtxnid1", nil, :invalid_key => "foo")
50
+ end.to raise_error(ArgumentError, "invalid keys: invalid_key")
51
+ end
46
52
  end
47
53
 
48
54
  describe "self.adjust_authorization" do
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.37.0
4
+ version: 4.38.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-05-27 00:00:00.000000000 Z
11
+ date: 2026-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: builder
@@ -437,7 +437,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
437
437
  - !ruby/object:Gem::Version
438
438
  version: '0'
439
439
  requirements: []
440
- rubygems_version: 3.4.19
440
+ rubygems_version: 3.3.15
441
441
  signing_key:
442
442
  specification_version: 4
443
443
  summary: Braintree Ruby Server SDK