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
@@ -1,5 +1,5 @@
1
1
  module Braintree
2
- class WebhookTestingGateway # :nodoc:
2
+ class WebhookTestingGateway
3
3
  def initialize(gateway)
4
4
  @gateway = gateway
5
5
  @config = gateway.config
@@ -34,10 +34,20 @@ module Braintree
34
34
  case kind
35
35
  when Braintree::WebhookNotification::Kind::Check
36
36
  _check
37
- when Braintree::WebhookNotification::Kind::DisputeOpened
38
- _dispute_opened_sample_xml(id)
37
+ when Braintree::WebhookNotification::Kind::DisputeAccepted
38
+ _dispute_accepted_sample_xml(id)
39
+ when Braintree::WebhookNotification::Kind::DisputeAutoAccepted
40
+ _dispute_auto_accepted_sample_xml(id)
41
+ when Braintree::WebhookNotification::Kind::DisputeDisputed
42
+ _dispute_disputed_sample_xml(id)
43
+ when Braintree::WebhookNotification::Kind::DisputeExpired
44
+ _dispute_expired_sample_xml(id)
39
45
  when Braintree::WebhookNotification::Kind::DisputeLost
40
46
  _dispute_lost_sample_xml(id)
47
+ when Braintree::WebhookNotification::Kind::DisputeOpened
48
+ _dispute_opened_sample_xml(id)
49
+ when Braintree::WebhookNotification::Kind::DisputeUnderReview
50
+ _dispute_under_review_sample_xml(id)
41
51
  when Braintree::WebhookNotification::Kind::DisputeWon
42
52
  _dispute_won_sample_xml(id)
43
53
  when Braintree::WebhookNotification::Kind::PartnerMerchantConnected
@@ -54,6 +64,8 @@ module Braintree
54
64
  _merchant_account_declined_sample_xml(id)
55
65
  when Braintree::WebhookNotification::Kind::TransactionDisbursed
56
66
  _transaction_disbursed_sample_xml(id)
67
+ when Braintree::WebhookNotification::Kind::TransactionReviewed
68
+ _transaction_reviewed_sample_xml(id)
57
69
  when Braintree::WebhookNotification::Kind::TransactionSettled
58
70
  _transaction_settled_sample_xml(id)
59
71
  when Braintree::WebhookNotification::Kind::TransactionSettlementDeclined
@@ -62,6 +74,8 @@ module Braintree
62
74
  _disbursement_exception_sample_xml(id)
63
75
  when Braintree::WebhookNotification::Kind::Disbursement
64
76
  _disbursement_sample_xml(id)
77
+ when Braintree::WebhookNotification::Kind::SubscriptionBillingSkipped
78
+ _subscription_billing_skipped(id)
65
79
  when Braintree::WebhookNotification::Kind::SubscriptionChargedSuccessfully
66
80
  _subscription_charged_successfully(id)
67
81
  when Braintree::WebhookNotification::Kind::SubscriptionChargedUnsuccessfully
@@ -72,25 +86,26 @@ module Braintree
72
86
  _auth_status_transitioned_sample_xml(id)
73
87
  when Braintree::WebhookNotification::Kind::ConnectedMerchantPayPalStatusChanged
74
88
  _auth_paypal_status_changed_sample_xml(id)
75
- # NEXT_MAJOR_VERSION Remove this class as legacy Ideal has been removed/disabled in the Braintree Gateway
76
- # DEPRECATED If you're looking to accept iDEAL as a payment method contact accounts@braintreepayments.com for a solution.
77
- when Braintree::WebhookNotification::Kind::IdealPaymentComplete
78
- _ideal_payment_complete_sample_xml(id)
79
- # NEXT_MAJOR_VERSION Remove this class as legacy Ideal has been removed/disabled in the Braintree Gateway
80
- # DEPRECATED If you're looking to accept iDEAL as a payment method contact accounts@braintreepayments.com for a solution.
81
- when Braintree::WebhookNotification::Kind::IdealPaymentFailed
82
- _ideal_payment_failed_sample_xml(id)
83
- # NEXT_MAJOR_VERSION remove GrantedPaymentInstrumentUpdate
84
- when Braintree::WebhookNotification::Kind::GrantedPaymentInstrumentUpdate
85
- _granted_payment_instrument_update_sample_xml(id)
86
89
  when Braintree::WebhookNotification::Kind::GrantorUpdatedGrantedPaymentMethod
