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
@@ -6,7 +6,7 @@ describe Braintree::CreditCardVerification, "search" do
6
6
  search.credit_card_cardholder_name.is "thisnameisnotreal"
7
7
  end
8
8
 
9
- collection.maximum_size.should == 0
9
+ expect(collection.maximum_size).to eq(0)
10
10
  end
11
11
 
12
12
  it "can search on text fields" do
@@ -33,14 +33,14 @@ describe Braintree::CreditCardVerification, "search" do
33
33
  search.id.is verification.id
34
34
  search.send(criterion).is value
35
35
  end
36
- collection.maximum_size.should == 1
37
- collection.first.id.should == verification.id
36
+ expect(collection.maximum_size).to eq(1)
37
+ expect(collection.first.id).to eq(verification.id)
38
38
 
39
39
  collection = Braintree::CreditCardVerification.search do |search|
40
40
  search.id.is verification.id
41
41
  search.send(criterion).is("invalid_attribute")
42
42
  end
43
- collection.should be_empty
43
+ expect(collection).to be_empty
44
44
  end
45
45
 
46
46
  collection = Braintree::CreditCardVerification.search do |search|
@@ -50,8 +50,8 @@ describe Braintree::CreditCardVerification, "search" do
50
50
  end
51
51
  end
52
52
 
53
- collection.maximum_size.should == 1
54
- collection.first.id.should == verification.id
53
+ expect(collection.maximum_size).to eq(1)
54
+ expect(collection.first.id).to eq(verification.id)
55
55
  end
56
56
 
57
57
  describe "multiple value fields" do
@@ -84,7 +84,7 @@ describe Braintree::CreditCardVerification, "search" do
84
84
  search.ids.in verification_id1, verification_id2
85
85
  end
86
86
 
87
- collection.maximum_size.should == 2
87
+ expect(collection.maximum_size).to eq(2)
88
88
  end
89
89
  end
90
90
 
@@ -108,46 +108,46 @@ describe Braintree::CreditCardVerification, "search" do
108
108
  search.id.is verification.id
109
109
  search.created_at.between(
110
110
  created_at - 60,
111
- created_at + 60
111
+ created_at + 60,
112
112
  )
113
113
  end
114
114
 
115
- collection.maximum_size.should == 1
116
- collection.first.id.should == verification.id
115
+ expect(collection.maximum_size).to eq(1)
116
+ expect(collection.first.id).to eq(verification.id)
117
117
 
118
118
  collection = Braintree::CreditCardVerification.search do |search|
119
119
  search.id.is verification.id
120
120
  search.created_at >= created_at - 1
121
121
  end
122
122
 
123
- collection.maximum_size.should == 1
124
- collection.first.id.should == verification.id
123
+ expect(collection.maximum_size).to eq(1)
124
+ expect(collection.first.id).to eq(verification.id)
125
125
 
126
126
  collection = Braintree::CreditCardVerification.search do |search|
127
127
  search.id.is verification.id
128
128
  search.created_at <= created_at + 1
129
129
  end
130
130
 
131
- collection.maximum_size.should == 1
132
- collection.first.id.should == verification.id
131
+ expect(collection.maximum_size).to eq(1)
132
+ expect(collection.first.id).to eq(verification.id)
133
133
 
134
134
  collection = Braintree::CreditCardVerification.search do |search|
135
135
  search.id.is verification.id
136
136
  search.created_at.between(
137
137
  created_at - 300,
138
- created_at - 100
138
+ created_at - 100,
139
139
  )
140
140
  end
141
141
 
142
- collection.maximum_size.should == 0
142
+ expect(collection.maximum_size).to eq(0)
143
143
 
144
144
  collection = Braintree::CreditCardVerification.search do |search|
145
145
  search.id.is verification.id
146
146
  search.created_at.is created_at
147
147
  end
148
148
 
149
- collection.maximum_size.should == 1
150
- collection.first.id.should == verification.id
149
+ expect(collection.maximum_size).to eq(1)
150
+ expect(collection.first.id).to eq(verification.id)
151
151
  end
152
152
  end
153
153
 
