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
@@ -7,7 +7,7 @@ describe Braintree::UsBankAccountVerification, "search" do
7
7
  search.account_holder_name.is "thisnameisnotreal"
8
8
  end
9
9
 
10
- collection.maximum_size.should == 0
10
+ expect(collection.maximum_size).to eq(0)
11
11
  end
12
12
 
13
13
  let(:nonce) { generate_non_plaid_us_bank_account_nonce }
@@ -21,7 +21,7 @@ describe Braintree::UsBankAccountVerification, "search" do
21
21
  :customer_id => customer.id,
22
22
  :options => {
23
23
  :verification_merchant_account_id => SpecHelper::UsBankMerchantAccountId,
24
- }
24
+ },
25
25
  ).payment_method
26
26
  verification = payment_method.verifications.first
27
27
 
@@ -40,14 +40,14 @@ describe Braintree::UsBankAccountVerification, "search" do
40
40
  search.id.is verification.id
41
41
  search.send(criterion).is value
42
42
  end
43
- collection.maximum_size.should == 1
44
- collection.first.id.should == verification.id
43
+ expect(collection.maximum_size).to eq(1)
44
+ expect(collection.first.id).to eq(verification.id)
45
45
 
46
46
  collection = Braintree::UsBankAccountVerification.search do |search|
47
47
  search.id.is verification.id
48
48
  search.send(criterion).is "invalid_attribute"
49
49
  end
50
- collection.should be_empty
50
+ expect(collection).to be_empty
51
51
  end
52
52
 
53
53
  collection = Braintree::UsBankAccountVerification.search do |search|
@@ -57,8 +57,8 @@ describe Braintree::UsBankAccountVerification, "search" do
57
57
  end
58
58
  end
59
59
 
60
- collection.maximum_size.should == 1
61
- collection.first.id.should == verification.id
60
+ expect(collection.maximum_size).to eq(1)
61
+ expect(collection.first.id).to eq(verification.id)
62
62
  end
63
63
 
64
64
  describe "multiple value fields" do
@@ -70,7 +70,7 @@ describe Braintree::UsBankAccountVerification, "search" do
70
70
  :customer_id => customer.id,
71
71
  :options => {
72
72
  :verification_merchant_account_id => SpecHelper::UsBankMerchantAccountId,
73
- }
73
+ },
74
74
  ).payment_method
75
75
  verification1 = payment_method1.verifications.first
76
76
 
@@ -79,7 +79,7 @@ describe Braintree::UsBankAccountVerification, "search" do
79
79
  :customer_id => customer.id,
80
80
  :options => {
81
81
  :verification_merchant_account_id => SpecHelper::UsBankMerchantAccountId,
82
- }
82
+ },
83
83
  ).payment_method
84
84
  verification2 = payment_method2.verifications.first
85
85
 
@@ -87,7 +87,7 @@ describe Braintree::UsBankAccountVerification, "search" do
87
87
  search.ids.in verification1.id, verification2.id
88
88
  end
89
89
 
90
- collection.maximum_size.should == 2
90
+ expect(collection.maximum_size).to eq(2)
91
91
  end
92
92
  end
93
93
 
@@ -100,7 +100,7 @@ describe Braintree::UsBankAccountVerification, "search" do
100
100
  :customer_id => customer.id,
101
101
  :options => {
102
102
  :verification_merchant_account_id => SpecHelper::UsBankMerchantAccountId,
103
- }
103
+ },
104
104
  ).payment_method
105
105
  verification = payment_method.verifications.first
106
106
 
@@ -110,46 +110,46 @@ describe Braintree::UsBankAccountVerification, "search" do
110
110
  search.id.is verification.id
111
111
  search.created_at.between(
112
112
  created_at - 60,
113
- created_at + 60
113
+ created_at + 60,
114
114
  )
115
115
  end
116
116
 
117
- collection.maximum_size.should == 1
118
- collection.first.id.should == verification.id
117
+ expect(collection.maximum_size).to eq(1)
118
+ expect(collection.first.id).to eq(verification.id)
119
119
 
120
120
  collection = Braintree::UsBankAccountVerification.search do |search|
121
121
  search.id.is verification.id
122
122
  search.created_at >= created_at - 1
123
123
  end
