braintree 4.23.0 → 4.34.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.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/lib/braintree/address_gateway.rb +5 -0
  3. data/lib/braintree/apple_pay_card.rb +6 -0
  4. data/lib/braintree/bank_account_instant_verification_gateway.rb +38 -0
  5. data/lib/braintree/bank_account_instant_verification_jwt.rb +23 -0
  6. data/lib/braintree/bank_account_instant_verification_jwt_request.rb +21 -0
  7. data/lib/braintree/bin_data.rb +8 -2
  8. data/lib/braintree/configuration.rb +1 -1
  9. data/lib/braintree/credit_card.rb +12 -5
  10. data/lib/braintree/credit_card_gateway.rb +1 -0
  11. data/lib/braintree/credit_card_verification_gateway.rb +5 -2
  12. data/lib/braintree/customer_session_gateway.rb +195 -0
  13. data/lib/braintree/dispute.rb +1 -0
  14. data/lib/braintree/error_codes.rb +58 -104
  15. data/lib/braintree/error_result.rb +1 -1
  16. data/lib/braintree/errors.rb +2 -1
  17. data/lib/braintree/gateway.rb +12 -0
  18. data/lib/braintree/google_pay_card.rb +5 -0
  19. data/lib/braintree/graphql/enums/recommendations.rb +9 -0
  20. data/lib/braintree/graphql/enums/recommended_payment_option.rb +10 -0
  21. data/lib/braintree/graphql/inputs/create_customer_session_input.rb +44 -0
  22. data/lib/braintree/graphql/inputs/customer_recommendations_input.rb +40 -0
  23. data/lib/braintree/graphql/inputs/customer_session_input.rb +45 -0
  24. data/lib/braintree/graphql/inputs/monetary_amount_input.rb +28 -0
  25. data/lib/braintree/graphql/inputs/paypal_payee_input.rb +28 -0
  26. data/lib/braintree/graphql/inputs/paypal_purchase_unit_input.rb +31 -0
  27. data/lib/braintree/graphql/inputs/phone_input.rb +34 -0
  28. data/lib/braintree/graphql/inputs/update_customer_session_input.rb +42 -0
  29. data/lib/braintree/graphql/types/customer_recommendations_payload.rb +129 -0
  30. data/lib/braintree/graphql/types/payment_options.rb +35 -0
  31. data/lib/braintree/graphql/types/payment_recommendations.rb +35 -0
  32. data/lib/braintree/graphql/unions/customer_recommendations.rb +47 -0
  33. data/lib/braintree/graphql_client.rb +16 -0
  34. data/lib/braintree/merchant_account.rb +1 -25
  35. data/lib/braintree/merchant_account_gateway.rb +0 -81
  36. data/lib/braintree/meta_checkout_card.rb +11 -6
  37. data/lib/braintree/meta_checkout_token.rb +11 -6
  38. data/lib/braintree/payment_method_gateway.rb +9 -0
  39. data/lib/braintree/paypal_payment_resource.rb +22 -0
  40. data/lib/braintree/paypal_payment_resource_gateway.rb +36 -0
  41. data/lib/braintree/successful_result.rb +3 -0
  42. data/lib/braintree/test/credit_card.rb +5 -0
  43. data/lib/braintree/transaction/apple_pay_details.rb +7 -0
  44. data/lib/braintree/transaction/credit_card_details.rb +22 -10
  45. data/lib/braintree/transaction/google_pay_details.rb +16 -10
  46. data/lib/braintree/transaction/meta_checkout_card_details.rb +11 -2
  47. data/lib/braintree/transaction/meta_checkout_token_details.rb +13 -3
  48. data/lib/braintree/transaction/paypal_details.rb +2 -0
  49. data/lib/braintree/transaction/visa_checkout_card_details.rb +10 -2
  50. data/lib/braintree/transaction.rb +3 -26
  51. data/lib/braintree/transaction_gateway.rb +52 -31
  52. data/lib/braintree/us_bank_account_verification.rb +3 -1
  53. data/lib/braintree/version.rb +1 -1
  54. data/lib/braintree/visa_checkout_card.rb +10 -5
  55. data/lib/braintree/webhook_notification.rb +1 -4
  56. data/lib/braintree/webhook_testing_gateway.rb +16 -33
  57. data/lib/braintree/xml/{libxml.rb → nokogiri.rb} +18 -16
  58. data/lib/braintree/xml/parser.rb +4 -4
  59. data/lib/braintree.rb +21 -4
  60. data/spec/integration/braintree/advanced_search_spec.rb +7 -4
  61. data/spec/integration/braintree/apple_pay_spec.rb +6 -7
  62. data/spec/integration/braintree/bank_account_instant_verification_spec.rb +191 -0
  63. data/spec/integration/braintree/client_api/spec_helper.rb +81 -0
  64. data/spec/integration/braintree/credit_card_spec.rb +115 -1
  65. data/spec/integration/braintree/credit_card_verification_spec.rb +149 -0
  66. data/spec/integration/braintree/customer_session_spec.rb +154 -0
  67. data/spec/integration/braintree/customer_spec.rb +94 -10
  68. data/spec/integration/braintree/disbursement_spec.rb +1 -1
  69. data/spec/integration/braintree/dispute_spec.rb +13 -2
  70. data/spec/integration/braintree/merchant_account_spec.rb +19 -359
  71. data/spec/integration/braintree/merchant_spec.rb +4 -4
  72. data/spec/integration/braintree/payment_method_nonce_spec.rb +55 -0
  73. data/spec/integration/braintree/payment_method_spec.rb +57 -7
  74. data/spec/integration/braintree/payment_method_us_bank_account_spec.rb +0 -3
  75. data/spec/integration/braintree/paypal_payment_resource_spec.rb +141 -0
  76. data/spec/integration/braintree/transaction_payment_facilitator_spec.rb +119 -0
  77. data/spec/integration/braintree/transaction_search_spec.rb +38 -33
  78. data/spec/integration/braintree/transaction_spec.rb +266 -350
  79. data/spec/integration/braintree/transaction_transfer_type_spec.rb +325 -0
  80. data/spec/integration/braintree/transaction_us_bank_account_spec.rb +0 -1
  81. data/spec/integration/braintree/us_bank_account_spec.rb +0 -3
  82. data/spec/integration/braintree/us_bank_account_verification_spec.rb +1 -1
  83. data/spec/spec_helper.rb +46 -12
  84. data/spec/unit/braintree/apple_pay_card_spec.rb +7 -0
  85. data/spec/unit/braintree/bank_account_instant_verification_gateway_spec.rb +98 -0
  86. data/spec/unit/braintree/bank_account_instant_verification_jwt_request_spec.rb +71 -0
  87. data/spec/unit/braintree/client_token_spec.rb +11 -0
  88. data/spec/unit/braintree/configuration_spec.rb +1 -1
  89. data/spec/unit/braintree/credit_card_spec.rb +27 -2
  90. data/spec/unit/braintree/credit_card_verification_gateway_spec.rb +1 -0
  91. data/spec/unit/braintree/credit_card_verification_spec.rb +17 -0
  92. data/spec/unit/braintree/customer_session_gateway_spec.rb +122 -0
  93. data/spec/unit/braintree/customer_spec.rb +2 -1
  94. data/spec/unit/braintree/dispute_spec.rb +6 -0
  95. data/spec/unit/braintree/error_result_spec.rb +28 -0
  96. data/spec/unit/braintree/google_pay_card_spec.rb +28 -0
  97. data/spec/unit/braintree/graphql/create_customer_session_input_spec.rb +102 -0
  98. data/spec/unit/braintree/graphql/customer_recommendations_input_spec.rb +80 -0
  99. data/spec/unit/braintree/graphql/customer_recommendations_spec.rb +40 -0
  100. data/spec/unit/braintree/graphql/customer_session_input_spec.rb +81 -0
  101. data/spec/unit/braintree/graphql/phone_input_spec.rb +51 -0
  102. data/spec/unit/braintree/graphql/update_customer_session_input_spec.rb +107 -0
  103. data/spec/unit/braintree/graphql_client_spec.rb +37 -0
  104. data/spec/unit/braintree/meta_checkout_card_spec.rb +61 -51
  105. data/spec/unit/braintree/meta_checkout_token_spec.rb +7 -1
  106. data/spec/unit/braintree/payment_method_nonce_spec.rb +11 -1
  107. data/spec/unit/braintree/payment_method_spec.rb +12 -0
  108. data/spec/unit/braintree/paypal_payment_resource_spec.rb +125 -0
  109. data/spec/unit/braintree/transaction/apple_pay_details_spec.rb +37 -0
  110. data/spec/unit/braintree/transaction/credit_card_details_spec.rb +15 -1
  111. data/spec/unit/braintree/transaction/google_pay_details_spec.rb +37 -0
  112. data/spec/unit/braintree/transaction/meta_checkout_card_details_spec.rb +28 -0
  113. data/spec/unit/braintree/transaction/meta_checkout_token_details_spec.rb +28 -0
  114. data/spec/unit/braintree/transaction/paypal_details_spec.rb +5 -0
  115. data/spec/unit/braintree/transaction/visa_checkout_card_details_spec.rb +28 -0
  116. data/spec/unit/braintree/transaction_ach_mandate_spec.rb +82 -0
  117. data/spec/unit/braintree/transaction_gateway_spec.rb +58 -11
  118. data/spec/unit/braintree/transaction_spec.rb +66 -0
  119. data/spec/unit/braintree/visa_checkout_card_spec.rb +28 -0
  120. data/spec/unit/braintree/webhook_notification_spec.rb +15 -51
  121. data/spec/unit/braintree/xml/{libxml_spec.rb → nokogiri_spec.rb} +7 -7
  122. data/spec/unit/braintree/xml/parser_spec.rb +57 -0
  123. data/spec/unit/credit_card_details_spec.rb +28 -0
  124. metadata +49 -10
  125. data/lib/braintree/merchant_account/business_details.rb +0 -17
  126. data/lib/braintree/merchant_account/funding_details.rb +0 -18
  127. data/lib/braintree/merchant_account/individual_details.rb +0 -20
  128. data/lib/ssl/securetrust_ca.crt +0 -44
  129. data/spec/unit/braintree/disbursement_spec.rb +0 -131
  130. data/spec/unit/braintree/merchant_account_spec.rb +0 -33
