braintree 2.98.0 → 4.23.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 (308) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/braintree.gemspec +7 -4
  4. data/lib/braintree/account_updater_daily_report.rb +4 -4
  5. data/lib/braintree/ach_mandate.rb +1 -1
  6. data/lib/braintree/add_on_gateway.rb +1 -1
  7. data/lib/braintree/address.rb +7 -27
  8. data/lib/braintree/address_gateway.rb +8 -7
  9. data/lib/braintree/advanced_search.rb +11 -12
  10. data/lib/braintree/apple_pay.rb +4 -4
  11. data/lib/braintree/apple_pay_card.rb +18 -4
  12. data/lib/braintree/apple_pay_options.rb +4 -4
  13. data/lib/braintree/authorization_adjustment.rb +4 -4
  14. data/lib/braintree/base_module.rb +11 -1
  15. data/lib/braintree/bin_data.rb +10 -3
  16. data/lib/braintree/client_token.rb +1 -1
  17. data/lib/braintree/client_token_gateway.rb +4 -3
  18. data/lib/braintree/configuration.rb +35 -35
  19. data/lib/braintree/connected_merchant_paypal_status_changed.rb +2 -2
  20. data/lib/braintree/connected_merchant_status_transitioned.rb +2 -2
  21. data/lib/braintree/credit_card.rb +40 -86
  22. data/lib/braintree/credit_card_gateway.rb +58 -44
  23. data/lib/braintree/credit_card_verification.rb +39 -20
  24. data/lib/braintree/credit_card_verification_gateway.rb +35 -5
  25. data/lib/braintree/credit_card_verification_search.rb +2 -2
  26. data/lib/braintree/customer.rb +23 -88
  27. data/lib/braintree/customer_gateway.rb +17 -32
  28. data/lib/braintree/customer_search.rb +2 -2
  29. data/lib/braintree/descriptor.rb +1 -1
  30. data/lib/braintree/digest.rb +1 -1
  31. data/lib/braintree/disbursement.rb +7 -7
  32. data/lib/braintree/discount_gateway.rb +1 -1
  33. data/lib/braintree/dispute/evidence.rb +1 -1
  34. data/lib/braintree/{transaction/coinbase_details.rb → dispute/paypal_message.rb} +5 -6
  35. data/lib/braintree/dispute/{history_event.rb → status_history.rb} +3 -1
  36. data/lib/braintree/dispute/transaction.rb +3 -1
  37. data/lib/braintree/dispute/transaction_details.rb +1 -1
  38. data/lib/braintree/dispute.rb +47 -6
  39. data/lib/braintree/dispute_gateway.rb +5 -10
  40. data/lib/braintree/dispute_search.rb +8 -4
  41. data/lib/braintree/document_upload.rb +3 -3
  42. data/lib/braintree/document_upload_gateway.rb +3 -3
  43. data/lib/braintree/enriched_customer_data.rb +21 -0
  44. data/lib/braintree/error_codes.rb +217 -175
  45. data/lib/braintree/error_result.rb +2 -3
  46. data/lib/braintree/errors.rb +3 -3
  47. data/lib/braintree/exceptions.rb +6 -5
  48. data/lib/braintree/exchange_rate.rb +13 -0
  49. data/lib/braintree/exchange_rate_quote.rb +24 -0
  50. data/lib/braintree/exchange_rate_quote_gateway.rb +35 -0
  51. data/lib/braintree/exchange_rate_quote_input.rb +21 -0
  52. data/lib/braintree/exchange_rate_quote_request.rb +18 -0
  53. data/lib/braintree/exchange_rate_quote_response.rb +18 -0
  54. data/lib/braintree/facilitated_details.rb +1 -1
  55. data/lib/braintree/facilitator_details.rb +1 -1
  56. data/lib/braintree/gateway.rb +6 -12
  57. data/lib/braintree/{android_pay_card.rb → google_pay_card.rb} +18 -5
  58. data/lib/braintree/granted_payment_instrument_update.rb +2 -2
  59. data/lib/braintree/graphql_client.rb +14 -8
  60. data/lib/braintree/http.rb +9 -10
  61. data/lib/braintree/local_payment_completed/blik_alias.rb +23 -0
  62. data/lib/braintree/local_payment_completed.rb +10 -5
  63. data/lib/braintree/local_payment_expired.rb +21 -0
  64. data/lib/braintree/local_payment_funded.rb +22 -0
  65. data/lib/braintree/local_payment_reversed.rb +19 -0
  66. data/lib/braintree/merchant.rb +4 -4
  67. data/lib/braintree/merchant_account.rb +3 -3
  68. data/lib/braintree/merchant_account_gateway.rb +10 -8
  69. data/lib/braintree/merchant_gateway.rb +1 -1
  70. data/lib/braintree/meta_checkout_card.rb +89 -0
  71. data/lib/braintree/meta_checkout_token.rb +88 -0
  72. data/lib/braintree/modification.rb +4 -4
  73. data/lib/braintree/oauth_credentials.rb +4 -4
  74. data/lib/braintree/oauth_gateway.rb +5 -5
  75. data/lib/braintree/paginated_collection.rb +2 -2
  76. data/lib/braintree/paginated_result.rb +1 -1
  77. data/lib/braintree/payment_instrument_type.rb +14 -13
  78. data/lib/braintree/payment_method_customer_data_updated_metadata.rb +24 -0
  79. data/lib/braintree/payment_method_gateway.rb +52 -22
  80. data/lib/braintree/payment_method_nonce.rb +12 -7
  81. data/lib/braintree/payment_method_nonce_details.rb +40 -0
  82. data/lib/braintree/payment_method_nonce_details_payer_info.rb +32 -0
  83. data/lib/braintree/payment_method_nonce_gateway.rb +14 -3
  84. data/lib/braintree/payment_method_parser.rb +4 -7
  85. data/lib/braintree/paypal_account.rb +3 -2
  86. data/lib/braintree/paypal_account_gateway.rb +5 -5
  87. data/lib/braintree/plan.rb +22 -2
  88. data/lib/braintree/plan_gateway.rb +101 -1
  89. data/lib/braintree/processor_response_types.rb +3 -3
  90. data/lib/braintree/resource_collection.rb +10 -5
  91. data/lib/braintree/revoked_payment_method_metadata.rb +2 -2
  92. data/lib/braintree/risk_data/liability_shift.rb +22 -0
  93. data/lib/braintree/risk_data.rb +10 -3
  94. data/lib/braintree/samsung_pay_card.rb +8 -6
  95. data/lib/braintree/sepa_direct_debit_account.rb +60 -0
  96. data/lib/braintree/sepa_direct_debit_account_gateway.rb +25 -0
  97. data/lib/braintree/sepa_direct_debit_account_nonce_details.rb +28 -0
  98. data/lib/braintree/settlement_batch_summary.rb +2 -2
  99. data/lib/braintree/settlement_batch_summary_gateway.rb +1 -1
  100. data/lib/braintree/sha256_digest.rb +1 -1
  101. data/lib/braintree/subscription/status_details.rb +1 -1
  102. data/lib/braintree/subscription.rb +13 -13
  103. data/lib/braintree/subscription_gateway.rb +6 -6
  104. data/lib/braintree/subscription_search.rb +1 -1
  105. data/lib/braintree/successful_result.rb +5 -4
  106. data/lib/braintree/test/authentication_id.rb +21 -0
  107. data/lib/braintree/test/credit_card.rb +9 -10
  108. data/lib/braintree/test/merchant_account.rb +1 -1
  109. data/lib/braintree/test/nonce.rb +27 -20
  110. data/lib/braintree/test/transaction_amounts.rb +2 -3
  111. data/lib/braintree/test/venmo_sdk.rb +2 -0
  112. data/lib/braintree/testing_gateway.rb +1 -1
  113. data/lib/braintree/three_d_secure_info.rb +23 -11
  114. data/lib/braintree/transaction/address_details.rb +14 -1
  115. data/lib/braintree/transaction/apple_pay_details.rb +13 -10
  116. data/lib/braintree/transaction/credit_card_details.rb +8 -1
  117. data/lib/braintree/transaction/customer_details.rb +3 -2
  118. data/lib/braintree/transaction/disbursement_details.rb +2 -1
  119. data/lib/braintree/transaction/{android_pay_details.rb → google_pay_details.rb} +6 -1
  120. data/lib/braintree/transaction/installment/adjustment.rb +33 -0
  121. data/lib/braintree/transaction/installment.rb +28 -0
  122. data/lib/braintree/transaction/local_payment_details.rb +3 -0
  123. data/lib/braintree/transaction/meta_checkout_card_details.rb +52 -0
  124. data/lib/braintree/transaction/meta_checkout_token_details.rb +54 -0
  125. data/lib/braintree/transaction/package_details.rb +19 -0
  126. data/lib/braintree/transaction/payment_receipt/card_present_data.rb +36 -0
  127. data/lib/braintree/transaction/payment_receipt/merchant_address.rb +19 -0
  128. data/lib/braintree/transaction/payment_receipt.rb +31 -0
  129. data/lib/braintree/transaction/paypal_details.rb +5 -0
  130. data/lib/braintree/transaction/samsung_pay_card_details.rb +3 -1
  131. data/lib/braintree/transaction/sepa_direct_debit_account_details.rb +27 -0
  132. data/lib/braintree/transaction/status_details.rb +1 -1
  133. data/lib/braintree/transaction/subscription_details.rb +3 -1
  134. data/lib/braintree/transaction/us_bank_account_details.rb +2 -1
  135. data/lib/braintree/transaction/visa_checkout_card_details.rb +1 -1
  136. data/lib/braintree/transaction.rb +119 -128
  137. data/lib/braintree/transaction_gateway.rb +138 -64
  138. data/lib/braintree/transaction_line_item.rb +14 -11
  139. data/lib/braintree/transaction_line_item_gateway.rb +1 -1
  140. data/lib/braintree/transaction_review.rb +18 -0
  141. data/lib/braintree/transaction_search.rb +11 -7
  142. data/lib/braintree/unknown_payment_method.rb +2 -2
  143. data/lib/braintree/us_bank_account.rb +5 -5
  144. data/lib/braintree/us_bank_account_verification.rb +24 -16
  145. data/lib/braintree/us_bank_account_verification_gateway.rb +1 -1
  146. data/lib/braintree/us_bank_account_verification_search.rb +1 -1
  147. data/lib/braintree/util.rb +25 -10
  148. data/lib/braintree/validation_error.rb +1 -1
  149. data/lib/braintree/validation_error_collection.rb +3 -3
  150. data/lib/braintree/venmo_account.rb +4 -4
  151. data/lib/braintree/venmo_profile_data.rb +25 -0
  152. data/lib/braintree/version.rb +2 -2
  153. data/lib/braintree/visa_checkout_card.rb +8 -8
  154. data/lib/braintree/webhook_notification.rb +55 -33
  155. data/lib/braintree/webhook_notification_gateway.rb +9 -9
  156. data/lib/braintree/webhook_testing.rb +1 -1
  157. data/lib/braintree/webhook_testing_gateway.rb +569 -46
  158. data/lib/braintree/xml/generator.rb +6 -5
  159. data/lib/braintree/xml/libxml.rb +1 -1
  160. data/lib/braintree/xml/parser.rb +24 -37
  161. data/lib/braintree/xml/rexml.rb +6 -7
  162. data/lib/braintree/xml.rb +1 -1
  163. data/lib/braintree.rb +41 -24
  164. data/lib/ssl/api_braintreegateway_com.ca.crt +401 -168
  165. data/spec/integration/braintree/add_on_spec.rb +10 -10
  166. data/spec/integration/braintree/address_spec.rb +101 -178
  167. data/spec/integration/braintree/advanced_search_spec.rb +93 -93
  168. data/spec/integration/braintree/apple_pay_spec.rb +12 -12
  169. data/spec/integration/braintree/braintree_gateway_spec.rb +2 -1
  170. data/spec/integration/braintree/client_api/client_token_spec.rb +279 -62
  171. data/spec/integration/braintree/client_api/spec_helper.rb +99 -73
  172. data/spec/integration/braintree/credit_card_spec.rb +522 -821
  173. data/spec/integration/braintree/credit_card_verification_search_spec.rb +18 -18
  174. data/spec/integration/braintree/credit_card_verification_spec.rb +219 -30
  175. data/spec/integration/braintree/customer_search_spec.rb +28 -28
  176. data/spec/integration/braintree/customer_spec.rb +840 -757
  177. data/spec/integration/braintree/disbursement_spec.rb +2 -2
  178. data/spec/integration/braintree/discount_spec.rb +9 -9
  179. data/spec/integration/braintree/dispute_search_spec.rb +45 -9
  180. data/spec/integration/braintree/dispute_spec.rb +109 -82
  181. data/spec/integration/braintree/document_upload_spec.rb +29 -17
  182. data/spec/integration/braintree/error_codes_spec.rb +3 -3
  183. data/spec/integration/braintree/exchange_rate_quote_spec.rb +97 -0
  184. data/spec/integration/braintree/graphql_client_spec.rb +0 -2
  185. data/spec/integration/braintree/http_spec.rb +31 -33
  186. data/spec/integration/braintree/merchant_account_spec.rb +155 -156
  187. data/spec/integration/braintree/merchant_spec.rb +71 -192
  188. data/spec/integration/braintree/oauth_spec.rb +72 -72
  189. data/spec/integration/braintree/package_tracking_spec.rb +130 -0
  190. data/spec/integration/braintree/payment_method_nonce_spec.rb +173 -78
  191. data/spec/integration/braintree/payment_method_spec.rb +953 -501
  192. data/spec/integration/braintree/payment_method_us_bank_account_spec.rb +147 -234
  193. data/spec/integration/braintree/paypal_account_spec.rb +74 -72
  194. data/spec/integration/braintree/plan_spec.rb +96 -15
  195. data/spec/integration/braintree/samsung_pay_card_spec.rb +75 -73
  196. data/spec/integration/braintree/sepa_direct_debit_account_spec.rb +194 -0
  197. data/spec/integration/braintree/settlement_batch_summary_spec.rb +18 -18
  198. data/spec/integration/braintree/subscription_spec.rb +507 -513
  199. data/spec/integration/braintree/test/transaction_amounts_spec.rb +4 -4
  200. data/spec/integration/braintree/test_transaction_spec.rb +29 -29
  201. data/spec/integration/braintree/transaction_line_item_spec.rb +12 -6
  202. data/spec/integration/braintree/transaction_search_spec.rb +410 -217
  203. data/spec/integration/braintree/transaction_spec.rb +3252 -2102
  204. data/spec/integration/braintree/transaction_us_bank_account_spec.rb +42 -278
  205. data/spec/integration/braintree/us_bank_account_spec.rb +36 -36
  206. data/spec/integration/braintree/us_bank_account_verification_search_spec.rb +25 -25
  207. data/spec/integration/braintree/us_bank_account_verification_spec.rb +41 -41
  208. data/spec/integration/braintree/visa_checkout_card_spec.rb +62 -62
  209. data/spec/integration/spec_helper.rb +22 -7
  210. data/spec/oauth_test_helper.rb +1 -1
  211. data/spec/script/httpsd.rb +6 -6
  212. data/spec/spec_helper.rb +15 -20
  213. data/spec/unit/braintree/address_spec.rb +9 -17
  214. data/spec/unit/braintree/apple_pay_card_spec.rb +110 -7
  215. data/spec/unit/braintree/base_module_spec.rb +4 -4
  216. data/spec/unit/braintree/client_token_spec.rb +6 -6
  217. data/spec/unit/braintree/configuration_spec.rb +84 -84
  218. data/spec/unit/braintree/credentials_parser_spec.rb +6 -6
  219. data/spec/unit/braintree/credit_card_spec.rb +91 -58
  220. data/spec/unit/braintree/credit_card_verification_gateway_spec.rb +56 -0
  221. data/spec/unit/braintree/credit_card_verification_search_spec.rb +10 -10
  222. data/spec/unit/braintree/credit_card_verification_spec.rb +40 -18
  223. data/spec/unit/braintree/customer_spec.rb +102 -57
  224. data/spec/unit/braintree/digest_spec.rb +5 -6
  225. data/spec/unit/braintree/disbursement_spec.rb +14 -14
  226. data/spec/unit/braintree/dispute_search_spec.rb +6 -2
  227. data/spec/unit/braintree/dispute_spec.rb +144 -66
  228. data/spec/unit/braintree/document_upload_spec.rb +8 -8
  229. data/spec/unit/braintree/enriched_customer_data_spec.rb +41 -0
  230. data/spec/unit/braintree/error_result_spec.rb +11 -11
  231. data/spec/unit/braintree/errors_spec.rb +17 -17
  232. data/spec/unit/braintree/exchange_rate_quote_input_spec.rb +42 -0
  233. data/spec/unit/braintree/exchange_rate_quote_request_spec.rb +82 -0
  234. data/spec/unit/braintree/exchange_rate_quote_response_spec.rb +52 -0
  235. data/spec/unit/braintree/exchange_rate_quote_spec.rb +42 -0
  236. data/spec/unit/braintree/exchange_rate_spec.rb +23 -0
  237. data/spec/unit/braintree/http_spec.rb +19 -17
  238. data/spec/unit/braintree/local_payment_completed_spec.rb +62 -8
  239. data/spec/unit/braintree/local_payment_expired_spec.rb +24 -0
  240. data/spec/unit/braintree/local_payment_funded_spec.rb +34 -0
  241. data/spec/unit/braintree/merchant_account_spec.rb +5 -5
  242. data/spec/unit/braintree/meta_checkout_card_details_spec.rb +60 -0
  243. data/spec/unit/braintree/meta_checkout_card_spec.rb +60 -0
  244. data/spec/unit/braintree/meta_checkout_token_details_spec.rb +63 -0
  245. data/spec/unit/braintree/meta_checkout_token_spec.rb +63 -0
  246. data/spec/unit/braintree/modification_spec.rb +1 -1
  247. data/spec/unit/braintree/package_tracking_spec.rb +77 -0
  248. data/spec/unit/braintree/payment_method_customer_data_updated_metadata_spec.rb +45 -0
  249. data/spec/unit/braintree/payment_method_nonce_details_payer_info_spec.rb +31 -0
  250. data/spec/unit/braintree/payment_method_nonce_details_spec.rb +51 -0
  251. data/spec/unit/braintree/payment_method_nonce_spec.rb +40 -0
  252. data/spec/unit/braintree/payment_method_spec.rb +20 -20
  253. data/spec/unit/braintree/paypal_account_spec.rb +16 -7
  254. data/spec/unit/braintree/resource_collection_spec.rb +34 -5
  255. data/spec/unit/braintree/risk_data/liability_shift.rb +26 -0
  256. data/spec/unit/braintree/risk_data_spec.rb +38 -8
  257. data/spec/unit/braintree/sepa_debit_account_nonce_details_spec.rb +29 -0
  258. data/spec/unit/braintree/sepa_debit_account_spec.rb +86 -0
  259. data/spec/unit/braintree/sha256_digest_spec.rb +1 -1
  260. data/spec/unit/braintree/signature_service_spec.rb +2 -2
  261. data/spec/unit/braintree/subscription_search_spec.rb +18 -18
  262. data/spec/unit/braintree/subscription_spec.rb +8 -8
  263. data/spec/unit/braintree/successful_result_spec.rb +6 -6
  264. data/spec/unit/braintree/three_d_secure_info_spec.rb +37 -17
  265. data/spec/unit/braintree/transaction/credit_card_details_spec.rb +22 -6
  266. data/spec/unit/braintree/transaction/customer_details_spec.rb +3 -2
  267. data/spec/unit/braintree/transaction/deposit_details_spec.rb +4 -4
  268. data/spec/unit/braintree/transaction/installment_spec.rb +25 -0
  269. data/spec/unit/braintree/transaction/local_payment_details_spec.rb +36 -0
  270. data/spec/unit/braintree/transaction/payment_receipt_spec.rb +73 -0
  271. data/spec/unit/braintree/transaction/paypal_details_spec.rb +63 -0
  272. data/spec/unit/braintree/transaction/sepa_direct_debit_account_details_spec.rb +33 -0
  273. data/spec/unit/braintree/transaction_gateway_spec.rb +150 -0
  274. data/spec/unit/braintree/transaction_search_spec.rb +12 -12
  275. data/spec/unit/braintree/transaction_spec.rb +221 -124
  276. data/spec/unit/braintree/unknown_payment_method_spec.rb +4 -4
  277. data/spec/unit/braintree/us_bank_account_spec.rb +2 -2
  278. data/spec/unit/braintree/us_bank_account_verification_search_spec.rb +7 -7
  279. data/spec/unit/braintree/us_bank_account_verification_spec.rb +12 -7
  280. data/spec/unit/braintree/util_spec.rb +78 -44
  281. data/spec/unit/braintree/validation_error_collection_spec.rb +62 -62
  282. data/spec/unit/braintree/validation_error_spec.rb +4 -4
  283. data/spec/unit/braintree/venmo_profile_data_spec.rb +43 -0
  284. data/spec/unit/braintree/webhook_notification_spec.rb +434 -197
  285. data/spec/unit/braintree/xml/libxml_spec.rb +5 -5
  286. data/spec/unit/braintree/xml/parser_spec.rb +27 -22
  287. data/spec/unit/braintree/xml/rexml_spec.rb +5 -5
  288. data/spec/unit/braintree/xml_spec.rb +38 -38
  289. data/spec/unit/braintree_spec.rb +2 -2
  290. metadata +91 -30
  291. data/lib/braintree/amex_express_checkout_card.rb +0 -38
  292. data/lib/braintree/coinbase_account.rb +0 -34
  293. data/lib/braintree/europe_bank_account.rb +0 -36
  294. data/lib/braintree/europe_bank_account_gateway.rb +0 -17
  295. data/lib/braintree/ideal_payment.rb +0 -61
  296. data/lib/braintree/ideal_payment_gateway.rb +0 -19
  297. data/lib/braintree/masterpass_card.rb +0 -81
  298. data/lib/braintree/settlement_batch.rb +0 -0
  299. data/lib/braintree/transaction/amex_express_checkout_details.rb +0 -21
  300. data/lib/braintree/transaction/ideal_payment_details.rb +0 -19
  301. data/lib/braintree/transaction/masterpass_card_details.rb +0 -47
  302. data/lib/braintree/transparent_redirect.rb +0 -40
  303. data/lib/braintree/transparent_redirect_gateway.rb +0 -105
  304. data/spec/hacks/tcp_socket.rb +0 -18
  305. data/spec/integration/braintree/coinbase_spec.rb +0 -34
  306. data/spec/integration/braintree/masterpass_card_spec.rb +0 -97
  307. data/spec/integration/braintree/transparent_redirect_spec.rb +0 -268
  308. data/spec/unit/braintree/transparent_redirect_spec.rb +0 -223