124
124
 
125
- collection.maximum_size.should == 1
126
- collection.first.id.should == verification.id
125
+ expect(collection.maximum_size).to eq(1)
126
+ expect(collection.first.id).to eq(verification.id)
127
127
 
128
128
  collection = Braintree::UsBankAccountVerification.search do |search|
129
129
  search.id.is verification.id
130
130
  search.created_at <= created_at + 1
131
131
  end
132
132
 
133
- collection.maximum_size.should == 1
134
- collection.first.id.should == verification.id
133
+ expect(collection.maximum_size).to eq(1)
134
+ expect(collection.first.id).to eq(verification.id)
135
135
 
136
136
  collection = Braintree::UsBankAccountVerification.search do |search|
137
137
  search.id.is verification.id
138
138
  search.created_at.between(
139
139
  created_at - 300,
140
- created_at - 100
140
+ created_at - 100,
141
141
  )
142
142
  end
143
143
 
144
- collection.maximum_size.should == 0
144
+ expect(collection.maximum_size).to eq(0)
145
145
 
146
146
  collection = Braintree::UsBankAccountVerification.search do |search|
147
147
  search.id.is verification.id
148
148
  search.created_at.is created_at
149
149
  end
150
150
 
151
- collection.maximum_size.should == 1
152
- collection.first.id.should == verification.id
151
+ expect(collection.maximum_size).to eq(1)
152
+ expect(collection.first.id).to eq(verification.id)
153
153
  end
154
154
  end
155
155
 
@@ -162,7 +162,7 @@ describe Braintree::UsBankAccountVerification, "search" do
162
162
  :customer_id => customer.id,
163
163
  :options => {
164
164
  :verification_merchant_account_id => SpecHelper::UsBankMerchantAccountId,
165
- }
165
+ },
166
166
  ).payment_method
167
167
  verification = payment_method.verifications.first
168
168
 
@@ -171,8 +171,8 @@ describe Braintree::UsBankAccountVerification, "search" do
171
171
  search.account_number.ends_with "0000"
172
172
  end
173
173
 
174
- collection.maximum_size.should == 1
175
- collection.first.id.should == verification.id
174
+ expect(collection.maximum_size).to eq(1)
175
+ expect(collection.first.id).to eq(verification.id)
176
176
  end
177
177
  end
178
178
  end
@@ -36,23 +36,23 @@ describe Braintree::UsBankAccountVerification do
36
36
  :options => {
37
37
  :verification_merchant_account_id => SpecHelper::AnotherUsBankMerchantAccountId,
38
38
  :us_bank_account_verification_method => Braintree::UsBankAccountVerification::VerificationMethod::MicroTransfers,
39
- }
39
+ },
40
40
  )
41
41
 
42
- result.should be_success
42
+ expect(result).to be_success
43
43
 
44
44
  verification = result.payment_method.verifications.first
45
- verification.verification_method.should == Braintree::UsBankAccountVerification::VerificationMethod::MicroTransfers
46
- verification.status.should == Braintree::UsBankAccountVerification::Status::Pending
45
+ expect(verification.verification_method).to eq(Braintree::UsBankAccountVerification::VerificationMethod::MicroTransfers)
46
+ expect(verification.status).to eq(Braintree::UsBankAccountVerification::Status::Pending)
47
47
 
48
48
  response = Braintree::UsBankAccountVerification.confirm_micro_transfer_amounts(verification.id, [17, 29])
49
49
 
50
- response.should be_success
51
- response.us_bank_account_verification.status.should == Braintree::UsBankAccountVerification::Status::Verified
50
+ expect(response).to be_success
51
+ expect(response.us_bank_account_verification.status).to eq(Braintree::UsBankAccountVerification::Status::Verified)
52
52
 
53
53
  us_bank_account = Braintree::UsBankAccount.find(response.us_bank_account_verification.us_bank_account[:token])
54
54
 
55
- us_bank_account.verified.should be_truthy
55
+ expect(us_bank_account.verified).to be_truthy
56
56
  end
57
57
 
58
58
  it "successfully confirms not-yet-settled amounts" do