@@ -0,0 +1,28 @@
1
+ require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
2
+
3
+ describe Braintree::CreditCardDetails do
4
+ it "initializes prepaid reloadable correctly" do
5
+ card = Braintree::CreditCardDetails._new(:gateway, {:prepaid_reloadable => "No"})
6
+ expect(card.prepaid_reloadable).to eq("No")
7
+ end
8
+
9
+ it "initializes business correctly" do
10
+ card = Braintree::CreditCardDetails._new(:gateway, {:business => "No"})
11
+ expect(card.business).to eq("No")
12
+ end
13
+
14
+ it "initializes consumer correctly" do
15
+ card = Braintree::CreditCardDetails._new(:gateway, {:consumer => "No"})
16
+ expect(card.consumer).to eq("No")
17
+ end
18
+
19
+ it "initializes corporate correctly" do
20
+ card = Braintree::CreditCardDetails._new(:gateway, {:corporate => "No"})
21
+ expect(card.corporate).to eq("No")
22
+ end
23
+
24
+ it "initializes purchase correctly" do
25
+ card = Braintree::CreditCardDetails._new(:gateway, {:purchase => "No"})
26
+ expect(card.purchase).to eq("No")
27
+ end
28
+ 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.23.0
4
+ version: 4.34.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Braintree
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-29 00:00:00.000000000 Z
11
+ date: 2025-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: builder
@@ -61,6 +61,9 @@ files:
61
61
  - lib/braintree/apple_pay_gateway.rb