@@ -11,11 +11,11 @@ module Braintree
11
11
  end
12
12
 
13
13
  module Status
14
- Active = 'Active'
15
- Canceled = 'Canceled'
16
- Expired = 'Expired'
17
- PastDue = 'Past Due'
18
- Pending = 'Pending'
14
+ Active = "Active"
15
+ Canceled = "Canceled"
16
+ Expired = "Expired"
17
+ PastDue = "Past Due"
18
+ Pending = "Pending"
19
19
 
20
20
  All = constants.map { |c| const_get(c) }
21
21
  end
@@ -91,7 +91,7 @@ module Braintree
91
91
  Configuration.gateway.subscription.update!(*args)
92
92
  end
93
93
 
94
- def initialize(gateway, attributes) # :nodoc:
94
+ def initialize(gateway, attributes)
95
95
  @gateway = gateway
96
96
  set_instance_variables_from_hash(attributes)
97
97
  @balance = Util.to_big_decimal(balance)
@@ -101,11 +101,11 @@ module Braintree
101
101
  add_ons.map! { |attrs| AddOn._new(attrs) }
102
102
  discounts.map! { |attrs| Discount._new(attrs) }
103
103
  @status_history = attributes[:status_history] ? attributes[:status_history].map { |s| StatusDetails.new(s) } : []