87
90
  _granted_payment_instrument_update_sample_xml(id)
88
91
  when Braintree::WebhookNotification::Kind::RecipientUpdatedGrantedPaymentMethod
89
92
  _granted_payment_instrument_update_sample_xml(id)
93
+ when Braintree::WebhookNotification::Kind::GrantedPaymentMethodRevoked
94
+ _granted_payment_method_revoked_xml(id)
90
95
  when Braintree::WebhookNotification::Kind::PaymentMethodRevokedByCustomer
91
96
  _payment_method_revoked_by_customer_sample_xml(id)
92
97
  when Braintree::WebhookNotification::Kind::LocalPaymentCompleted
93
98
  _local_payment_completed_sample_xml(id)
99
+ when Braintree::WebhookNotification::Kind::LocalPaymentExpired
100
+ _local_payment_expired_sample_xml
101
+ when Braintree::WebhookNotification::Kind::LocalPaymentFunded
102
+ _local_payment_funded_sample_xml(id)
103
+ when Braintree::WebhookNotification::Kind::LocalPaymentReversed
104
+ _local_payment_reversed_sample_xml
105
+ when Braintree::WebhookNotification::Kind::PaymentMethodCustomerDataUpdated
106
+ _payment_method_customer_data_updated_sample_xml(id)
107
+ when Braintree::WebhookNotification::Kind::RefundFailed
108
+ _refund_failed_sample_xml(id)
94
109
  else
95
110
  _subscription_sample_xml(id)
96
111
  end
@@ -103,6 +118,21 @@ module Braintree
103
118
  XML
104
119
  end
105
120
 
121
+ def _subscription_billing_skipped(id)
122
+
123
+ <<-XML
124
+ <subscription>
125
+ <id>#{id}</id>
126
+ <transactions type="array">
127
+ </transactions>
128
+ <add_ons type="array">
129
+ </add_ons>
130
+ <discounts type="array">
131
+ </discounts>
132
+ </subscription>
133
+ XML
134
+ end
135
+
106
136
  def _subscription_charged_successfully(id)
107
137
 
108
138
  <<-XML
@@ -245,6 +275,19 @@ module Braintree
245
275
  XML
246
276
  end
247
277
 
278
+ def _transaction_reviewed_sample_xml(id)
279
+
280
+ <<-XML
281
+ <transaction-review>
282
+ <transaction-id>my_id</transaction-id>
283
+ <decision>decision</decision>
284
+ <reviewer-email>hey@girl.com</reviewer-email>
285
+ <reviewer-note>i reviewed this</reviewer-note>
286
+ <reviewed-time type="datetime">2017-06-16T20:44:41Z</reviewed-time>
287
+ </transaction-review>
288
+ XML
289
+ end
290
+
248
291
  def _transaction_settled_sample_xml(id)
249
292
  <<-XML
250
293
  <transaction>
@@ -285,6 +328,14 @@ module Braintree
285
328
  XML
286
329
  end
287
330
 
331
+ def _dispute_under_review_sample_xml(id)
332
+ if id == "legacy_dispute_id"
333
+ _old_dispute_under_review_sample_xml(id)
334
+ else
335
+ _new_dispute_under_review_sample_xml(id)
336
+ end
337
+ end
338
+
288
339
  def _dispute_opened_sample_xml(id)
289
340
  if id == "legacy_dispute_id"
290
341
  _old_dispute_opened_sample_xml(id)
@@ -309,6 +360,58 @@ module Braintree
309
360
  end
310
361
  end
311
362
 