62
62
  - lib/braintree/apple_pay_options.rb
63
63
  - lib/braintree/authorization_adjustment.rb
64
+ - lib/braintree/bank_account_instant_verification_gateway.rb
65
+ - lib/braintree/bank_account_instant_verification_jwt.rb
66
+ - lib/braintree/bank_account_instant_verification_jwt_request.rb
64
67
  - lib/braintree/base_module.rb
65
68
  - lib/braintree/bin_data.rb
66
69
  - lib/braintree/client_token.rb
@@ -77,6 +80,7 @@ files:
77
80
  - lib/braintree/customer.rb
78
81
  - lib/braintree/customer_gateway.rb
79
82
  - lib/braintree/customer_search.rb
83
+ - lib/braintree/customer_session_gateway.rb
80
84
  - lib/braintree/descriptor.rb
81
85
  - lib/braintree/digest.rb
82
86
  - lib/braintree/disbursement.rb
@@ -108,6 +112,20 @@ files:
108
112
  - lib/braintree/gateway.rb
109
113
  - lib/braintree/google_pay_card.rb
110
114
  - lib/braintree/granted_payment_instrument_update.rb
115
+ - lib/braintree/graphql/enums/recommendations.rb
116
+ - lib/braintree/graphql/enums/recommended_payment_option.rb
117
+ - lib/braintree/graphql/inputs/create_customer_session_input.rb
118
+ - lib/braintree/graphql/inputs/customer_recommendations_input.rb
119
+ - lib/braintree/graphql/inputs/customer_session_input.rb
120
+ - lib/braintree/graphql/inputs/monetary_amount_input.rb
121
+ - lib/braintree/graphql/inputs/paypal_payee_input.rb
122
+ - lib/braintree/graphql/inputs/paypal_purchase_unit_input.rb
123
+ - lib/braintree/graphql/inputs/phone_input.rb
124
+ - lib/braintree/graphql/inputs/update_customer_session_input.rb
125
+ - lib/braintree/graphql/types/customer_recommendations_payload.rb
126
+ - lib/braintree/graphql/types/payment_options.rb
127
+ - lib/braintree/graphql/types/payment_recommendations.rb
128
+ - lib/braintree/graphql/unions/customer_recommendations.rb
111
129
  - lib/braintree/graphql_client.rb