@@ -1,4 +1,5 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
2
+ require File.expand_path(File.dirname(__FILE__) + "/client_api/spec_helper")
2
3
 
3
4
  describe Braintree::CreditCardVerification, "search" do
4
5
 
@@ -11,17 +12,18 @@ describe Braintree::CreditCardVerification, "search" do
11
12
  },
12
13
  :options => {
13
14
  :amount => "10.00"
14
- }
15
+ },
15
16
  }
16
17
 
17
18
  result = Braintree::CreditCardVerification.create(verification_params)
18
19
 
19
- result.should be_success
20
- result.credit_card_verification.id.should =~ /^\w{6,}$/
21
- result.credit_card_verification.status.should == Braintree::CreditCardVerification::Status::Verified
22
- result.credit_card_verification.processor_response_code.should == "1000"
23
- result.credit_card_verification.processor_response_text.should == "Approved"
24
- result.credit_card_verification.processor_response_type.should == Braintree::ProcessorResponseTypes::Approved
20
+ expect(result).to be_success
21
+ expect(result.credit_card_verification.id).to match(/^\w{6,}$/)
22
+ expect(result.credit_card_verification.status).to eq(Braintree::CreditCardVerification::Status::Verified)
23
+ expect(result.credit_card_verification.processor_response_code).to eq("1000")
24
+ expect(result.credit_card_verification.processor_response_text).to eq("Approved")
25
+ expect(result.credit_card_verification.processor_response_type).to eq(Braintree::ProcessorResponseTypes::Approved)
26
+ expect(result.credit_card_verification.network_transaction_id).not_to be_nil
25
27
  end
26
28
 
27
29
  it "creates a new verification with network response code/text" do
@@ -46,6 +48,70 @@ describe Braintree::CreditCardVerification, "search" do
46
48
  expect(result.credit_card_verification.processor_response_type).to eq(Braintree::ProcessorResponseTypes::Approved)
47
49
  end
48
50
 
51
+ it "creates a new verification for Visa ANI" do
52
+ verification_params = {
53
+ :credit_card => {
54
+ :expiration_date => "05/2012",
55
+ :number => Braintree::Test::CreditCardNumbers::Visa,
56
+ },
57
+ }
58
+
59
+ result = Braintree::CreditCardVerification.create(verification_params)
60
+
61
+ expect(result).to be_success
62
+ expect(result.credit_card_verification.status).to eq(Braintree::CreditCardVerification::Status::Verified)
63
+ expect(result.credit_card_verification.processor_response_code).to eq("1000")
64
+ expect(result.credit_card_verification.processor_response_text).to eq("Approved")
65
+ expect(result.credit_card_verification.ani_first_name_response_code).to eq("I")
66
+ expect(result.credit_card_verification.ani_last_name_response_code).to eq("I")
67
+ expect(result.credit_card_verification.processor_response_type).to eq(Braintree::ProcessorResponseTypes::Approved)
68
+ end
69
+
70
+ it "creates a new verification from external vault param" do
71
+ verification_params = {
72
+ :credit_card => {
73
+ :expiration_date => "05/2029",
74
+ :number => Braintree::Test::CreditCardNumbers::Visa,
75
+ },
76
+ :external_vault => {
77
+ :status => "will_vault"
78
+ }
79
+ }
80
+
81
+ result = Braintree::CreditCardVerification.create(verification_params)
82
+
83
+ expect(result).to be_success
84
+ expect(result.credit_card_verification.id).to match(/^\w{6,}$/)
85
+ expect(result.credit_card_verification.status).to eq(Braintree::CreditCardVerification::Status::Verified)
86
+ expect(result.credit_card_verification.processor_response_code).to eq("1000")
87
+ expect(result.credit_card_verification.processor_response_text).to eq("Approved")
88
+ expect(result.credit_card_verification.processor_response_type).to eq(Braintree::ProcessorResponseTypes::Approved)
89
+ expect(result.credit_card_verification.network_transaction_id).not_to be_nil
90
+ end
91
+
92
+ it "creates a new verification from risk data param" do
93
+ verification_params = {
94
+ :credit_card => {
95
+ :expiration_date => "05/2029",
96
+ :number => Braintree::Test::CreditCardNumbers::Visa,
97
+ },
98
+ :risk_data => {
99
+ :customer_browser => "IE7",
100
+ :customer_ip => "192.168.0.1"
101
+ }
102
+ }
103
+
104
+ result = Braintree::CreditCardVerification.create(verification_params)
105
+
106
+ expect(result).to be_success
107
+ expect(result.credit_card_verification.id).to match(/^\w{6,}$/)
108
+ expect(result.credit_card_verification.status).to eq(Braintree::CreditCardVerification::Status::Verified)
109
+ expect(result.credit_card_verification.processor_response_code).to eq("1000")
110
+ expect(result.credit_card_verification.processor_response_text).to eq("Approved")
111
+ expect(result.credit_card_verification.processor_response_type).to eq(Braintree::ProcessorResponseTypes::Approved)
112
+ expect(result.credit_card_verification.network_transaction_id).not_to be_nil
113
+ end
114
+
49
115
  it "returns processor response code and text as well as the additional processor response if declined" do