363
+ def _dispute_accepted_sample_xml(id)
364
+ if id == "legacy_dispute_id"
365
+ _old_dispute_accepted_sample_xml(id)
366
+ else
367
+ _new_dispute_accepted_sample_xml(id)
368
+ end
369
+ end
370
+
371
+ def _dispute_auto_accepted_sample_xml(id)
372
+ if id == "legacy_dispute_id"
373
+ _old_dispute_auto_accepted_sample_xml(id)
374
+ else
375
+ _new_dispute_auto_accepted_sample_xml(id)
376
+ end
377
+ end
378
+
379
+ def _dispute_disputed_sample_xml(id)
380
+ if id == "legacy_dispute_id"
381
+ _old_dispute_disputed_sample_xml(id)
382
+ else
383
+ _new_dispute_disputed_sample_xml(id)
384
+ end
385
+ end
386
+
387
+ def _dispute_expired_sample_xml(id)
388
+ if id == "legacy_dispute_id"
389
+ _old_dispute_expired_sample_xml(id)
390
+ else
391
+ _new_dispute_expired_sample_xml(id)
392
+ end
393
+ end
394
+
395
+ def _old_dispute_under_review_sample_xml(id)
396
+ <<-XML
397
+ <dispute>
398
+ <amount>100.00</amount>
399
+ <currency-iso-code>USD</currency-iso-code>
400
+ <received-date type="date">2014-03-01</received-date>
401
+ <reply-by-date type="date">2014-03-21</reply-by-date>
402
+ <kind>chargeback</kind>
403
+ <status>under_review</status>
404
+ <reason>fraud</reason>
405
+ <id>#{id}</id>
406
+ <transaction>
407
+ <id>#{id}</id>
408
+ <amount>100.00</amount>
409
+ </transaction>
410
+ <date-opened type=\"date\">2014-03-21</date-opened>
411
+ </dispute>
412
+ XML
413
+ end
414
+
312
415
  def _old_dispute_opened_sample_xml(id)
313
416
  <<-XML
314
417
  <dispute>
@@ -370,6 +473,128 @@ module Braintree
370
473
  XML
371
474
  end
372
475
 