112
130
  - lib/braintree/http.rb
113
131
  - lib/braintree/local_payment_completed.rb
@@ -118,9 +136,6 @@ files:
118
136
  - lib/braintree/merchant.rb
119
137
  - lib/braintree/merchant_account.rb
120
138
  - lib/braintree/merchant_account/address_details.rb
121
- - lib/braintree/merchant_account/business_details.rb
122
- - lib/braintree/merchant_account/funding_details.rb
123
- - lib/braintree/merchant_account/individual_details.rb
124
139
  - lib/braintree/merchant_account_gateway.rb
125
140
  - lib/braintree/merchant_gateway.rb
126
141
  - lib/braintree/meta_checkout_card.rb
@@ -141,6 +156,8 @@ files:
141
156
  - lib/braintree/payment_method_parser.rb
142
157
  - lib/braintree/paypal_account.rb
143
158
  - lib/braintree/paypal_account_gateway.rb
159
+ - lib/braintree/paypal_payment_resource.rb
160
+ - lib/braintree/paypal_payment_resource_gateway.rb
144
161
  - lib/braintree/plan.rb
145
162
  - lib/braintree/plan_gateway.rb
146
163
  - lib/braintree/processor_response_types.rb
@@ -219,11 +236,10 @@ files:
219
236
  - lib/braintree/webhook_testing_gateway.rb
220
237
  - lib/braintree/xml.rb
221
238
  - lib/braintree/xml/generator.rb
222
- - lib/braintree/xml/libxml.rb
239
+ - lib/braintree/xml/nokogiri.rb
223
240
  - lib/braintree/xml/parser.rb
224
241
  - lib/braintree/xml/rexml.rb
225
242
  - lib/ssl/api_braintreegateway_com.ca.crt
226
- - lib/ssl/securetrust_ca.crt
227
243
  - spec/fixtures/files/bt_logo.png
228
244
  - spec/fixtures/files/gif_extension_bt_logo.gif
229
245
  - spec/fixtures/files/malformed_pdf.pdf
@@ -232,6 +248,7 @@ files:
232
248
  - spec/integration/braintree/address_spec.rb
233
249
  - spec/integration/braintree/advanced_search_spec.rb
234
250
  - spec/integration/braintree/apple_pay_spec.rb
251
+ - spec/integration/braintree/bank_account_instant_verification_spec.rb
235
252
  - spec/integration/braintree/braintree_gateway_spec.rb