@@ -64,19 +64,19 @@ describe Braintree::UsBankAccountVerification do
64
64
  :options => {
65
65
  :verification_merchant_account_id => SpecHelper::AnotherUsBankMerchantAccountId,
66
66
  :us_bank_account_verification_method => Braintree::UsBankAccountVerification::VerificationMethod::MicroTransfers,
67
- }
67
+ },
68
68
  )
69
69
 
70
- result.should be_success
70
+ expect(result).to be_success
71
71
 
72
72
  verification = result.payment_method.verifications.first
73
- verification.verification_method.should == Braintree::UsBankAccountVerification::VerificationMethod::MicroTransfers
74
- verification.status.should == Braintree::UsBankAccountVerification::Status::Pending
73
+ expect(verification.verification_method).to eq(Braintree::UsBankAccountVerification::VerificationMethod::MicroTransfers)
74
+ expect(verification.status).to eq(Braintree::UsBankAccountVerification::Status::Pending)
75
75
 
76
76
  response = Braintree::UsBankAccountVerification.confirm_micro_transfer_amounts(verification.id, [17, 29])
77
77
 
78
- response.should be_success
79
- response.us_bank_account_verification.status.should == Braintree::UsBankAccountVerification::Status::Pending
78
+ expect(response).to be_success
79
+ expect(response.us_bank_account_verification.status).to eq(Braintree::UsBankAccountVerification::Status::Pending)
80
80
  end
81
81
 
82
82
  it "attempts to confirm" do
@@ -86,19 +86,19 @@ describe Braintree::UsBankAccountVerification do
86
86
  :options => {
87
87
  :verification_merchant_account_id => SpecHelper::AnotherUsBankMerchantAccountId,
88
88
  :us_bank_account_verification_method => Braintree::UsBankAccountVerification::VerificationMethod::MicroTransfers,
89
- }
89
+ },
90
90
  )
91
91
 
92
- result.should be_success
92
+ expect(result).to be_success
93
93
 
94
94
  verification = result.payment_method.verifications.first
95
- verification.verification_method.should == Braintree::UsBankAccountVerification::VerificationMethod::MicroTransfers
96
- verification.status.should == Braintree::UsBankAccountVerification::Status::Pending
95
+ expect(verification.verification_method).to eq(Braintree::UsBankAccountVerification::VerificationMethod::MicroTransfers)
96
+ expect(verification.status).to eq(Braintree::UsBankAccountVerification::Status::Pending)
97
97
 
98
98
  response = Braintree::UsBankAccountVerification.confirm_micro_transfer_amounts(verification.id, [1, 1])
99
99
 
100
- response.should_not be_success
101
- response.errors.for(:us_bank_account_verification)[0].code.should == Braintree::ErrorCodes::UsBankAccountVerification::AmountsDoNotMatch
100
+ expect(response).not_to be_success
101
+ expect(response.errors.for(:us_bank_account_verification)[0].code).to eq(Braintree::ErrorCodes::UsBankAccountVerification::AmountsDoNotMatch)
102
102
  end
103
103
 
104
104
  it "exceeds the confirmation attempt threshold" do
@@ -108,10 +108,10 @@ describe Braintree::UsBankAccountVerification do
108
108
  :options => {
109
109
  :verification_merchant_account_id => SpecHelper::AnotherUsBankMerchantAccountId,
110
110
  :us_bank_account_verification_method => Braintree::UsBankAccountVerification::VerificationMethod::MicroTransfers,
111
- }
111
+ },
112
112
  )
113
113
 
114
- result.should be_success
114
+ expect(result).to be_success
115
115
 
116
116
  verification = result.payment_method.verifications.first
117
117
 
@@ -119,17 +119,17 @@ describe Braintree::UsBankAccountVerification do
119
119
  4.times do
120
120
  response = Braintree::UsBankAccountVerification.confirm_micro_transfer_amounts(verification.id, [1, 1])
121
121
 
122
- response.should_not be_success
123
- response.errors.for(:us_bank_account_verification)[0].code.should == Braintree::ErrorCodes::UsBankAccountVerification::AmountsDoNotMatch
122
+ expect(response).not_to be_success
123
+ expect(response.errors.for(:us_bank_account_verification)[0].code).to eq(Braintree::ErrorCodes::UsBankAccountVerification::AmountsDoNotMatch)
124
124
  end
125
125
 