476
+ def _old_dispute_accepted_sample_xml(id)
477
+ <<-XML
478
+ <dispute>
479
+ <amount>100.00</amount>
480
+ <currency-iso-code>USD</currency-iso-code>
481
+ <received-date type="date">2014-03-01</received-date>
482
+ <reply-by-date type="date">2014-03-21</reply-by-date>
483
+ <kind>chargeback</kind>
484
+ <status>accepted</status>
485
+ <reason>fraud</reason>
486
+ <id>#{id}</id>
487
+ <transaction>
488
+ <id>#{id}</id>
489
+ <amount>100.00</amount>
490
+ </transaction>
491
+ <date-opened type=\"date\">2014-03-21</date-opened>
492
+ </dispute>
493
+ XML
494
+ end
495
+
496
+ def _old_dispute_auto_accepted_sample_xml(id)
497
+ <<-XML
498
+ <dispute>
499
+ <amount>100.00</amount>
500
+ <currency-iso-code>USD</currency-iso-code>
501
+ <received-date type="date">2014-03-01</received-date>
502
+ <reply-by-date type="date">2014-03-21</reply-by-date>
503
+ <kind>chargeback</kind>
504
+ <status>auto_accepted</status>
505
+ <reason>fraud</reason>
506
+ <id>#{id}</id>
507
+ <transaction>
508
+ <id>#{id}</id>
509
+ <amount>100.00</amount>
510
+ </transaction>
511
+ <date-opened type=\"date\">2014-03-21</date-opened>
512
+ </dispute>
513
+ XML
514
+ end
515
+
516
+ def _old_dispute_disputed_sample_xml(id)
517
+ <<-XML
518
+ <dispute>
519
+ <amount>100.00</amount>
520
+ <currency-iso-code>USD</currency-iso-code>
521
+ <received-date type="date">2014-03-01</received-date>
522
+ <reply-by-date type="date">2014-03-21</reply-by-date>
523
+ <kind>chargeback</kind>
524
+ <status>disputed</status>
525
+ <reason>fraud</reason>
526
+ <id>#{id}</id>
527
+ <transaction>
528
+ <id>#{id}</id>
529
+ <amount>100.00</amount>
530
+ </transaction>
531
+ <date-opened type=\"date\">2014-03-21</date-opened>
532
+ </dispute>
533
+ XML
534
+ end
535
+
536
+ def _old_dispute_expired_sample_xml(id)
537
+ <<-XML
538
+ <dispute>
539
+ <amount>100.00</amount>
540
+ <currency-iso-code>USD</currency-iso-code>
541
+ <received-date type="date">2014-03-01</received-date>
542
+ <reply-by-date type="date">2014-03-21</reply-by-date>
543
+ <kind>chargeback</kind>
544
+ <status>expired</status>
545
+ <reason>fraud</reason>
546
+ <id>#{id}</id>
547
+ <transaction>
548
+ <id>#{id}</id>
549
+ <amount>100.00</amount>
550
+ </transaction>
551
+ <date-opened type=\"date\">2014-03-21</date-opened>
552
+ </dispute>
553
+ XML
554
+ end
555
+
556
+ def _new_dispute_under_review_sample_xml(id)
557
+ <<-XML
558
+ <dispute>
559
+ <id>#{id}</id>
560
+ <amount>100.00</amount>
561
+ <amount-disputed>100.00</amount-disputed>
562
+ <amount-won>95.00</amount-won>
563
+ <case-number>CASE-12345</case-number>
564
+ <created-at type="datetime">2017-06-16T20:44:41Z</created-at>
565
+ <currency-iso-code>USD</currency-iso-code>
566
+ <forwarded-comments nil="true"/>
567
+ <kind>chargeback</kind>
568
+ <merchant-account-id>ytnlulaloidoqwvzxjrdqputg</merchant-account-id>
569
+ <reason>fraud</reason>
570
+ <reason-code nil="true"/>
571
+ <reason-description nil="true"/>
572
+ <received-date type="date">2016-02-15</received-date>
573
+ <reference-number>REF-9876</reference-number>
574
+ <reply-by-date type="date">2016-02-22</reply-by-date>
575
+ <status>under_review</status>
576
+ <updated-at type="datetime">2017-06-16T20:44:41Z</updated-at>
577
+ <original-dispute-id>9qde5qgp</original-dispute-id>
578
+ <status-history type="array">
579
+ <status-history>
580
+ <status>under_review</status>
581
+ <timestamp type="datetime">2017-06-16T20:44:41Z</timestamp>
582
+ </status-history>
583
+ </status-history>
584
+ <evidence type="array"/>
585
+ <transaction>
586
+ <id>#{id}</id>
587
+ <amount>100.00</amount>
588
+ <created-at>2017-06-21T20:44:41Z</created-at>
589
+ <order-id nil="true"/>
590
+ <purchase-order-number nil="true"/>
591
+ <payment-instrument-subtype>Visa</payment-instrument-subtype>
592
+ </transaction>
593
+ <date-opened type=\"date\">2014-03-21</date-opened>
594
+ </dispute>
595
+ XML
596
+ end
597
+
373
598
  def _new_dispute_opened_sample_xml(id)
374
599
  <<-XML
375
600
  <dispute>
@@ -535,6 +760,205 @@ module Braintree
535
760
  XML
536
761
  end
537
762
 