236
253
  - spec/integration/braintree/client_api/client_token_spec.rb
237
254
  - spec/integration/braintree/client_api/spec_helper.rb
@@ -239,6 +256,7 @@ files:
239
256
  - spec/integration/braintree/credit_card_verification_search_spec.rb
240
257
  - spec/integration/braintree/credit_card_verification_spec.rb
241
258
  - spec/integration/braintree/customer_search_spec.rb
259
+ - spec/integration/braintree/customer_session_spec.rb
242
260
  - spec/integration/braintree/customer_spec.rb
243
261
  - spec/integration/braintree/disbursement_spec.rb
244
262
  - spec/integration/braintree/discount_spec.rb
@@ -257,6 +275,7 @@ files:
257
275
  - spec/integration/braintree/payment_method_spec.rb
258
276
  - spec/integration/braintree/payment_method_us_bank_account_spec.rb
259
277
  - spec/integration/braintree/paypal_account_spec.rb
278
+ - spec/integration/braintree/paypal_payment_resource_spec.rb
260
279
  - spec/integration/braintree/plan_spec.rb
261
280
  - spec/integration/braintree/samsung_pay_card_spec.rb
262
281
  - spec/integration/braintree/sepa_direct_debit_account_spec.rb
@@ -265,8 +284,10 @@ files:
265
284
  - spec/integration/braintree/test/transaction_amounts_spec.rb
266
285
  - spec/integration/braintree/test_transaction_spec.rb
267
286
  - spec/integration/braintree/transaction_line_item_spec.rb
287
+ - spec/integration/braintree/transaction_payment_facilitator_spec.rb
268
288
  - spec/integration/braintree/transaction_search_spec.rb
269
289
  - spec/integration/braintree/transaction_spec.rb
290
+ - spec/integration/braintree/transaction_transfer_type_spec.rb
270
291
  - spec/integration/braintree/transaction_us_bank_account_spec.rb
271
292
  - spec/integration/braintree/us_bank_account_spec.rb
272
293
  - spec/integration/braintree/us_bank_account_verification_search_spec.rb
@@ -282,6 +303,8 @@ files:
282
303
  - spec/ssl/privateKey.key
283
304
  - spec/unit/braintree/address_spec.rb
284
305
  - spec/unit/braintree/apple_pay_card_spec.rb
306
+ - spec/unit/braintree/bank_account_instant_verification_gateway_spec.rb
307
+ - spec/unit/braintree/bank_account_instant_verification_jwt_request_spec.rb
285
308
  - spec/unit/braintree/base_module_spec.rb
286
309
  - spec/unit/braintree/client_token_spec.rb
287
310
  - spec/unit/braintree/configuration_spec.rb
@@ -290,9 +313,9 @@ files:
290
313
  - spec/unit/braintree/credit_card_verification_gateway_spec.rb
291
314
  - spec/unit/braintree/credit_card_verification_search_spec.rb
292
315
  - spec/unit/braintree/credit_card_verification_spec.rb
316
+ - spec/unit/braintree/customer_session_gateway_spec.rb
293
317
  - spec/unit/braintree/customer_spec.rb
294
318
  - spec/unit/braintree/digest_spec.rb
295
- - spec/unit/braintree/disbursement_spec.rb
296
319
  - spec/unit/braintree/dispute_search_spec.rb
297
320
  - spec/unit/braintree/dispute_spec.rb
298
321
  - spec/unit/braintree/document_upload_spec.rb
@@ -304,11 +327,18 @@ files:
304
327
  - spec/unit/braintree/exchange_rate_quote_response_spec.rb
305
328
  - spec/unit/braintree/exchange_rate_quote_spec.rb
306
329
  - spec/unit/braintree/exchange_rate_spec.rb
330
+ - spec/unit/braintree/google_pay_card_spec.rb
331
+ - spec/unit/braintree/graphql/create_customer_session_input_spec.rb
332
+ - spec/unit/braintree/graphql/customer_recommendations_input_spec.rb
333
+ - spec/unit/braintree/graphql/customer_recommendations_spec.rb
334
+ - spec/unit/braintree/graphql/customer_session_input_spec.rb
335
+ - spec/unit/braintree/graphql/phone_input_spec.rb
336
+ - spec/unit/braintree/graphql/update_customer_session_input_spec.rb
337
+ - spec/unit/braintree/graphql_client_spec.rb
307
338
  - spec/unit/braintree/http_spec.rb