126
126
  response = Braintree::UsBankAccountVerification.confirm_micro_transfer_amounts(verification.id, [1, 1])
127
- response.should_not be_success
128
- response.errors.for(:us_bank_account_verification)[0].code.should == Braintree::ErrorCodes::UsBankAccountVerification::TooManyConfirmationAttempts
127
+ expect(response).not_to be_success
128
+ expect(response.errors.for(:us_bank_account_verification)[0].code).to eq(Braintree::ErrorCodes::UsBankAccountVerification::TooManyConfirmationAttempts)
129
129
 
130
130
  response = Braintree::UsBankAccountVerification.confirm_micro_transfer_amounts(verification.id, [1, 1])
131
- response.should_not be_success
132
- response.errors.for(:us_bank_account_verification)[0].code.should == Braintree::ErrorCodes::UsBankAccountVerification::TooManyConfirmationAttempts
131
+ expect(response).not_to be_success
132
+ expect(response.errors.for(:us_bank_account_verification)[0].code).to eq(Braintree::ErrorCodes::UsBankAccountVerification::TooManyConfirmationAttempts)
133
133
  end
134
134
 
135
135
  it "returns an error for invalid deposit amounts" do
@@ -139,16 +139,16 @@ describe Braintree::UsBankAccountVerification do
139
139
  :options => {
140
140
  :verification_merchant_account_id => SpecHelper::AnotherUsBankMerchantAccountId,
141
141
  :us_bank_account_verification_method => Braintree::UsBankAccountVerification::VerificationMethod::MicroTransfers,
142
- }
142
+ },
143
143
  )
144
144
 
145
- result.should be_success
145
+ expect(result).to be_success
146
146
 
147
147
  verification = result.payment_method.verifications.first
148
148
  response = Braintree::UsBankAccountVerification.confirm_micro_transfer_amounts(verification.id, ["abc"])
149
149
 
150
- response.should_not be_success
151
- response.errors.for(:us_bank_account_verification)[0].code.should == Braintree::ErrorCodes::UsBankAccountVerification::InvalidDepositAmounts
150
+ expect(response).not_to be_success
151
+ expect(response.errors.for(:us_bank_account_verification)[0].code).to eq(Braintree::ErrorCodes::UsBankAccountVerification::InvalidDepositAmounts)
152
152
  end
153
153
  end
154
154
 
@@ -160,16 +160,16 @@ describe Braintree::UsBankAccountVerification do
160
160
  :options => {
161
161
  :verification_merchant_account_id => SpecHelper::AnotherUsBankMerchantAccountId,
162
162
  :us_bank_account_verification_method => Braintree::UsBankAccountVerification::VerificationMethod::NetworkCheck,
163
- }
163
+ },
164
164
  )
165
165
 
166
- result.should be_success
166
+ expect(result).to be_success
167
167
 
168
168
  verification = result.payment_method.verifications.first
169
169
  response = Braintree::UsBankAccountVerification.confirm_micro_transfer_amounts(verification.id, [1, 1])
170
170
 
171
- response.should_not be_success
172
- response.errors.for(:us_bank_account_verification)[0].code.should == Braintree::ErrorCodes::UsBankAccountVerification::MustBeMicroTransfersVerification
171
+ expect(response).not_to be_success
172
+ expect(response.errors.for(:us_bank_account_verification)[0].code).to eq(Braintree::ErrorCodes::UsBankAccountVerification::MustBeMicroTransfersVerification)
173
173
  end
174
174
  end
175
175
  end
@@ -182,15 +182,15 @@ describe Braintree::UsBankAccountVerification do
182
182
  :options => {
183
183
  :verification_merchant_account_id => SpecHelper::UsBankMerchantAccountId,
184
184
  :us_bank_account_verification_method => Braintree::UsBankAccountVerification::VerificationMethod::NetworkCheck,
185
- }
185
+ },
186
186
  )
187
187
 
188
- result.should be_success
188
+ expect(result).to be_success
189
189
 
190
190
  created_verification = result.payment_method.verifications.first
191
191
  found_verification = Braintree::UsBankAccountVerification.find(created_verification.id)
192
192
 
193
- found_verification.should == created_verification
193
+ expect(found_verification).to eq(created_verification)
194
194
  end