763
+ def _new_dispute_accepted_sample_xml(id)
764
+ <<-XML
765
+ <dispute>
766
+ <id>#{id}</id>
767
+ <amount>100.00</amount>
768
+ <amount-disputed>100.00</amount-disputed>
769
+ <amount-won>95.00</amount-won>
770
+ <case-number>CASE-12345</case-number>
771
+ <created-at type="datetime">2017-06-16T20:44:41Z</created-at>
772
+ <currency-iso-code>USD</currency-iso-code>
773
+ <forwarded-comments nil="true"/>
774
+ <kind>chargeback</kind>
775
+ <merchant-account-id>ytnlulaloidoqwvzxjrdqputg</merchant-account-id>
776
+ <reason>fraud</reason>
777
+ <reason-code nil="true"/>
778
+ <reason-description nil="true"/>
779
+ <received-date type="date">2016-02-15</received-date>
780
+ <reference-number>REF-9876</reference-number>
781
+ <reply-by-date type="date">2016-02-22</reply-by-date>
782
+ <status>accepted</status>
783
+ <updated-at type="datetime">2017-06-16T20:44:41Z</updated-at>
784
+ <original-dispute-id>9qde5qgp</original-dispute-id>
785
+ <status-history type="array">
786
+ <status-history>
787
+ <status>open</status>
788
+ <timestamp type="datetime">2017-06-16T20:44:41Z</timestamp>
789
+ </status-history>
790
+ <status-history>
791
+ <status>accepted</status>
792
+ <timestamp type="datetime">2017-06-25T20:50:55Z</timestamp>
793
+ </status-history>
794
+ </status-history>
795
+ <evidence type="array"/>
796
+ <transaction>
797
+ <id>#{id}</id>
798
+ <amount>100.00</amount>
799
+ <created-at>2017-06-21T20:44:41Z</created-at>
800
+ <order-id nil="true"/>
801
+ <purchase-order-number nil="true"/>
802
+ <payment-instrument-subtype>Visa</payment-instrument-subtype>
803
+ </transaction>
804
+ <date-opened type=\"date\">2014-03-21</date-opened>
805
+ </dispute>
806
+ XML
807
+ end
808
+
809
+ def _new_dispute_auto_accepted_sample_xml(id)
810
+ <<-XML
811
+ <dispute>
812
+ <id>#{id}</id>
813
+ <amount>100.00</amount>
814
+ <amount-disputed>100.00</amount-disputed>
815
+ <amount-won>95.00</amount-won>
816
+ <case-number>CASE-12345</case-number>
817
+ <created-at type="datetime">2017-06-16T20:44:41Z</created-at>
818
+ <currency-iso-code>USD</currency-iso-code>
819
+ <forwarded-comments nil="true"/>
820
+ <kind>chargeback</kind>
821
+ <merchant-account-id>ytnlulaloidoqwvzxjrdqputg</merchant-account-id>
822
+ <reason>fraud</reason>
823
+ <reason-code nil="true"/>
824
+ <reason-description nil="true"/>
825
+ <received-date type="date">2016-02-15</received-date>
826
+ <reference-number>REF-9876</reference-number>
827
+ <reply-by-date type="date">2016-02-22</reply-by-date>
828
+ <status>auto_accepted</status>
829
+ <updated-at type="datetime">2017-06-16T20:44:41Z</updated-at>
830
+ <original-dispute-id>9qde5qgp</original-dispute-id>
831
+ <status-history type="array">
832
+ <status-history>
833
+ <status>open</status>
834
+ <timestamp type="datetime">2017-06-16T20:44:41Z</timestamp>
835
+ </status-history>
836
+ <status-history>
837
+ <status>auto_accepted</status>
838
+ <timestamp type="datetime">2017-06-25T20:50:55Z</timestamp>
839
+ </status-history>
840
+ </status-history>
841
+ <evidence type="array"/>
842
+ <transaction>
843
+ <id>#{id}</id>
844
+ <amount>100.00</amount>
845
+ <created-at>2017-06-21T20:44:41Z</created-at>
846
+ <order-id nil="true"/>
847
+ <purchase-order-number nil="true"/>
848
+ <payment-instrument-subtype>Visa</payment-instrument-subtype>
849
+ </transaction>
850
+ <date-opened type=\"date\">2014-03-21</date-opened>
851
+ </dispute>
852
+ XML
853
+ end
854
+
855
+ def _new_dispute_disputed_sample_xml(id)
856
+ <<-XML
857
+ <dispute>
858
+ <id>#{id}</id>
859
+ <amount>100.00</amount>
860
+ <amount-disputed>100.00</amount-disputed>
861
+ <amount-won>95.00</amount-won>
862
+ <case-number>CASE-12345</case-number>
863
+ <created-at type="datetime">2017-06-16T20:44:41Z</created-at>
864
+ <currency-iso-code>USD</currency-iso-code>
865
+ <forwarded-comments nil="true"/>
866
+ <kind>chargeback</kind>
867
+ <merchant-account-id>ytnlulaloidoqwvzxjrdqputg</merchant-account-id>
868
+ <reason>fraud</reason>
869
+ <reason-code nil="true"/>
870
+ <reason-description nil="true"/>
871
+ <received-date type="date">2016-02-15</received-date>
872
+ <reference-number>REF-9876</reference-number>
873
+ <reply-by-date type="date">2016-02-22</reply-by-date>
874
+ <status>disputed</status>
875
+ <updated-at type="datetime">2017-06-21T20:44:41Z</updated-at>
876
+ <original-dispute-id>9qde5qgp</original-dispute-id>
877
+ <status-history type="array">
878
+ <status-history>
879
+ <status>open</status>
880
+ <timestamp type="datetime">2017-06-16T20:44:41Z</timestamp>
881
+ </status-history>
882
+ <status-history>
883
+ <status>disputed</status>
884
+ <timestamp type="datetime">2017-06-25T20:50:55Z</timestamp>
885
+ </status-history>
886
+ </status-history>
887
+ <evidence type="array">
888
+ <evidence>
889
+ <id>rxtngk9j5j93tsrq</id>
890
+ <comments nil="true"/>
891
+ <created-at type="datetime">2017-06-21T20:44:42Z</created-at>
892
+ <sent-to-processor-at nil="true"/>
893
+ <url>s3.amazonaws.com/foo.jpg</url>
894
+ </evidence>
895
+ <evidence>
896
+ <id>88cfb8dd</id>
897
+ <comments>text evidence</comments>
898
+ <created-at type="datetime">2017-06-21T20:44:42Z</created-at>
899
+ <sent-to-processor-at nil="true"/>
900
+ <url nil="true"/>
901
+ </evidence>
902
+ </evidence>
903
+ <transaction>
904
+ <id>#{id}</id>
905
+ <amount>100.00</amount>
906
+ <created-at>2017-06-21T20:44:41Z</created-at>
907
+ <order-id nil="true"/>
908
+ <purchase-order-number nil="true"/>
909
+ <payment-instrument-subtype>Visa</payment-instrument-subtype>
910
+ </transaction>
911
+ <date-opened type=\"date\">2014-03-21</date-opened>
912
+ </dispute>
913
+ XML
914
+ end
915
+
916
+ def _new_dispute_expired_sample_xml(id)
917
+ <<-XML
918
+ <dispute>
919
+ <id>#{id}</id>
920
+ <amount>100.00</amount>
921
+ <amount-disputed>100.00</amount-disputed>
922
+ <amount-won>95.00</amount-won>
923
+ <case-number>CASE-12345</case-number>
924
+ <created-at type="datetime">2017-06-16T20:44:41Z</created-at>
925
+ <currency-iso-code>USD</currency-iso-code>
926
+ <forwarded-comments nil="true"/>
927
+ <kind>chargeback</kind>
928
+ <merchant-account-id>ytnlulaloidoqwvzxjrdqputg</merchant-account-id>
929
+ <reason>fraud</reason>
930
+ <reason-code nil="true"/>
931
+ <reason-description nil="true"/>
932
+ <received-date type="date">2016-02-15</received-date>
933
+ <reference-number>REF-9876</reference-number>
934
+ <reply-by-date type="date">2016-02-22</reply-by-date>
935
+ <status>expired</status>
936
+ <updated-at type="datetime">2017-06-16T20:44:41Z</updated-at>
937
+ <original-dispute-id>9qde5qgp</original-dispute-id>
938
+ <status-history type="array">
939
+ <status-history>
940
+ <status>open</status>
941
+ <timestamp type="datetime">2017-06-16T20:44:41Z</timestamp>
942
+ </status-history>
943
+ <status-history>
944
+ <status>expired</status>
945
+ <timestamp type="datetime">2017-06-25T20:50:55Z</timestamp>
946
+ </status-history>
947
+ </status-history>
948
+ <evidence type="array"/>
949
+ <transaction>
950
+ <id>#{id}</id>
951
+ <amount>100.00</amount>
952
+ <created-at>2017-06-21T20:44:41Z</created-at>
953
+ <order-id nil="true"/>
954
+ <purchase-order-number nil="true"/>
955
+ <payment-instrument-subtype>Visa</payment-instrument-subtype>
956
+ </transaction>
957
+ <date-opened type=\"date\">2014-03-21</date-opened>
958
+ </dispute>
959
+ XML
960
+ end
961
+
538
962
  def _disbursement_exception_sample_xml(id)