50
116
  verification_params = {
51
117
  :credit_card => {
@@ -59,12 +125,12 @@ describe Braintree::CreditCardVerification, "search" do
59
125
 
60
126
  result = Braintree::CreditCardVerification.create(verification_params)
61
127
 
62
- result.success?.should == false
63
- result.credit_card_verification.id.should =~ /^\w{6,}$/
64
- result.credit_card_verification.status.should == Braintree::CreditCardVerification::Status::ProcessorDeclined
65
- result.credit_card_verification.processor_response_code.should == "2000"
66
- result.credit_card_verification.processor_response_text.should == "Do Not Honor"
67
- result.credit_card_verification.processor_response_type.should == Braintree::ProcessorResponseTypes::SoftDeclined
128
+ expect(result.success?).to eq(false)
129
+ expect(result.credit_card_verification.id).to match(/^\w{6,}$/)
130
+ expect(result.credit_card_verification.status).to eq(Braintree::CreditCardVerification::Status::ProcessorDeclined)
131
+ expect(result.credit_card_verification.processor_response_code).to eq("2000")
132
+ expect(result.credit_card_verification.processor_response_text).to eq("Do Not Honor")
133
+ expect(result.credit_card_verification.processor_response_type).to eq(Braintree::ProcessorResponseTypes::SoftDeclined)
68
134
  end
69
135
 
70
136
  it "returns validation errors" do
@@ -80,8 +146,8 @@ describe Braintree::CreditCardVerification, "search" do
80
146
 
81
147
  result = Braintree::CreditCardVerification.create(verification_params)
82
148
 
83
- result.success?.should == false
84
- result.errors.for(:verification).for(:options).first.code.should == Braintree::ErrorCodes::Verification::Options::AmountCannotBeNegative
149
+ expect(result.success?).to eq(false)
150
+ expect(result.errors.for(:verification).for(:options).first.code).to eq(Braintree::ErrorCodes::Verification::Options::AmountCannotBeNegative)
85
151
  end
86
152
 
87
153
  it "returns account type with debit" do
@@ -91,13 +157,13 @@ describe Braintree::CreditCardVerification, "search" do
91
157
  :number => Braintree::Test::CreditCardNumbers::Hiper
92
158
  },
93
159
  :options => {
94
- :merchant_account_id => SpecHelper::HiperBRLMerchantAccountId,
160
+ :merchant_account_id => SpecHelper::CardProcessorBRLMerchantAccountId,
95
161
  :account_type => "debit",
96
162
  },
97
163
  )
98
164
 
99
- result.success?.should == true
100
- result.credit_card_verification.credit_card[:account_type].should == "debit"
165
+ expect(result.success?).to eq(true)
166
+ expect(result.credit_card_verification.credit_card[:account_type]).to eq("debit")
101
167
  end
102
168
 
103
169
  it "returns account type with credit" do
@@ -112,8 +178,8 @@ describe Braintree::CreditCardVerification, "search" do
112
178
  },