195
195
 
196
196
  it "raises a NotFoundError exception if verification cannot be found" do
@@ -208,7 +208,7 @@ describe Braintree::UsBankAccountVerification do
208
208
  :options => {
209
209
  :verification_merchant_account_id => SpecHelper::UsBankMerchantAccountId,
210
210
  :us_bank_account_verification_method => Braintree::UsBankAccountVerification::VerificationMethod::NetworkCheck,
211
- }
211
+ },
212
212
  ).payment_method
213
213
  end
214
214
 
@@ -224,7 +224,7 @@ describe Braintree::UsBankAccountVerification do
224
224
  search.verification_method.in created_verification.verification_method
225
225
  end
226
226
 
227
- found_verifications.should include(created_verification)
227
+ expect(found_verifications).to include(created_verification)
228
228
  end
229
229
 
230
230
  it "searches and finds verifications using customer fields" do
@@ -234,7 +234,7 @@ describe Braintree::UsBankAccountVerification do
234
234
  search.payment_method_token.is payment_method.token
235
235
  end
236
236
 
237
- found_verifications.count.should eq(1)
237
+ expect(found_verifications.count).to eq(1)
238
238
  end
239
239
  end
240
240
  end
@@ -7,44 +7,44 @@ describe Braintree::VisaCheckoutCard do
7
7
 
8
8
  result = Braintree::PaymentMethod.create(
9
9
  :payment_method_nonce => Braintree::Test::Nonce::VisaCheckoutDiscover,
10
- :customer_id => customer.id
10
+ :customer_id => customer.id,
11
11
  )
12
- result.should be_success
12
+ expect(result).to be_success
13
13
 
14
14
  visa_checkout_card = result.payment_method
15
- visa_checkout_card.should be_a(Braintree::VisaCheckoutCard)
16
- visa_checkout_card.call_id.should == "abc123"
17
- visa_checkout_card.billing_address.should_not be_nil
18
- visa_checkout_card.bin.should_not be_nil
19
- visa_checkout_card.card_type.should_not be_nil
20
- visa_checkout_card.cardholder_name.should_not be_nil
21
- visa_checkout_card.commercial.should_not be_nil
22
- visa_checkout_card.country_of_issuance.should_not be_nil
23
- visa_checkout_card.created_at.should_not be_nil
24
- visa_checkout_card.customer_id.should_not be_nil
25
- visa_checkout_card.customer_location.should_not be_nil
26
- visa_checkout_card.debit.should_not be_nil
27
- visa_checkout_card.default?.should_not be_nil
28
- visa_checkout_card.durbin_regulated.should_not be_nil
29
- visa_checkout_card.expiration_date.should_not be_nil
30
- visa_checkout_card.expiration_month.should_not be_nil
31
- visa_checkout_card.expiration_year.should_not be_nil
32
- visa_checkout_card.expired?.should_not be_nil
33
- visa_checkout_card.healthcare.should_not be_nil
34
- visa_checkout_card.image_url.should_not be_nil
35
- visa_checkout_card.issuing_bank.should_not be_nil
36
- visa_checkout_card.last_4.should_not be_nil
37
- visa_checkout_card.payroll.should_not be_nil
38
- visa_checkout_card.prepaid.should_not be_nil
39
- visa_checkout_card.product_id.should_not be_nil
40
- visa_checkout_card.subscriptions.should_not be_nil
41
- visa_checkout_card.token.should_not be_nil
42
- visa_checkout_card.unique_number_identifier.should_not be_nil
43
- visa_checkout_card.updated_at.should_not be_nil
15
+ expect(visa_checkout_card).to be_a(Braintree::VisaCheckoutCard)
16
+ expect(visa_checkout_card.call_id).to eq("abc123")
17
+ expect(visa_checkout_card.billing_address).not_to be_nil
18
+ expect(visa_checkout_card.bin).not_to be_nil
19
+ expect(visa_checkout_card.card_type).not_to be_nil
20
+ expect(visa_checkout_card.cardholder_name).not_to be_nil
21
+ expect(visa_checkout_card.commercial).not_to be_nil
22
+ expect(visa_checkout_card.country_of_issuance).not_to be_nil
23
+ expect(visa_checkout_card.created_at).not_to be_nil
24
+ expect(visa_checkout_card.customer_id).not_to be_nil
25
+ expect(visa_checkout_card.customer_location).not_to be_nil
26
+ expect(visa_checkout_card.debit).not_to be_nil
27
+ expect(visa_checkout_card.default?).not_to be_nil
28
+ expect(visa_checkout_card.durbin_regulated).not_to be_nil
29
+ expect(visa_checkout_card.expiration_date).not_to be_nil
30
+ expect(visa_checkout_card.expiration_month).not_to be_nil
31
+ expect(visa_checkout_card.expiration_year).not_to be_nil
32
+ expect(visa_checkout_card.expired?).not_to be_nil
33
+ expect(visa_checkout_card.healthcare).not_to be_nil
34
+ expect(visa_checkout_card.image_url).not_to be_nil
35
+ expect(visa_checkout_card.issuing_bank).not_to be_nil
36
+ expect(visa_checkout_card.last_4).not_to be_nil
37
+ expect(visa_checkout_card.payroll).not_to be_nil
38
+ expect(visa_checkout_card.prepaid).not_to be_nil
39
+ expect(visa_checkout_card.product_id).not_to be_nil
40
+ expect(visa_checkout_card.subscriptions).not_to be_nil
41
+ expect(visa_checkout_card.token).not_to be_nil
42
+ expect(visa_checkout_card.unique_number_identifier).not_to be_nil
43
+ expect(visa_checkout_card.updated_at).not_to be_nil
44
44
 