104
- end
105
-
106
- def next_bill_amount
107
- warn "[DEPRECATED] Subscription.next_bill_amount is deprecated. Please use Subscription.next_billing_period_amount"
108
- @next_bill_amount
104
+ @first_billing_date = Date.parse(first_billing_date) unless first_billing_date.nil?
105
+ @next_billing_date = Date.parse(next_billing_date) unless next_billing_date.nil?
106
+ @billing_period_start_date = Date.parse(billing_period_start_date) unless billing_period_start_date.nil?
107
+ @billing_period_end_date = Date.parse(billing_period_end_date) unless billing_period_end_date.nil?
108
+ @paid_through_date = Date.parse(paid_through_date) unless paid_through_date.nil?
109
109
  end
110
110
 
111
111
  def never_expires?
@@ -114,8 +114,8 @@ module Braintree
114
114
 
115
115
  class << self
116
116
  protected :new
117
- def _new(*args) # :nodoc:
118
- self.new *args
117
+ def _new(*args)
118
+ self.new(*args)
119
119
  end
120
120
  end
121
121
  end
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class SubscriptionGateway # :nodoc:
2
+ class SubscriptionGateway
3
3
  include BaseModule
4
4
 
5
5
  def initialize(gateway)
@@ -70,7 +70,7 @@ module Braintree
70
70
  return_object_or_raise(:subscription) { update(*args) }