113
179
  )
114
180
 
115
- result.success?.should == true
116
- result.credit_card_verification.credit_card[:account_type].should == "credit"
181
+ expect(result.success?).to eq(true)
182
+ expect(result.credit_card_verification.credit_card[:account_type]).to eq("credit")
117
183
  end
118
184
 
119
185
  it "errors with unsupported account type" do
@@ -127,8 +193,8 @@ describe Braintree::CreditCardVerification, "search" do
127
193
  },
128
194
  )
129
195
 
130
- result.success?.should == false
131
- result.errors.for(:verification).for(:options).on(:account_type)[0].code.should == Braintree::ErrorCodes::Verification::Options::AccountTypeNotSupported
196
+ expect(result.success?).to eq(false)
197
+ expect(result.errors.for(:verification).for(:options).on(:account_type)[0].code).to eq(Braintree::ErrorCodes::Verification::Options::AccountTypeNotSupported)
132
198
  end
133
199
 
134
200
  it "errors with invalid account type" do
@@ -143,8 +209,8 @@ describe Braintree::CreditCardVerification, "search" do
143
209
  },
144
210
  )
145
211
 
146
- result.success?.should == false
147
- result.errors.for(:verification).for(:options).on(:account_type)[0].code.should == Braintree::ErrorCodes::Verification::Options::AccountTypeIsInvalid
212
+ expect(result.success?).to eq(false)
213
+ expect(result.errors.for(:verification).for(:options).on(:account_type)[0].code).to eq(Braintree::ErrorCodes::Verification::Options::AccountTypeIsInvalid)
148
214
  end
149
215
  end
150
216
 
@@ -160,7 +226,8 @@ describe Braintree::CreditCardVerification, "search" do
160
226
  credit_card_verification = Braintree::Customer.create(:credit_card => credit_card_params).credit_card_verification
161
227
  found_verification = Braintree::CreditCardVerification.find(credit_card_verification.id)
162
228
 
163
- found_verification.should == credit_card_verification
229
+ expect(found_verification).to eq(credit_card_verification)
230
+ expect(found_verification.graphql_id).not_to be_nil
164
231
  end
165
232
 
166
233
  it "raises a NotFoundError exception if verification cannot be found" do
@@ -212,7 +279,7 @@ describe Braintree::CreditCardVerification, "search" do
212
279
  search.status.in credit_card_verification.status
213
280
  end
214
281
 
215
- found_verifications.should include(credit_card_verification)
282
+ expect(found_verifications).to include(credit_card_verification)
216
283
  end
217
284
 
218
285
  it "searches and finds verifications using customer fields" do
@@ -228,19 +295,19 @@ describe Braintree::CreditCardVerification, "search" do
228
295
  search.payment_method_token.is credit_card.token
229
296
  end
230
297
 
231
- found_verifications.count.should eq(1)
298
+ expect(found_verifications.count).to eq(1)
232
299
  end
233
300
 
234
301
  describe "card type indicators" do
235
302
  it "returns prepaid on a prepaid card" do
236
303
  cardholder_name = "Tom #{rand(1_000_000)} Smith"
237
304
 