45
45
  customer = Braintree::Customer.find(customer.id)
46
- customer.visa_checkout_cards.size.should == 1
47
- customer.visa_checkout_cards.first.should == visa_checkout_card
46
+ expect(customer.visa_checkout_cards.size).to eq(1)
47
+ expect(customer.visa_checkout_cards.first).to eq(visa_checkout_card)
48
48
  end
49
49
 
50
50
  it "can create with verification" do
@@ -53,25 +53,25 @@ describe Braintree::VisaCheckoutCard do
53
53
  result = Braintree::PaymentMethod.create(
54
54
  :payment_method_nonce => Braintree::Test::Nonce::VisaCheckoutDiscover,
55
55
  :customer_id => customer.id,
56
- :options => { :verify_card => true }
56
+ :options => {:verify_card => true},
57
57
  )
58
- result.should be_success
59
- result.payment_method.verification.status.should == Braintree::CreditCardVerification::Status::Verified
58
+ expect(result).to be_success
59
+ expect(result.payment_method.verification.status).to eq(Braintree::CreditCardVerification::Status::Verified)
60
60
  end
61
61
 
62
62
  it "can search for transactions" do
63
63
  transaction_create_result = Braintree::Transaction.sale(
64
64
  :payment_method_nonce => Braintree::Test::Nonce::VisaCheckoutDiscover,
65
- :amount => '47.00',
65
+ :amount => "47.00",
66
66
  )
67
- transaction_create_result.should be_success
67
+ expect(transaction_create_result).to be_success
68
68
  transaction_id = transaction_create_result.transaction.id
69
69
 
70
70
  search_results = Braintree::Transaction.search do |search|
71
71
  search.id.is transaction_id
72
72
  search.payment_instrument_type.is Braintree::PaymentInstrumentType::VisaCheckoutCard
73
73
  end
74
- search_results.first.id.should == transaction_id
74
+ expect(search_results.first.id).to eq(transaction_id)
75
75
  end
76
76
 
77
77
  it "can create transaction from nonce and vault" do
@@ -80,31 +80,31 @@ describe Braintree::VisaCheckoutCard do
80
80
  result = Braintree::Transaction.sale(
81
81
  :payment_method_nonce => Braintree::Test::Nonce::VisaCheckoutDiscover,
82
82
  :customer_id => customer.id,
83
- :amount => '47.00',
84
- :options => { :store_in_vault => true },
83
+ :amount => "47.00",
84
+ :options => {:store_in_vault => true},
85
85
  )
86
- result.should be_success
86
+ expect(result).to be_success
87
87
 
88
88
  visa_checkout_card_details = result.transaction.visa_checkout_card_details