539
963
 
540
964
  <<-XML
@@ -624,38 +1048,6 @@ module Braintree
624
1048
  XML
625
1049
  end
626
1050
 
627
- def _ideal_payment_complete_sample_xml(id)
628
- <<-XML
629
- <ideal-payment>
630
- <id>#{id}</id>
631
- <status>COMPLETE</status>
632
- <issuer>ABCISSUER</issuer>
633
- <order-id>ORDERABC</order-id>
634
- <currency>EUR</currency>
635
- <amount>10.00</amount>
636
- <created-at>2016-11-29T23:27:34.547Z</created-at>
637
- <approval-url>https://example.com</approval-url>
638
- <ideal-transaction-id>1234567890</ideal-transaction-id>
639
- </ideal-payment>
640
- XML
641
- end
642
-
643
- def _ideal_payment_failed_sample_xml(id)
644
- <<-XML
645
- <ideal-payment>
646
- <id>#{id}</id>
647
- <status>FAILED</status>
648
- <issuer>ABCISSUER</issuer>
649
- <order-id>ORDERABC</order-id>
650
- <currency>EUR</currency>
651
- <amount>10.00</amount>
652
- <created-at>2016-11-29T23:27:34.547Z</created-at>
653
- <approval-url>https://example.com</approval-url>
654
- <ideal-transaction-id>1234567890</ideal-transaction-id>
655
- </ideal-payment>
656
- XML
657
- end
658
-
659
1051
  def _granted_payment_instrument_update_sample_xml(id)