238
- result = Braintree::Customer.create(
305
+ Braintree::Customer.create(
239
306
  :credit_card => {
240
307
  :cardholder_name => cardholder_name,
241
308
  :expiration_date => "05/2012",
242
309
  :number => Braintree::Test::CreditCardNumbers::CardTypeIndicators::Prepaid,
243
- :cvv => '200',
310
+ :cvv => "200",
244
311
  :options => {
245
312
  :verify_card => true
246
313
  }
@@ -253,8 +320,130 @@ describe Braintree::CreditCardVerification, "search" do
253
320
  verification_id = search_results.first.id
254
321
 
255
322
  found_verification = Braintree::CreditCardVerification.find(verification_id)
256
- found_verification.credit_card[:prepaid].should == Braintree::CreditCard::Prepaid::Yes
323
+ expect(found_verification.credit_card[:prepaid]).to eq(Braintree::CreditCard::Prepaid::Yes)
257
324
  end
258
325
  end
259
326
  end
327
+
328
+ describe "intended transaction source" do
329
+ it "creates a new verification with intended transaction source installment" do
330
+ verification_params = {
331
+ :credit_card => {
332
+ :expiration_date => "05/2029",
333
+ :number => Braintree::Test::CreditCardNumbers::Visa,
334
+ },
335
+ :options => {
336
+ :amount => "10.00"
337
+ },
338
+ :intended_transaction_source => "installment"
339
+ }
340
+
341
+ result = Braintree::CreditCardVerification.create(verification_params)
342
+
343
+ expect(result).to be_success
344
+ expect(result.credit_card_verification.id).to match(/^\w{6,}$/)
345
+ expect(result.credit_card_verification.status).to eq(Braintree::CreditCardVerification::Status::Verified)
346
+ expect(result.credit_card_verification.processor_response_code).to eq("1000")
347
+ expect(result.credit_card_verification.processor_response_text).to eq("Approved")
348
+ expect(result.credit_card_verification.processor_response_type).to eq(Braintree::ProcessorResponseTypes::Approved)
349
+ expect(result.credit_card_verification.network_transaction_id).not_to be_nil
350
+ end
351
+ end
352
+
353
+ context "three_d_secure" do
354
+ it "can create a verification with a three_d_secure_authentication_id" do
355
+ three_d_secure_authentication_id = SpecHelper.create_3ds_verification(
356
+ SpecHelper::ThreeDSecureMerchantAccountId,
357
+ :number => Braintree::Test::CreditCardNumbers::Visa,
358
+ :expiration_month => "12",
359
+ :expiration_year => "2029",
360
+ )
361
+
362
+ verification_params = {
363
+ :credit_card => {
364
+ :expiration_date => "12/2029",
365
+ :number => Braintree::Test::CreditCardNumbers::Visa,
366
+ },
367
+ :options => {
368
+ :amount => "10.00",
369
+ :merchant_account_id => SpecHelper::ThreeDSecureMerchantAccountId,
370
+ },
371
+ :three_d_secure_authentication_id => three_d_secure_authentication_id,
372
+ }
373
+
374
+ result = Braintree::CreditCardVerification.create(verification_params)
375
+
376
+ expect(result).to be_success
377
+ expect(result.credit_card_verification.id).to match(/^\w{6,}$/)
378
+ expect(result.credit_card_verification.status).to eq(Braintree::CreditCardVerification::Status::Verified)
379
+ expect(result.credit_card_verification.processor_response_code).to eq("1000")
380
+ expect(result.credit_card_verification.processor_response_text).to eq("Approved")
381
+ expect(result.credit_card_verification.processor_response_type).to eq(Braintree::ProcessorResponseTypes::Approved)
382
+ expect(result.credit_card_verification.network_transaction_id).not_to be_nil
383
+ end
384
+
385
+ it "can create a verification with a payment_method_nonce" do
386
+ nonce = nonce_for_new_payment_method(
387
+ :credit_card => {
388
+ :number => Braintree::Test::CreditCardNumbers::Visa,
389
+ :expiration_month => "11",
390
+ :expiration_year => "2099",
391
+ },
392
+ )
393
+ expect(nonce).not_to be_nil
394
+
395
+ verification_params = {
396
+ :credit_card => {
397
+ :number => Braintree::Test::CreditCardNumbers::Visa,
398
+ },
399
+ :options => {
400
+ :amount => "10.00",
401
+ :merchant_account_id => SpecHelper::ThreeDSecureMerchantAccountId,
402
+ },
403
+ :payment_method_nonce => nonce,
404
+ }
405
+
406
+ result = Braintree::CreditCardVerification.create(verification_params)
407
+
408
+ expect(result).to be_success
409
+ expect(result.credit_card_verification.id).to match(/^\w{6,}$/)
410
+ expect(result.credit_card_verification.status).to eq(Braintree::CreditCardVerification::Status::Verified)
411
+ expect(result.credit_card_verification.processor_response_code).to eq("1000")
412
+ expect(result.credit_card_verification.processor_response_text).to eq("Approved")
413
+ expect(result.credit_card_verification.processor_response_type).to eq(Braintree::ProcessorResponseTypes::Approved)
414
+ expect(result.credit_card_verification.network_transaction_id).not_to be_nil
415
+ end
416
+
417
+ it "can create a verification with a verification_three_d_secure_pass_thru" do
418
+ verification_params = {
419
+ :credit_card => {
420
+ :number => Braintree::Test::CreditCardNumbers::Visa,
421
+ :expiration_date => "12/12",
422
+ },
423
+ :options => {
424
+ :amount => "10.00",
425
+ },
426
+ :three_d_secure_pass_thru => {
427
+ :eci_flag => "05",
428
+ :cavv => "some_cavv",
429
+ :xid => "some_xid",
430
+ :three_d_secure_version => "1.0.2",
431
+ :authentication_response => "Y",
432
+ :directory_response => "Y",
433
+ :cavv_algorithm => "2",
434
+ :ds_transaction_id => "some_ds_id",
435
+ },
436
+ }
437
+
438
+ result = Braintree::CreditCardVerification.create(verification_params)
439
+
440
+ expect(result).to be_success
441
+ expect(result.credit_card_verification.id).to match(/^\w{6,}$/)
442
+ expect(result.credit_card_verification.status).to eq(Braintree::CreditCardVerification::Status::Verified)
443
+ expect(result.credit_card_verification.processor_response_code).to eq("1000")
444
+ expect(result.credit_card_verification.processor_response_text).to eq("Approved")
445
+ expect(result.credit_card_verification.processor_response_type).to eq(Braintree::ProcessorResponseTypes::Approved)
446
+ expect(result.credit_card_verification.network_transaction_id).not_to be_nil
447
+ end
448
+ end
260
449
  end
@@ -8,7 +8,7 @@ describe Braintree::Transaction, "search" do
8
8
  search.first_name.is "thisnameisnotreal"
9
9
  end
10
10
 
11
- collection.maximum_size.should == 0
11
+ expect(collection.maximum_size).to eq(0)
12
12
  end
13
13
 
14
14
  it "can search on text fields" do
@@ -36,7 +36,7 @@ describe Braintree::Transaction, "search" do
36
36
  :postal_code => "60622",
37
37
  :country_name => "United States of America"
38
38
  }
39
- }
39
+ },
40
40
  )