71
71
  end
72
72
 
73
- def self._create_signature # :nodoc:
73
+ def self._create_signature
74
74
  [
75
75
  :billing_day_of_month,
76
76
  :first_billing_date,
@@ -94,7 +94,7 @@ module Braintree
94
94
  ] + _add_on_discount_signature
95
95
  end
96
96
 
97
- def self._update_signature # :nodoc:
97
+ def self._update_signature
98
98
  [
99
99
  :id,
100
100
  :merchant_account_id,
@@ -114,7 +114,7 @@ module Braintree
114
114
  ] + _add_on_discount_signature
115
115
  end
116
116
 
117
- def self._add_on_discount_signature # :nodoc:
117
+ def self._add_on_discount_signature
118
118
  [
119
119
  {
120
120
  :add_ons => [
@@ -133,7 +133,7 @@ module Braintree
133
133
  ]
134
134
  end
135
135
 
136
- def _do_create(path, params) # :nodoc:
136
+ def _do_create(path, params)
137
137
  response = @config.http.post("#{@config.base_merchant_path}#{path}", params)
138
138
  if response[:subscription]
139
139
  SuccessfulResult.new(:subscription => Subscription._new(@gateway, response[:subscription]))
@@ -144,7 +144,7 @@ module Braintree
144
144
  end
145
145
  end
146
146
 
147
- def _fetch_subscriptions(search, ids) # :nodoc:
147
+ def _fetch_subscriptions(search, ids)
148
148
  search.ids.in ids
149
149
  response = @config.http.post("#{@config.base_merchant_path}/subscriptions/advanced_search", {:search => search.to_hash})
150
150
  attributes = response[:subscriptions]
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class SubscriptionSearch < AdvancedSearch # :nodoc:
2
+ class SubscriptionSearch < AdvancedSearch
3
3
  multiple_value_field :in_trial_period
4
4
  multiple_value_field :ids
5
5
  text_fields :id, :transaction_id
@@ -6,25 +6,26 @@ module Braintree
6
6
  attr_reader :apple_pay_options
7
7
  attr_reader :credentials
8
8
  attr_reader :credit_card
9
+ attr_reader :credit_card_verification
9
10
  attr_reader :customer
10
11
  attr_reader :disputes
11
12
  attr_reader :document_upload
12
13
  attr_reader :evidence
14
+ attr_reader :exchange_rate_quote_payload
13
15
  attr_reader :merchant
14
16
  attr_reader :merchant_account
15
17
  attr_reader :merchant_accounts
16
- attr_reader :new_transaction
17
18
  attr_reader :payment_method
18
19
  attr_reader :payment_method_nonce
19
20
  attr_reader :paypal_account
21
+ attr_reader :plan
20
22
  attr_reader :settlement_batch_summary
21
23
  attr_reader :subscription
22
24
  attr_reader :supported_networks
23
25
  attr_reader :transaction
24
26
  attr_reader :us_bank_account_verification
25
- attr_reader :credit_card_verification
26
27
 
27
- def initialize(attributes = {}) # :nodoc:
28
+ def initialize(attributes = {})
28
29
  @attrs = attributes.keys
29
30
  attributes.each do |key, value|
30
31
  instance_variable_set("@#{key}", value)
@@ -32,7 +33,7 @@ module Braintree
32
33
  @credit_card_verification = @verification
33
34
  end
34
35
 
35
- def inspect # :nodoc:
36
+ def inspect
36
37
  inspected_attributes = @attrs.map { |attr| "#{attr}:#{send(attr).inspect}" }
37
38
  "#<#{self.class} #{inspected_attributes.join(" ")}>"
38
39
  end
@@ -0,0 +1,21 @@
1
+ module Braintree
2
+ module Test
3
+ module AuthenticationId
4
+ ThreeDSecureVisaFullAuthentication = "fake-three-d-secure-visa-full-authentication-id"
5
+ ThreeDSecureVisaLookupTimeout = "fake-three-d-secure-visa-lookup-timeout-id"
6
+ ThreeDSecureVisaFailedSignature = "fake-three-d-secure-visa-failed-signature-id"
7
+ ThreeDSecureVisaFailedAuthentication = "fake-three-d-secure-visa-failed-authentication-id"
8
+ ThreeDSecureVisaAttemptsNonParticipating = "fake-three-d-secure-visa-attempts-non-participating-id"
9
+ ThreeDSecureVisaNoteEnrolled = "fake-three-d-secure-visa-not-enrolled-id"
10
+ ThreeDSecureVisaUnavailable = "fake-three-d-secure-visa-unavailable-id"
11
+ ThreeDSecureVisaMPILookupError = "fake-three-d-secure-visa-mpi-lookup-error-id"
12
+ ThreeDSecureVisaMPIAuthenticateError = "fake-three-d-secure-visa-mpi-authenticate-error-id"
13
+ ThreeDSecureVisaAuthenticationUnavailable = "fake-three-d-secure-visa-authentication-unavailable-id"
14
+ ThreeDSecureVisaBypassedAuthentication = "fake-three-d-secure-visa-bypassed-authentication-id"
15
+ ThreeDSecureTwoVisaSuccessfulFrictionlessAuthentication = "fake-three-d-secure-two-visa-successful-frictionless-authentication-id"
16
+ ThreeDSecureTwoVisaSuccessfulStepUpAuthentication = "fake-three-d-secure-two-visa-successful-step-up-authentication-id"
17
+ ThreeDSecureTwoVisaErrorOnLookup = "fake-three-d-secure-two-visa-error-on-lookup-id"
18
+ ThreeDSecureTwoVisaTimeoutOnLookup = "fake-three-d-secure-two-visa-timeout-on-lookup-id"
19
+ end
20
+ end
21
+ end
@@ -1,8 +1,5 @@
1
1
  module Braintree
2
- module Test # :nodoc:
3
- # The constants contained in the Braintree::Test::CreditCardNumbers module provide
4
- # credit card numbers that should be used when working in the sandbox environment. The sandbox
5
- # will not accept any credit card numbers other than the ones listed below.
2
+ module Test
6
3
  module CreditCardNumbers
7
4
  module CardTypeIndicators
8
5
  Prepaid = "4111111111111210"
@@ -18,16 +15,16 @@ module Braintree
18
15
  end
19
16
 
20
17
  AmExes = %w[378282246310005 371449635398431 378734493671000]
21
- CarteBlanches = %w[30569309025904] # :nodoc:
22
- DinersClubs = %w[38520000023237] # :nodoc:
18
+ CarteBlanches = %w[30569309025904]
19
+ DinersClubs = %w[38520000023237]
23
20
 
24
21
  Discover = "6011111111111117"
25
22
  Discovers = %w[6011111111111117 6011000990139424]
26
- JCBs = %w[3530111333300000 3566002020360505] # :nodoc:
23
+ JCBs = %w[3530111333300000 3566002020360505]
27
24
 
28
- Maestro = "6304000000000000" # :nodoc:
25
+ Maestro = "6304000000000000"
29
26
  MasterCard = "5555555555554444"
30
- MasterCardInternational = "5105105105105100" # :nodoc:
27
+ MasterCardInternational = "5105105105105100"
31
28
 
32
29
  MasterCards = %w[5105105105105100 5555555555554444]
33
30
 
@@ -36,10 +33,12 @@ module Braintree
36
33
  Hipercard = "6062820524845321"
37
34
 
38
35
  Visa = "4012888888881881"
39
- VisaInternational = "4009348888881881" # :nodoc:
36
+ VisaCountryOfIssuanceIE = "4023490000000008"
37
+ VisaInternational = "4009348888881881"
40
38
  VisaPrepaid = "4500600000000061"
41
39
 
42
40
  Fraud = "4000111111111511"
41
+ RiskThreshold = "4111130000000003"
43
42
 
44
43
  Visas = %w[4009348888881881 4012888888881881 4111111111111111 4000111111111115 4500600000000061]
45
44
  Unknowns = %w[1000000000000008]
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- module Test # :nodoc:
2
+ module Test
3
3
  module MerchantAccount
4
4
  Approve = "approve_me"
5
5
 
@@ -4,23 +4,39 @@ module Braintree
4
4
  Transactable = "fake-valid-nonce"
5
5
  Consumed = "fake-consumed-nonce"
6
6
  PayPalOneTimePayment = "fake-paypal-one-time-nonce"
7
+ #NEXT_MAJOR_VERSION - no longer supported in the Gateway, remove this constant
7
8
  PayPalFuturePayment = "fake-paypal-future-nonce"
8
9
  PayPalBillingAgreement = "fake-paypal-billing-agreement-nonce"
9
10
  LocalPayment = "fake-local-payment-method-nonce"
10
11
  ApplePayVisa = "fake-apple-pay-visa-nonce"
11
12
  ApplePayMasterCard = "fake-apple-pay-mastercard-nonce"
12
13
  ApplePayAmEx = "fake-apple-pay-amex-nonce"
14
+ ApplePayMpan = "fake-apple-pay-mpan-nonce"
13
15
  AbstractTransactable = "fake-abstract-transactable-nonce"
14
16
  Europe = "fake-europe-bank-account-nonce"
15
- Coinbase = "fake-coinbase-nonce"
16
- AndroidPayDiscover = "fake-android-pay-discover-nonce"
17
- AndroidPayVisa = "fake-android-pay-visa-nonce"
18
- AndroidPayMasterCard = "fake-android-pay-mastercard-nonce"
19
- AndroidPayAmEx = "fake-android-pay-amex-nonce"
20
- AmexExpressCheckout = "fake-amex-express-checkout-nonce"
17
+ GooglePayDiscover = "fake-android-pay-discover-nonce"
18
+ GooglePayVisa = "fake-android-pay-visa-nonce"
19
+ GooglePayMasterCard = "fake-android-pay-mastercard-nonce"
20
+ GooglePayAmEx = "fake-android-pay-amex-nonce"
21
+ MetaCheckoutCard = "fake-meta-checkout-card-nonce"
22
+ MetaCheckoutToken = "fake-meta-checkout-token-nonce"
21
23
  VenmoAccount = "fake-venmo-account-nonce"
22
24
  VenmoAccountTokenIssuanceError = "fake-token-issuance-error-venmo-account-nonce"
23
25
  ThreeDSecureVisaFullAuthentication = "fake-three-d-secure-visa-full-authentication-nonce"
26
+ ThreeDSecureVisaLookupTimeout = "fake-three-d-secure-visa-lookup-timeout-nonce"
27
+ ThreeDSecureVisaFailedSignature = "fake-three-d-secure-visa-failed-signature-nonce"
28
+ ThreeDSecureVisaFailedAuthentication = "fake-three-d-secure-visa-failed-authentication-nonce"
29
+ ThreeDSecureVisaAttemptsNonParticipating = "fake-three-d-secure-visa-attempts-non-participating-nonce"
30
+ ThreeDSecureVisaNoteEnrolled = "fake-three-d-secure-visa-not-enrolled-nonce"
31
+ ThreeDSecureVisaUnavailable = "fake-three-d-secure-visa-unavailable-nonce"
32
+ ThreeDSecureVisaMPILookupError = "fake-three-d-secure-visa-mpi-lookup-error-nonce"
33
+ ThreeDSecureVisaMPIAuthenticateError = "fake-three-d-secure-visa-mpi-authenticate-error-nonce"
34
+ ThreeDSecureVisaAuthenticationUnavailable = "fake-three-d-secure-visa-authentication-unavailable-nonce"
35
+ ThreeDSecureVisaBypassedAuthentication = "fake-three-d-secure-visa-bypassed-authentication-nonce"
36
+ ThreeDSecureTwoVisaSuccessfulFrictionlessAuthentication = "fake-three-d-secure-two-visa-successful-frictionless-authentication-nonce"
37
+ ThreeDSecureTwoVisaSuccessfulStepUpAuthentication = "fake-three-d-secure-two-visa-successful-step-up-authentication-nonce"
38
+ ThreeDSecureTwoVisaErrorOnLookup = "fake-three-d-secure-two-visa-error-on-lookup-nonce"
39
+ ThreeDSecureTwoVisaTimeoutOnLookup = "fake-three-d-secure-two-visa-timeout-on-lookup-nonce"
24
40
  TransactableVisa = "fake-valid-visa-nonce"
25
41
  TransactableAmEx = "fake-valid-amex-nonce"
26
42
  TransactableMasterCard = "fake-valid-mastercard-nonce"
@@ -39,6 +55,7 @@ module Braintree
39
55
  TransactableCountryOfIssuanceUSA = "fake-valid-country-of-issuance-usa-nonce"
40
56
  TransactableCountryOfIssuanceCAD = "fake-valid-country-of-issuance-cad-nonce"
41
57
  TransactableIssuingBankNetworkOnly = "fake-valid-issuing-bank-network-only-nonce"
58
+ TransactablePinlessDebitVisa = "fake-pinless-debit-visa-nonce"
42
59
  ProcessorDeclinedVisa = "fake-processor-declined-visa-nonce"
43
60
  ProcessorDeclinedMasterCard = "fake-processor-declined-mastercard-nonce"
44
61
  ProcessorDeclinedAmEx = "fake-processor-declined-amex-nonce"
@@ -46,29 +63,19 @@ module Braintree
46
63
  ProcessorFailureJCB = "fake-processor-failure-jcb-nonce"
47
64
  LuhnInvalid = "fake-luhn-invalid-nonce"
48
65
  PayPalFuturePaymentRefreshToken = "fake-paypal-future-refresh-token-nonce"
49
- SEPA = "fake-sepa-bank-account-nonce"
50
66
  GatewayRejectedFraud = "fake-gateway-rejected-fraud-nonce"
51
- MasterpassAmEx = "fake-masterpass-amex-nonce"
52
- MasterpassDiscover = "fake-masterpass-discover-nonce"
53
- MasterpassMasterCard = "fake-masterpass-mastercard-nonce"
54
- MasterpassVisa = "fake-masterpass-visa-nonce"
67
+ GatewayRejectedRiskThresholds = "fake-gateway-rejected-risk-thresholds-nonce"
55
68
  VisaCheckoutAmEx = "fake-visa-checkout-amex-nonce"
56
69
  VisaCheckoutDiscover = "fake-visa-checkout-discover-nonce"
57
70
  VisaCheckoutMasterCard = "fake-visa-checkout-mastercard-nonce"
58
71
  VisaCheckoutVisa = "fake-visa-checkout-visa-nonce"
72
+ # NEXT_MAJOR_VERSION SamsungPay is deprecated, remove all associated nonces
59
73
  SamsungPayAmEx = "tokensam_fake_american_express"
60
74
  SamsungPayDiscover = "tokensam_fake_discover"
61
75
  SamsungPayMasterCard = "tokensam_fake_mastercard"
62
76
  SamsungPayVisa = "tokensam_fake_visa"
63
-
64
- def self.const_missing(const_name)
65
- if const_name == :AndroidPay
66
- warn "[DEPRECATED] Braintree::Test::Nonce::AndroidPay is deprecated. Use a card-specific nonce, e.g. Braintree::Test::Nonce::AndroidPayMasterCard"
67
- "fake-android-pay-nonce"
68
- else
69
- super
70
- end
71
- end
77
+ SepaDirectDebit = "fake-sepa-direct-debit-nonce"
78
+ UsBankAccount = "fake-us-bank-account-nonce"
72
79
  end
73
80
  end
74
81
  end
@@ -1,7 +1,6 @@
1
1
  module Braintree
2
- module Test # :nodoc:
3
- # The constants in this module can be used to create transactions with
4
- # the desired status in the sandbox environment.
2
+ module Test
3
+ # NEXT_MAJOR_VERSION are these even being used anymore? Can we remove this class??
5
4
  module TransactionAmounts
6
5
  Authorize = "1000.00"
7
6
  Decline = "2000.00"
@@ -1,3 +1,5 @@
1
+ # NEXT_MAJOR_VERSION Remove this class
2
+ # The old venmo SDK class has been deprecated
1
3
  module Braintree
2
4
  module Test
3
5
  module VenmoSDK
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class TestingGateway # :nodoc:
2
+ class TestingGateway
3
3
 
4
4
  def initialize(gateway)
5
5
  @gateway = gateway
@@ -1,16 +1,22 @@
1
1
  module Braintree
2
- class ThreeDSecureInfo # :nodoc:
2
+ class ThreeDSecureInfo
3
3
  include BaseModule
4
4
 
5
+ attr_reader :acs_transaction_id
6
+ attr_reader :cavv
7
+ attr_reader :ds_transaction_id
8
+ attr_reader :eci_flag
5
9
  attr_reader :enrolled
6
- attr_reader :liability_shifted
7
10
  attr_reader :liability_shift_possible
11
+ attr_reader :liability_shifted
12
+ attr_reader :pares_status
8
13
  attr_reader :status
9
- attr_reader :cavv
10
- attr_reader :xid
11
- attr_reader :eci_flag
14
+ attr_reader :three_d_secure_authentication_id
15
+ attr_reader :three_d_secure_transaction_id
12
16
  attr_reader :three_d_secure_version
13
- attr_reader :ds_transaction_id
17
+ attr_reader :xid
18
+ attr_reader :lookup
19
+ attr_reader :authentication
14
20
 
15
21
  alias_method :liability_shifted?, :liability_shifted
16
22
  alias_method :liability_shift_possible?, :liability_shift_possible
@@ -21,15 +27,21 @@ module Braintree
21
27
 
22
28
  def inspect
23
29
  attr_order = [
30
+ :acs_transaction_id,
31
+ :authentication,
32
+ :cavv,
33
+ :ds_transaction_id,
34
+ :eci_flag,
24
35
  :enrolled,
25
- :liability_shifted,
26
36
  :liability_shift_possible,
37
+ :liability_shifted,
38
+ :lookup,
39
+ :pares_status,
27
40
  :status,
28
- :cavv,
29
- :xid,
30
- :eci_flag,
41
+ :three_d_secure_authentication_id,
42
+ :three_d_secure_transaction_id,
31
43
  :three_d_secure_version,
32
- :ds_transaction_id,
44
+ :xid
33
45
  ]
34
46
 
35
47
  formatted_attrs = attr_order.map do |attr|
@@ -1,8 +1,18 @@
1
1
  module Braintree
2
2
  class Transaction
3
- class AddressDetails # :nodoc:
3
+ class AddressDetails
4
4
  include BaseModule
5
5
 
6
+ module ShippingMethod
7
+ SameDay = "same_day"
8
+ NextDay = "next_day"
9
+ Priority = "priority"
10
+ Ground = "ground"
11
+ Electronic = "electronic"
12
+ ShipToStore = "ship_to_store"
13
+ PickupInStore = "pickup_in_store"
14
+ end
15
+
6
16
  attr_reader :company
7
17
  attr_reader :country_code_alpha2
8
18
  attr_reader :country_code_alpha3
@@ -11,10 +21,13 @@ module Braintree
11
21
  attr_reader :extended_address
12
22
  attr_reader :first_name
13
23
  attr_reader :id
24
+ attr_reader :international_phone
14
25
  attr_reader :last_name
15
26
  attr_reader :locality
27
+ attr_reader :phone_number
16
28
  attr_reader :postal_code
17
29
  attr_reader :region
30
+ attr_reader :shipping_method
18
31
  attr_reader :street_address
19
32
 
20
33
  def initialize(attributes)
@@ -3,25 +3,28 @@ module Braintree
3
3
  class ApplePayDetails
4
4
  include BaseModule
5
5
 
6
+ attr_reader :bin
6
7
  attr_reader :card_type
7
8
  attr_reader :cardholder_name
9
+ attr_reader :commercial
10
+ attr_reader :country_of_issuance
11
+ attr_reader :debit
12
+ attr_reader :durbin_regulated
8
13
  attr_reader :expiration_month
9
14
  attr_reader :expiration_year
15
+ attr_reader :global_id
16
+ attr_reader :healthcare
10
17
  attr_reader :image_url
18
+ attr_reader :issuing_bank
11
19
  attr_reader :last_4
20
+ attr_reader :merchant_token_identifier
12
21
  attr_reader :payment_instrument_name
13
- attr_reader :source_description
14
- attr_reader :token
15
- attr_reader :prepaid
16
- attr_reader :healthcare
17
- attr_reader :debit
18
- attr_reader :durbin_regulated
19
- attr_reader :commercial
20
22
  attr_reader :payroll
21
- attr_reader :issuing_bank
22
- attr_reader :country_of_issuance
23
+ attr_reader :prepaid
23
24
  attr_reader :product_id
24
- attr_reader :global_id
25
+ attr_reader :source_card_last4
26
+ attr_reader :source_description
27
+ attr_reader :token
25
28
 
26
29
  def initialize(attributes)
27
30
  set_instance_variables_from_hash attributes unless attributes.nil?
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
2
  class Transaction
3
- class CreditCardDetails # :nodoc:
3
+ class CreditCardDetails
4
4
  include BaseModule
5
5
 
6
6
  attr_reader :account_type
@@ -64,9 +64,16 @@ module Braintree
64
64
  "#{bin}******#{last_4}"
65
65
  end
66
66
 
67
+ # NEXT_MAJOR_VERSION Remove this method
68
+ # The old venmo SDK class has been deprecated
67
69
  def venmo_sdk?
70
+ warn "[DEPRECATED] The Venmo SDK integration is Unsupported. Please update your integration to use Pay with Venmo instead."
68
71
  @venmo_sdk
69
72
  end
73
+
74
+ def is_network_tokenized?
75
+ @is_network_tokenized
76
+ end
70
77
  end
71
78
  end
72
79
  end
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
2
  class Transaction
3
- class CustomerDetails # :nodoc:
3
+ class CustomerDetails
4
4
  include BaseModule
5
5
 
6
6
  attr_reader :company
@@ -8,6 +8,7 @@ module Braintree
8
8
  attr_reader :fax
9
9
  attr_reader :first_name
10
10
  attr_reader :id
11
+ attr_reader :international_phone
11
12
  attr_reader :last_name
12
13
  attr_reader :phone
13
14
  attr_reader :website
@@ -17,7 +18,7 @@ module Braintree
17
18
  end
18
19
 
19
20
  def inspect
20
- attr_order = [:id, :first_name, :last_name, :email, :company, :website, :phone, :fax]
21
+ attr_order = [:id, :first_name, :last_name, :email, :company, :website, :phone, :international_phone, :fax]
21
22
  formatted_attrs = attr_order.map do |attr|
22
23
  "#{attr}: #{send(attr).inspect}"
23
24
  end
@@ -1,6 +1,6 @@
1
1
  module Braintree
2
2
  class Transaction
3
- class DisbursementDetails # :nodoc:
3
+ class DisbursementDetails
4
4
  include BaseModule
5
5
 
6
6
  attr_reader :disbursement_date
@@ -13,6 +13,7 @@ module Braintree
13
13
 
14
14
  def initialize(attributes)
15
15
  set_instance_variables_from_hash attributes unless attributes.nil?
16
+ @disbursement_date = Date.parse(disbursement_date) unless disbursement_date.nil?
16
17
  end
17
18
 
18
19
  def funds_held?
@@ -1,8 +1,9 @@
1
1
  module Braintree
2
2
  class Transaction
3
- class AndroidPayDetails
3
+ class GooglePayDetails
4
4
  include BaseModule
5
5
 
6
+ attr_reader :bin
6
7
  attr_reader :card_type
7
8
  attr_reader :expiration_month
8
9
  attr_reader :expiration_year
@@ -31,6 +32,10 @@ module Braintree
31
32
  @card_type = @virtual_card_type
32
33
  @last_4 = @virtual_card_last_4
33
34
  end
35
+
36
+ def is_network_tokenized?
37
+ @is_network_tokenized
38
+ end
34
39
  end
35
40
  end
36
41
  end
@@ -0,0 +1,33 @@
1
+ module Braintree
2
+ class Transaction
3
+ class Installment
4
+ class Adjustment
5
+ include BaseModule
6
+
7
+ module Kind
8
+ Refund = "REFUND"
9
+ Dispute = "DISPUTE"
10
+ end
11
+
12
+ attr_reader :amount
13
+ attr_reader :kind
14
+ attr_reader :projected_disbursement_date
15
+ attr_reader :actual_disbursement_date
16
+
17
+ def initialize(attributes)
18
+ set_instance_variables_from_hash attributes unless attributes.nil?
19
+ @amount = Util.to_big_decimal(amount)
20
+ end
21
+
22
+ def inspect
23
+ attrs = [:amount, :kind, :projected_disbursement_date, :actual_disbursement_date]
24
+ formatted_attrs = attrs.map do |attr|
25
+ "#{attr}: #{send(attr).inspect}"
26
+ end
27
+
28
+ "#<#{formatted_attrs.join(", ")}>"
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,28 @@
1
+ module Braintree
2
+ class Transaction
3
+ class Installment
4
+ include BaseModule
5
+
6
+ attr_reader :id
7
+ attr_reader :amount
8
+ attr_reader :projected_disbursement_date
9
+ attr_reader :actual_disbursement_date
10
+ attr_reader :adjustments
11
+
12
+ def initialize(attributes)
13
+ set_instance_variables_from_hash attributes unless attributes.nil?
14
+ @amount = Util.to_big_decimal(amount)
15
+ adjustments.map! { |attrs| Adjustment.new(attrs) } if adjustments
16
+ end
17
+
18
+ def inspect
19
+ attrs = [:id, :amount, :projected_disbursement_date, :actual_disbursement_date, :adjustments]
20
+ formatted_attrs = attrs.map do |attr|
21
+ "#{attr}: #{send(attr).inspect}"
22
+ end
23
+
24
+ "#<#{formatted_attrs.join(", ")}>"
25
+ end
26
+ end
27
+ end
28
+ end
@@ -3,11 +3,14 @@ module Braintree
3
3
  class LocalPaymentDetails
4
4
  include BaseModule
5
5
 
6
+ attr_reader :blik_aliases
6
7
  attr_reader :capture_id
7
8
  attr_reader :custom_field
8
9
  attr_reader :debug_id
9
10
  attr_reader :description
10
11
  attr_reader :funding_source
12
+ attr_reader :implicitly_vaulted_payment_method_global_id
13
+ attr_reader :implicitly_vaulted_payment_method_token
11
14
  attr_reader :payer_id
12
15
  attr_reader :payment_id
13
16
  attr_reader :refund_from_transaction_fee_amount