660
1052
  <<-XML
661
1053
  <granted-payment-instrument-update>
@@ -675,6 +1067,10 @@ module Braintree
675
1067
  XML
676
1068
  end
677
1069
 
1070
+ def _granted_payment_method_revoked_xml(id)
1071
+ _venmo_account_xml(id)
1072
+ end
1073
+
678
1074
  def _payment_method_revoked_by_customer_sample_xml(id)
679
1075
  <<-XML
680
1076
  <paypal-account>
@@ -698,10 +1094,46 @@ module Braintree
698
1094
  end
699
1095
 
700
1096
  def _local_payment_completed_sample_xml(id)
1097
+ if id == "blik_one_click_id"
1098
+ _blik_one_click_local_payment_completed_sample_xml(id)
1099
+ else
1100
+ _default_local_payment_completed_sample_xml(id)
1101
+ end
1102
+ end
1103
+
1104
+ def _default_local_payment_completed_sample_xml(id)
701
1105
  <<-XML
702
1106
  <local-payment>
1107
+ <bic>BIC</bic>
1108
+ <iban_last_chars>1234</iban_last_chars>
1109
+ <payer-id>ABCPAYER</payer-id>
1110
+ <payer-name>PAYERNAME</payer-name>
703
1111
  <payment-id>PAY-XYZ123</payment-id>
1112
+ <payment-method-nonce>ee257d98-de40-47e8-96b3-a6954ea7a9a4</payment-method-nonce>
1113
+ <transaction>
1114
+ <id>#{id}</id>
1115
+ <status>authorized</status>
1116
+ <amount>49.99</amount>
1117
+ <order-id>order4567</order-id>
1118
+ </transaction>
1119
+ </local-payment>
1120
+ XML
1121
+ end
1122
+
1123
+ def _blik_one_click_local_payment_completed_sample_xml(id)
1124
+ <<-XML
1125
+ <local-payment>
1126
+ <bic>BIC</bic>
1127
+ <blik-aliases type='array'>
1128
+ <blik-alias>
1129
+ <key>alias-key-1</key>
1130
+ <label>alias-label-1</label>
1131
+ </blik-alias>
1132
+ </blik-aliases>
1133
+ <iban_last_chars>1234</iban_last_chars>
704
1134
  <payer-id>ABCPAYER</payer-id>
1135
+ <payer-name>PAYERNAME</payer-name>
1136
+ <payment-id>PAY-XYZ123</payment-id>
705
1137
  <payment-method-nonce>ee257d98-de40-47e8-96b3-a6954ea7a9a4</payment-method-nonce>