41
41
 
42
42
  customer = Braintree::Customer.find(customer.id)
@@ -69,14 +69,14 @@ describe Braintree::Transaction, "search" do
69
69
  search.send(criterion).is value
70
70
  end
71
71
 
72
- collection.maximum_size.should == 1
73
- collection.first.id.should == customer.id
72
+ expect(collection.maximum_size).to eq(1)
73
+ expect(collection.first.id).to eq(customer.id)
74
74
 
75
75
  collection = Braintree::Customer.search do |search|
76
76
  search.id.is customer.id
77
77
  search.send(criterion).is("invalid_attribute")
78
78
  end
79
- collection.should be_empty
79
+ expect(collection).to be_empty
80
80
  end
81
81
 
82
82
  collection = Braintree::Customer.search do |search|
@@ -86,8 +86,8 @@ describe Braintree::Transaction, "search" do
86
86
  end
87
87
  end
88
88
 
89
- collection.maximum_size.should == 1
90
- collection.first.id.should == customer.id
89
+ expect(collection.maximum_size).to eq(1)
90
+ expect(collection.first.id).to eq(customer.id)
91
91
  end
92
92
 
93
93
  it "can find duplicate credit cards for a give payment method token " do
@@ -96,7 +96,7 @@ describe Braintree::Transaction, "search" do
96
96
  :credit_card => {
97
97
  :number => Braintree::Test::CreditCardNumbers::Maestro,
98
98
  :expiration_date => "05/2012"
99
- }
99
+ },
100
100
  ).customer
101
101
 
102
102
  joe = Braintree::Customer.create(
@@ -104,70 +104,70 @@ describe Braintree::Transaction, "search" do
104
104
  :credit_card => {
105
105
  :number => Braintree::Test::CreditCardNumbers::Maestro,
106
106
  :expiration_date => "05/2012"
107
- }
107
+ },
108
108
  ).customer