308
339
  - spec/unit/braintree/local_payment_completed_spec.rb
309
340
  - spec/unit/braintree/local_payment_expired_spec.rb
310
341
  - spec/unit/braintree/local_payment_funded_spec.rb
311
- - spec/unit/braintree/merchant_account_spec.rb
312
342
  - spec/unit/braintree/meta_checkout_card_details_spec.rb
313
343
  - spec/unit/braintree/meta_checkout_card_spec.rb
314
344
  - spec/unit/braintree/meta_checkout_token_details_spec.rb
@@ -321,6 +351,7 @@ files:
321
351
  - spec/unit/braintree/payment_method_nonce_spec.rb
322
352
  - spec/unit/braintree/payment_method_spec.rb
323
353
  - spec/unit/braintree/paypal_account_spec.rb
354
+ - spec/unit/braintree/paypal_payment_resource_spec.rb
324
355
  - spec/unit/braintree/resource_collection_spec.rb
325
356
  - spec/unit/braintree/risk_data/liability_shift.rb
326
357
  - spec/unit/braintree/risk_data_spec.rb
@@ -332,14 +363,20 @@ files:
332
363
  - spec/unit/braintree/subscription_spec.rb
333
364
  - spec/unit/braintree/successful_result_spec.rb
334
365
  - spec/unit/braintree/three_d_secure_info_spec.rb
366
+ - spec/unit/braintree/transaction/apple_pay_details_spec.rb
335
367
  - spec/unit/braintree/transaction/credit_card_details_spec.rb
336
368
  - spec/unit/braintree/transaction/customer_details_spec.rb
337
369
  - spec/unit/braintree/transaction/deposit_details_spec.rb
370
+ - spec/unit/braintree/transaction/google_pay_details_spec.rb
338
371
  - spec/unit/braintree/transaction/installment_spec.rb
339
372
  - spec/unit/braintree/transaction/local_payment_details_spec.rb
373
+ - spec/unit/braintree/transaction/meta_checkout_card_details_spec.rb
374
+ - spec/unit/braintree/transaction/meta_checkout_token_details_spec.rb
340
375
  - spec/unit/braintree/transaction/payment_receipt_spec.rb
341
376
  - spec/unit/braintree/transaction/paypal_details_spec.rb
342
377
  - spec/unit/braintree/transaction/sepa_direct_debit_account_details_spec.rb
378
+ - spec/unit/braintree/transaction/visa_checkout_card_details_spec.rb
379
+ - spec/unit/braintree/transaction_ach_mandate_spec.rb
343
380
  - spec/unit/braintree/transaction_gateway_spec.rb
344
381
  - spec/unit/braintree/transaction_search_spec.rb
345
382
  - spec/unit/braintree/transaction_spec.rb
@@ -351,12 +388,14 @@ files:
351
388
  - spec/unit/braintree/validation_error_collection_spec.rb
352
389
  - spec/unit/braintree/validation_error_spec.rb
353
390
  - spec/unit/braintree/venmo_profile_data_spec.rb
391
+ - spec/unit/braintree/visa_checkout_card_spec.rb
354
392
  - spec/unit/braintree/webhook_notification_spec.rb
355
- - spec/unit/braintree/xml/libxml_spec.rb
393
+ - spec/unit/braintree/xml/nokogiri_spec.rb
356
394
  - spec/unit/braintree/xml/parser_spec.rb
357
395
  - spec/unit/braintree/xml/rexml_spec.rb
358
396
  - spec/unit/braintree/xml_spec.rb
359
397
  - spec/unit/braintree_spec.rb
398
+ - spec/unit/credit_card_details_spec.rb
360
399
  - spec/unit/spec_helper.rb
361
400
  homepage: https://www.braintreepayments.com/
362
401
  licenses:
@@ -1,17 +0,0 @@
1
- module Braintree
2
- class MerchantAccount
3
- class BusinessDetails
4
- include BaseModule
5
-
6
- attr_reader :address_details
7
- attr_reader :dba_name
8
- attr_reader :legal_name
9
- attr_reader :tax_id
10
-
11
- def initialize(attributes)
12
- set_instance_variables_from_hash attributes unless attributes.nil?
13
- @address_details = MerchantAccount::AddressDetails.new(@address)
14
- end
15
- end
16
- end
17
- end
@@ -1,18 +0,0 @@
1
- module Braintree
2
- class MerchantAccount
3
- class FundingDetails
4
- include BaseModule
5
-
6
- attr_reader :account_number_last_4
7
- attr_reader :descriptor
8
- attr_reader :destination
9
- attr_reader :email
10
- attr_reader :mobile_phone
11
- attr_reader :routing_number
12
-
13
- def initialize(attributes)
14
- set_instance_variables_from_hash attributes unless attributes.nil?
15
- end
16
- end
17
- end
18
- end
@@ -1,20 +0,0 @@
1
- module Braintree
2
- class MerchantAccount
3
- class IndividualDetails
4
- include BaseModule
5
-
6
- attr_reader :address_details
7
- attr_reader :date_of_birth
8
- attr_reader :email
9
- attr_reader :first_name
10
- attr_reader :last_name
11
- attr_reader :phone
12
- attr_reader :ssn_last_4
13
-
14
- def initialize(attributes)
15
- set_instance_variables_from_hash attributes unless attributes.nil?
16
- @address_details = MerchantAccount::AddressDetails.new(@address)
17
- end
18
- end
19
- end
20
- end
@@ -1,44 +0,0 @@
1
- -----BEGIN CERTIFICATE-----
2
- MIIDuDCCAqCgAwIBAgIQDPCOXAgWpa1Cf/DrJxhZ0DANBgkqhkiG9w0BAQUFADBI
3
- MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24x
4
- FzAVBgNVBAMTDlNlY3VyZVRydXN0IENBMB4XDTA2MTEwNzE5MzExOFoXDTI5MTIz
5
- MTE5NDA1NVowSDELMAkGA1UEBhMCVVMxIDAeBgNVBAoTF1NlY3VyZVRydXN0IENv
6
- cnBvcmF0aW9uMRcwFQYDVQQDEw5TZWN1cmVUcnVzdCBDQTCCASIwDQYJ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CRsoTciE6+OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXO
40
- H0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cnCDpOGR86p1hcF895P4vkp9Mm
41
- I50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/53CYNv6ZHdAbY
42
- iNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc
43
- f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW
44
- -----END CERTIFICATE-----
@@ -1,131 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
2
-
3
- describe Braintree::Disbursement do
4
- describe "new" do
5
- it "is protected" do
6
- expect do
7
- Braintree::Disbursement.new
8
- end.to raise_error(NoMethodError, /protected method .new/)
9
- end
10
- end
11
-
12
- describe "inspect" do
13
- it "prints attributes of disbursement object" do
14
- disbursement = Braintree::Disbursement._new(
15
- :gateway,
16
- :id => "123456",
17
- :merchant_account => {
18
- :id => "sandbox_sub_merchant_account",
19
- :master_merchant_account => {
20
- :id => "sandbox_master_merchant_account",
21
- :status => "active"
22
- },
23
- :status => "active"
24
- },
25
- :transaction_ids => ["sub_merchant_transaction"],
26
- :amount => "100.00",
27
- :disbursement_date => "2013-04-10",
28
- :exception_message => "invalid_account_number",
29
- :follow_up_action => "update",
30
- :retry => false,
31
- :success => false,
32
- )
33
-
34
- expect(disbursement.inspect).to include('id: "123456"')
35
- expect(disbursement.inspect).to include('amount: "100.0"')
36
- expect(disbursement.inspect).to include('exception_message: "invalid_account_number"')
37
- expect(disbursement.inspect).to include("disbursement_date: 2013-04-10")
38
- expect(disbursement.inspect).to include('follow_up_action: "update"')
39
- expect(disbursement.inspect).to include("merchant_account: #<Braintree::MerchantAccount: ")
40
- expect(disbursement.inspect).to include('transaction_ids: ["sub_merchant_transaction"]')
41
- expect(disbursement.inspect).to include("retry: false")
42
- expect(disbursement.inspect).to include("success: false")
43
- end
44
- end
45
-
46
- describe "success?" do
47
- it "is an alias of success" do
48
- disbursement = Braintree::Disbursement._new(
49
- :gateway,
50
- :merchant_account => {
51
- :id => "sandbox_sub_merchant_account",
52
- :master_merchant_account => {
53
- :id => "sandbox_master_merchant_account",
54
- :status => "active"
55
- },
56
- :status => "active"
57
- },
58
- :success => false,
59
- :disbursement_date => "2013-04-10",
60
- )
61
- expect(disbursement.success?).to eq(false)
62
-
63
- disbursement = Braintree::Disbursement._new(
64
- :gateway,
65
- :merchant_account => {
66
- :id => "sandbox_sub_merchant_account",
67
- :master_merchant_account => {
68
- :id => "sandbox_master_merchant_account",
69
- :status => "active"
70
- },
71
- :status => "active"
72
- },
73
- :success => true,
74
- :disbursement_date => "2013-04-10",
75
- )
76
- expect(disbursement.success?).to eq(true)
77
- end
78
- end
79
-
80
- describe "credit?" do
81
- subject do
82
- described_class._new(
83
- :gateway,
84
- merchant_account: {
85
- id: "sandbox_master_merchant_account",
86
- status: "active",
87
- },
88
- success: true,
89
- amount: "100.00",
90
- disbursement_type: type,
91
- disbursement_date: "2013-04-10",
92
- )
93
- end
94
-
95
- context "when the disbursement type is credit" do
96
- let(:type) { described_class::Types::Credit }
97
- it { is_expected.to be_credit }
98
- end
99
-
100
- context "when the disbursement type is not credit" do
101
- let(:type) { described_class::Types::Debit }
102
- it { is_expected.not_to be_credit }
103
- end
104
- end
105
-
106
- describe "debit?" do
107
- subject do
108
- described_class._new(
109
- :gateway,
110
- merchant_account: {
111
- id: "sandbox_master_merchant_account",
112
- status: "active",
113
- },
114
- success: true,
115
- amount: "100.00",
116
- disbursement_type: type,
117
- disbursement_date: "2013-04-10",
118
- )
119
- end
120
-
121
- context "when the disbursement type is debit" do
122
- let(:type) { described_class::Types::Debit }
123
- it { is_expected.to be_debit }
124
- end
125
-
126
- context "when the disbursement type is not debit" do
127
- let(:type) { described_class::Types::Credit }
128
- it { is_expected.not_to be_debit }
129
- end
130
- end
131
- end
@@ -1,33 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
2
-
3
- describe Braintree::MerchantAccount do
4
- describe "#inspect" do
5
- it "is a string representation of the merchant account" do
6
- account = Braintree::MerchantAccount._new(nil, :id => "merchant_account", :status => "active", :master_merchant_account => nil)
7
-
8
- expect(account.inspect).to eq("#<Braintree::MerchantAccount: id: \"merchant_account\", status: \"active\", master_merchant_account: nil>")
9
- end
10
-
11
- it "handles a master merchant account" do
12
- account = Braintree::MerchantAccount._new(
13
- nil,
14
- :id => "merchant_account",
15
- :status => "active",
16
- :master_merchant_account => {:id => "master_merchant_account", :status => "active", :master_merchant_account => nil},
17
- )
18
-
19
- master_merchant_account = "#<Braintree::MerchantAccount: id: \"master_merchant_account\", status: \"active\", master_merchant_account: nil>"
20
- expect(account.inspect).to eq("#<Braintree::MerchantAccount: id: \"merchant_account\", status: \"active\", master_merchant_account: #{master_merchant_account}>")
21
- end
22
- end
23
-
24
- describe "default?" do
25
- it "is an alias of default" do
26
- account = Braintree::MerchantAccount._new(nil, :default => false)
27
- expect(account.default?).to eq(false)
28
- account = Braintree::MerchantAccount._new(nil, :default => true)
29
- expect(account.default?).to eq(true)
30
- end
31
- end
32
- end
33
-