706
1138
  <transaction>
707
1139
  <id>#{id}</id>
@@ -712,5 +1144,96 @@ module Braintree
712
1144
  </local-payment>
713
1145
  XML
714
1146
  end
1147
+
1148
+ def _local_payment_expired_sample_xml
1149
+ <<-XML
1150
+ <local-payment-expired>
1151
+ <payment-id>PAY-XYZ123</payment-id>
1152
+ <payment-context-id>cG5b=</payment-context-id>
1153
+ </local-payment-expired>
1154
+ XML
1155
+ end
1156
+
1157
+ def _local_payment_funded_sample_xml(id)
1158
+ <<-XML
1159
+ <local-payment-funded>
1160
+ <payment-id>PAY-XYZ123</payment-id>
1161
+ <payment-context-id>cG5b=</payment-context-id>
1162
+ <transaction>
1163
+ <id>#{id}</id>
1164
+ <status>settled</status>
1165
+ <amount>49.99</amount>
1166
+ <order-id>order4567</order-id>
1167
+ </transaction>
1168
+ </local-payment-funded>
1169
+ XML
1170
+ end
1171
+
1172
+ def _local_payment_reversed_sample_xml
1173
+ <<-XML
1174
+ <local-payment-reversed>
1175
+ <payment-id>PAY-XYZ123</payment-id>
1176
+ <payment-context-id>cG5b=</payment-context-id>
1177
+ </local-payment-reversed>
1178
+ XML
1179
+ end
1180
+
1181
+ def _payment_method_customer_data_updated_sample_xml(id)
1182
+ <<-XML
1183
+ <payment-method-customer-data-updated-metadata>
1184
+ <token>TOKEN-12345</token>
1185
+ <payment-method>
1186
+ #{_venmo_account_xml(id)}
1187
+ </payment-method>
1188
+ <datetime-updated type='dateTime'>2022-01-01T21:28:37Z</datetime-updated>
1189
+ <enriched-customer-data>
1190
+ <fields-updated type='array'>
1191
+ <item>username</item>
1192
+ </fields-updated>
1193
+ <profile-data>
1194
+ <username>venmo_username</username>
1195
+ <first-name>John</first-name>
1196
+ <last-name>Doe</last-name>
1197
+ <phone-number>1231231234</phone-number>
1198
+ <email>john.doe@paypal.com</email>
1199
+ </profile-data>
1200
+ </enriched-customer-data>
1201
+ </payment-method-customer-data-updated-metadata>
1202
+ XML
1203
+ end
1204
+
1205
+ def _venmo_account_xml(id)
1206
+ <<-XML
1207
+ <venmo-account>
1208
+ <created-at type='dateTime'>2018-10-11T21:28:37Z</created-at>
1209
+ <updated-at type='dateTime'>2018-10-11T21:28:37Z</updated-at>
1210
+ <default type='boolean'>true</default>
1211
+ <image-url>https://assets.braintreegateway.com/payment_method_logo/venmo.png?environment=test</image-url>
1212
+ <token>#{id}</token>
1213
+ <source-description>Venmo Account: venmojoe</source-description>
1214
+ <username>venmojoe</username>
1215
+ <venmo-user-id>456</venmo-user-id>
1216
+ <subscriptions type='array'/>
1217
+ <customer-id>venmo_customer_id</customer-id>
1218
+ <global-id>cGF5bWVudG1ldGhvZF92ZW5tb2FjY291bnQ</global-id>
1219
+ </venmo-account>
1220
+ XML
1221
+ end
1222
+
1223
+ def _refund_failed_sample_xml(id)
1224
+ <<-XML
1225
+ <transaction>
1226
+ <id>#{id}</id>
1227
+ <amount>100</amount>
1228
+ <credit-card>
1229
+ <number>1234560000001234</number>
1230
+ <cvv>123</cvv>
1231
+ <card-type>MasterCard</card-type>
1232
+ </credit-card>
1233
+ <status>processor_declined</status>
1234
+ <refunded-transaction-id>1</refunded-transaction-id>
1235
+ </transaction>
1236
+ XML
1237
+ end
715
1238
  end
716
1239
  end