109
109
 
110
110
  collection = Braintree::Customer.search do |search|
111
111
  search.payment_method_token_with_duplicates.is jim.credit_cards.first.token
112
112
  end
113
113
 
114
- collection.should include(jim)
115
- collection.should include(joe)
114
+ expect(collection).to include(jim)
115
+ expect(collection).to include(joe)
116
116
  end
117
117
 
118
118
  it "can search by created_at" do
119
119
  company = "Company #{rand(1_000_000)}"
120
120
  customer = Braintree::Customer.create!(
121
- :company => company
121
+ :company => company,
122
122
  )
123
123
 
124
124
  created_at = customer.created_at
125
- created_at.should be_utc
125
+ expect(created_at).to be_utc
126
126
 
127
127
  collection = Braintree::Customer.search do |search|
128
128
  search.company.is company
129
129
  search.created_at.between(
130
130
  created_at - 60,
131
- created_at + 60
131
+ created_at + 60,
132
132
  )
133
133
  end
134
134
 
135
- collection.maximum_size.should == 1
136
- collection.first.id.should == customer.id
135
+ expect(collection.maximum_size).to eq(1)
136
+ expect(collection.first.id).to eq(customer.id)
137
137
 
138
138
  collection = Braintree::Customer.search do |search|
139
139
  search.company.is customer.company
140
140
  search.created_at >= created_at - 1
141
141
  end
142
142
 
143
- collection.maximum_size.should == 1
144
- collection.first.company.should == customer.company
143
+ expect(collection.maximum_size).to eq(1)
144
+ expect(collection.first.company).to eq(customer.company)
145
145
 
146
146
  collection = Braintree::Customer.search do |search|
147
147
  search.company.is customer.company
148
148
  search.created_at <= created_at + 1
149
149
  end
150
150
 
151
- collection.maximum_size.should == 1
152
- collection.first.company.should == customer.company
151
+ expect(collection.maximum_size).to eq(1)
152
+ expect(collection.first.company).to eq(customer.company)
153
153
 
154
154
  collection = Braintree::Customer.search do |search|
155
155
  search.company.is customer.company
156
156
  search.created_at.between(
157
157
  created_at - 300,
158
- created_at - 100
158
+ created_at - 100,
159
159
  )
160
160
  end
161
161
 
162
- collection.maximum_size.should == 0
162
+ expect(collection.maximum_size).to eq(0)
163
163
 
164
164
  collection = Braintree::Customer.search do |search|
165
165
  search.company.is customer.company
166
166
  search.created_at.is created_at
167
167
  end
168
168
 
169
- collection.maximum_size.should == 1
170
- collection.first.company.should == customer.company
169
+ expect(collection.maximum_size).to eq(1)
170
+ expect(collection.first.company).to eq(customer.company)
171
171
  end
172
172
  end
173
173
 
@@ -175,13 +175,13 @@ describe Braintree::Transaction, "search" do
175
175
  paypal_token = rand(36**3).to_s(36)
176
176
  nonce = nonce_for_paypal_account(
177
177
  :consent_code => "PAYPAL_CONSENT_CODE",
178
- :token => paypal_token
178
+ :token => paypal_token,
179
179
  )
180
180
 
181
181
  customer_id = "UNIQUE_CUSTOMER_ID_" + rand(36**3).to_s(36)
182
182
  customer = Braintree::Customer.create!(
183
183
  :payment_method_nonce => nonce,
184
- :id => customer_id
184
+ :id => customer_id,
185
185
  )
186
186
 
187
187
  collection = Braintree::Customer.search do |search|
@@ -189,7 +189,7 @@ describe Braintree::Transaction, "search" do
189
189
  search.id.is customer_id
190
190
  end
191
191
 
192
- collection.maximum_size.should == 1
193
- collection.first.should == customer
192
+ expect(collection.maximum_size).to eq(1)
193
+ expect(collection.first).to eq(customer)
194
194
  end
195
195
  end