89
- visa_checkout_card_details.call_id.should == "abc123"
90
- visa_checkout_card_details.bin.should_not be_nil
91
- visa_checkout_card_details.card_type.should_not be_nil
92
- visa_checkout_card_details.cardholder_name.should_not be_nil
93
- visa_checkout_card_details.commercial.should_not be_nil
94
- visa_checkout_card_details.country_of_issuance.should_not be_nil
95
- visa_checkout_card_details.customer_location.should_not be_nil
96
- visa_checkout_card_details.debit.should_not be_nil
97
- visa_checkout_card_details.durbin_regulated.should_not be_nil
98
- visa_checkout_card_details.expiration_date.should_not be_nil
99
- visa_checkout_card_details.expiration_month.should_not be_nil
100
- visa_checkout_card_details.expiration_year.should_not be_nil
101
- visa_checkout_card_details.healthcare.should_not be_nil
102
- visa_checkout_card_details.image_url.should_not be_nil
103
- visa_checkout_card_details.issuing_bank.should_not be_nil
104
- visa_checkout_card_details.last_4.should_not be_nil
105
- visa_checkout_card_details.payroll.should_not be_nil
106
- visa_checkout_card_details.prepaid.should_not be_nil
107
- visa_checkout_card_details.product_id.should_not be_nil
108
- visa_checkout_card_details.token.should_not be_nil
89
+ expect(visa_checkout_card_details.call_id).to eq("abc123")
90
+ expect(visa_checkout_card_details.bin).not_to be_nil
91
+ expect(visa_checkout_card_details.card_type).not_to be_nil
92
+ expect(visa_checkout_card_details.cardholder_name).not_to be_nil
93
+ expect(visa_checkout_card_details.commercial).not_to be_nil
94
+ expect(visa_checkout_card_details.country_of_issuance).not_to be_nil
95
+ expect(visa_checkout_card_details.customer_location).not_to be_nil
96
+ expect(visa_checkout_card_details.debit).not_to be_nil
97
+ expect(visa_checkout_card_details.durbin_regulated).not_to be_nil
98
+ expect(visa_checkout_card_details.expiration_date).not_to be_nil
99
+ expect(visa_checkout_card_details.expiration_month).not_to be_nil
100
+ expect(visa_checkout_card_details.expiration_year).not_to be_nil
101
+ expect(visa_checkout_card_details.healthcare).not_to be_nil
102
+ expect(visa_checkout_card_details.image_url).not_to be_nil
103
+ expect(visa_checkout_card_details.issuing_bank).not_to be_nil
104
+ expect(visa_checkout_card_details.last_4).not_to be_nil
105
+ expect(visa_checkout_card_details.payroll).not_to be_nil
106
+ expect(visa_checkout_card_details.prepaid).not_to be_nil
107
+ expect(visa_checkout_card_details.product_id).not_to be_nil
108
+ expect(visa_checkout_card_details.token).not_to be_nil
109
109
  end
110
110
  end
@@ -2,10 +2,9 @@ require "securerandom"
2
2
 
3
3
  unless defined?(INTEGRATION_SPEC_HELPER_LOADED)
4
4
  INTEGRATION_SPEC_HELPER_LOADED = true
5
- SSL_TEST_PORT = ENV['SSL_TEST_PORT'] || 8444
5
+ SSL_TEST_PORT = ENV["SSL_TEST_PORT"] || 8444
6
6
 
7
7
  require File.dirname(__FILE__) + "/../spec_helper"
8
- require File.dirname(__FILE__) + "/../hacks/tcp_socket"
9
8
 
10
9
  def start_ssl_server
11
10
  web_server_pid_file = File.expand_path(File.join(File.dirname(__FILE__), "..", "httpsd.pid"))
@@ -13,11 +12,9 @@ unless defined?(INTEGRATION_SPEC_HELPER_LOADED)
13
12
  FileUtils.rm(web_server_pid_file) if File.exist?(web_server_pid_file)
14
13
  command = File.expand_path(File.join(File.dirname(__FILE__), "..", "script", "httpsd.rb"))
15
14
  `#{command} #{web_server_pid_file}`
16
- TCPSocket.wait_for_service :host => "127.0.0.1", :port => SSL_TEST_PORT
15
+ TCPSocket.new("127.0.0.1",SSL_TEST_PORT)
17
16
 
18
- yield
19
-
20
- 10.times { unless File.exists?(web_server_pid_file); sleep 1; end }
17
+ 10.times { unless File.exist?(web_server_pid_file); sleep 1; end }
21
18
  ensure
22
19
  Process.kill "INT", File.read(web_server_pid_file).to_i
23
20
  end
@@ -45,12 +42,24 @@ unless defined?(INTEGRATION_SPEC_HELPER_LOADED)
45
42
  end
46
43
  end
47
44
 
48
- def with_advanced_fraud_integration_merchant(&block)
45
+ def with_advanced_fraud_kount_integration_merchant(&block)
49
46
  with_other_merchant("advanced_fraud_integration_merchant_id", "advanced_fraud_integration_public_key", "advanced_fraud_integration_private_key") do
50
47
  block.call
51
48
  end
52
49
  end
53
50
 
51
+ def with_fraud_protection_enterprise_merchant(&block)
52
+ with_other_merchant("fraud_protection_enterprise_integration_merchant_id", "fraud_protection_enterprise_integration_public_key", "fraud_protection_enterprise_integration_private_key") do
53
+ block.call
54
+ end
55
+ end
56
+
57
+ def with_chargeback_protection_merchant(&block)
58
+ with_other_merchant("fraud_protection_effortless_chargeback_protection_merchant_id", "effortless_chargeback_protection_public_key", "effortless_chargeback_protection_private_key") do
59
+ block.call
60
+ end
61
+ end
62
+
54
63
  def with_altpay_merchant(&block)
55
64
  with_other_merchant("altpay_merchant", "altpay_merchant_public_key", "altpay_merchant_private_key", &block)
56
65
  end
@@ -58,4 +67,10 @@ unless defined?(INTEGRATION_SPEC_HELPER_LOADED)
58
67
  def random_payment_method_token
59
68
  "payment-method-token-#{SecureRandom.hex(6)}"
60
69
  end
70
+
71
+ def with_duplicate_checking_merchant(&block)
72
+ with_other_merchant("dup_checking_integration_merchant_id", "dup_checking_integration_public_key", "dup_checking_integration_private_key") do
73
+ block.call
74
+ end
75
+ end
61
76
  end
@@ -10,7 +10,7 @@ module Braintree
10
10
  def self.create_token(gateway, params)
11
11
  code = create_grant(gateway, params)
12
12
  gateway.oauth.create_token_from_code(
13
- :code => code
13
+ :code => code,
14
14
  )
15
15
  end
16
16
  end
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
- require 'webrick'
3
- require 'webrick/https'
4
- require 'openssl'
2
+ require "webrick"
3
+ require "webrick/https"
4
+ require "openssl"
5
5
 
6
6
  private_key_file = File.expand_path(File.join(File.dirname(__FILE__), "..", "ssl", "privateKey.key"))
7
7
  cert_file = File.expand_path(File.join(File.dirname(__FILE__), "..", "ssl", "certificate.crt"))
@@ -12,7 +12,7 @@ cert = OpenSSL::X509::Certificate.new(File.read(cert_file))
12
12
  pid_file = ARGV[0]
13
13
 
14
14
  s = WEBrick::HTTPServer.new(
15
- :Port => (ENV['SSL_TEST_PORT'] || 8444),
15
+ :Port => (ENV["SSL_TEST_PORT"] || 8444),
16
16
  :Logger => WEBrick::Log::new(nil, WEBrick::Log::ERROR),
17
17
  :DocumentRoot => File.join(File.dirname(__FILE__)),
18
18
  :ServerType => WEBrick::Daemon,
@@ -21,7 +21,7 @@ s = WEBrick::HTTPServer.new(
21
21
  :SSLCertificate => cert,
22
22
  :SSLPrivateKey => pkey,
23
23
  :SSLCertName => [ [ "CN",WEBrick::Utils::getservername ] ],
24
- :StartCallback => proc { File.open(pid_file, "w") { |f| f.write $$.to_s }}
24
+ :StartCallback => proc { File.open(pid_file, "w") { |f| f.write $$.to_s } },
25
25
  )
26
- trap("INT"){ s.shutdown }
26
+ trap("INT") { s.shutdown }
27
27
  s.start