braintree 4.14.0 → 4.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (241) hide show
  1. checksums.yaml +4 -4
  2. data/lib/braintree/account_updater_daily_report.rb +3 -3
  3. data/lib/braintree/ach_mandate.rb +1 -1
  4. data/lib/braintree/add_on_gateway.rb +1 -1
  5. data/lib/braintree/address.rb +4 -4
  6. data/lib/braintree/address_gateway.rb +5 -5
  7. data/lib/braintree/advanced_search.rb +10 -10
  8. data/lib/braintree/apple_pay.rb +3 -3
  9. data/lib/braintree/apple_pay_card.rb +3 -3
  10. data/lib/braintree/apple_pay_options.rb +3 -3
  11. data/lib/braintree/authorization_adjustment.rb +3 -3
  12. data/lib/braintree/base_module.rb +1 -1
  13. data/lib/braintree/bin_data.rb +2 -2
  14. data/lib/braintree/client_token_gateway.rb +1 -1
  15. data/lib/braintree/configuration.rb +22 -22
  16. data/lib/braintree/connected_merchant_paypal_status_changed.rb +1 -1
  17. data/lib/braintree/connected_merchant_status_transitioned.rb +1 -1
  18. data/lib/braintree/credit_card.rb +22 -9
  19. data/lib/braintree/credit_card_gateway.rb +23 -11
  20. data/lib/braintree/credit_card_verification.rb +3 -3
  21. data/lib/braintree/credit_card_verification_search.rb +1 -1
  22. data/lib/braintree/customer.rb +5 -9
  23. data/lib/braintree/customer_gateway.rb +7 -7
  24. data/lib/braintree/customer_search.rb +1 -1
  25. data/lib/braintree/descriptor.rb +1 -1
  26. data/lib/braintree/digest.rb +1 -1
  27. data/lib/braintree/disbursement.rb +5 -5
  28. data/lib/braintree/discount_gateway.rb +1 -1
  29. data/lib/braintree/dispute/evidence.rb +1 -1
  30. data/lib/braintree/dispute/paypal_message.rb +1 -1
  31. data/lib/braintree/dispute/status_history.rb +1 -1
  32. data/lib/braintree/dispute/transaction.rb +1 -1
  33. data/lib/braintree/dispute/transaction_details.rb +1 -1
  34. data/lib/braintree/dispute.rb +3 -3
  35. data/lib/braintree/dispute_gateway.rb +1 -1
  36. data/lib/braintree/dispute_search.rb +1 -1
  37. data/lib/braintree/document_upload.rb +2 -2
  38. data/lib/braintree/document_upload_gateway.rb +3 -3
  39. data/lib/braintree/enriched_customer_data.rb +2 -2
  40. data/lib/braintree/error_result.rb +2 -3
  41. data/lib/braintree/errors.rb +3 -3
  42. data/lib/braintree/exceptions.rb +1 -2
  43. data/lib/braintree/exchange_rate.rb +2 -2
  44. data/lib/braintree/exchange_rate_quote.rb +3 -3
  45. data/lib/braintree/exchange_rate_quote_gateway.rb +1 -1
  46. data/lib/braintree/exchange_rate_quote_input.rb +3 -3
  47. data/lib/braintree/exchange_rate_quote_request.rb +3 -3
  48. data/lib/braintree/exchange_rate_quote_response.rb +3 -3
  49. data/lib/braintree/facilitated_details.rb +1 -1
  50. data/lib/braintree/facilitator_details.rb +1 -1
  51. data/lib/braintree/google_pay_card.rb +3 -3
  52. data/lib/braintree/granted_payment_instrument_update.rb +1 -1
  53. data/lib/braintree/graphql_client.rb +1 -1
  54. data/lib/braintree/http.rb +1 -1
  55. data/lib/braintree/local_payment_completed.rb +2 -2
  56. data/lib/braintree/local_payment_expired.rb +2 -2
  57. data/lib/braintree/local_payment_funded.rb +2 -2
  58. data/lib/braintree/local_payment_reversed.rb +2 -2
  59. data/lib/braintree/merchant.rb +3 -3
  60. data/lib/braintree/merchant_account.rb +2 -2
  61. data/lib/braintree/merchant_account_gateway.rb +9 -9
  62. data/lib/braintree/meta_checkout_card.rb +89 -0
  63. data/lib/braintree/meta_checkout_token.rb +88 -0
  64. data/lib/braintree/modification.rb +3 -3
  65. data/lib/braintree/oauth_credentials.rb +3 -3
  66. data/lib/braintree/paginated_collection.rb +2 -2
  67. data/lib/braintree/paginated_result.rb +1 -1
  68. data/lib/braintree/payment_instrument_type.rb +2 -0
  69. data/lib/braintree/payment_method_customer_data_updated_metadata.rb +2 -2
  70. data/lib/braintree/payment_method_gateway.rb +23 -10
  71. data/lib/braintree/payment_method_nonce.rb +4 -4
  72. data/lib/braintree/payment_method_nonce_details.rb +1 -1
  73. data/lib/braintree/payment_method_nonce_details_payer_info.rb +1 -1
  74. data/lib/braintree/payment_method_nonce_gateway.rb +1 -1
  75. data/lib/braintree/paypal_account.rb +1 -2
  76. data/lib/braintree/paypal_account_gateway.rb +5 -5
  77. data/lib/braintree/plan.rb +1 -1
  78. data/lib/braintree/plan_gateway.rb +2 -2
  79. data/lib/braintree/resource_collection.rb +2 -2
  80. data/lib/braintree/revoked_payment_method_metadata.rb +1 -1
  81. data/lib/braintree/risk_data.rb +1 -1
  82. data/lib/braintree/samsung_pay_card.rb +5 -5
  83. data/lib/braintree/sepa_direct_debit_account.rb +2 -2
  84. data/lib/braintree/sepa_direct_debit_account_nonce_details.rb +1 -1
  85. data/lib/braintree/settlement_batch_summary_gateway.rb +1 -1
  86. data/lib/braintree/sha256_digest.rb +1 -1
  87. data/lib/braintree/subscription/status_details.rb +1 -1
  88. data/lib/braintree/subscription.rb +2 -2
  89. data/lib/braintree/subscription_gateway.rb +6 -6
  90. data/lib/braintree/subscription_search.rb +1 -1
  91. data/lib/braintree/successful_result.rb +2 -2
  92. data/lib/braintree/test/credit_card.rb +7 -10
  93. data/lib/braintree/test/merchant_account.rb +1 -1
  94. data/lib/braintree/test/nonce.rb +4 -0
  95. data/lib/braintree/test/transaction_amounts.rb +2 -3
  96. data/lib/braintree/test/venmo_sdk.rb +2 -0
  97. data/lib/braintree/testing_gateway.rb +1 -1
  98. data/lib/braintree/three_d_secure_info.rb +1 -1
  99. data/lib/braintree/transaction/address_details.rb +1 -1
  100. data/lib/braintree/transaction/credit_card_details.rb +4 -1
  101. data/lib/braintree/transaction/customer_details.rb +1 -1
  102. data/lib/braintree/transaction/disbursement_details.rb +1 -1
  103. data/lib/braintree/transaction/local_payment_details.rb +2 -0
  104. data/lib/braintree/transaction/meta_checkout_card_details.rb +52 -0
  105. data/lib/braintree/transaction/meta_checkout_token_details.rb +54 -0
  106. data/lib/braintree/transaction/samsung_pay_card_details.rb +1 -1
  107. data/lib/braintree/transaction/sepa_direct_debit_account_details.rb +1 -1
  108. data/lib/braintree/transaction/status_details.rb +1 -1
  109. data/lib/braintree/transaction/subscription_details.rb +1 -1
  110. data/lib/braintree/transaction/us_bank_account_details.rb +1 -1
  111. data/lib/braintree/transaction/visa_checkout_card_details.rb +1 -1
  112. data/lib/braintree/transaction.rb +27 -20
  113. data/lib/braintree/transaction_gateway.rb +23 -12
  114. data/lib/braintree/transaction_line_item.rb +2 -2
  115. data/lib/braintree/transaction_line_item_gateway.rb +1 -1
  116. data/lib/braintree/transaction_review.rb +1 -1
  117. data/lib/braintree/transaction_search.rb +7 -6
  118. data/lib/braintree/unknown_payment_method.rb +1 -1
  119. data/lib/braintree/us_bank_account.rb +2 -2
  120. data/lib/braintree/us_bank_account_verification.rb +23 -15
  121. data/lib/braintree/us_bank_account_verification_search.rb +1 -1
  122. data/lib/braintree/util.rb +3 -3
  123. data/lib/braintree/validation_error.rb +1 -1
  124. data/lib/braintree/validation_error_collection.rb +3 -3
  125. data/lib/braintree/venmo_account.rb +3 -3
  126. data/lib/braintree/venmo_profile_data.rb +6 -4
  127. data/lib/braintree/version.rb +1 -1
  128. data/lib/braintree/visa_checkout_card.rb +7 -7
  129. data/lib/braintree/webhook_notification.rb +3 -2
  130. data/lib/braintree/webhook_notification_gateway.rb +3 -3
  131. data/lib/braintree/webhook_testing.rb +1 -1
  132. data/lib/braintree/webhook_testing_gateway.rb +18 -1
  133. data/lib/braintree/xml/generator.rb +1 -1
  134. data/lib/braintree/xml/libxml.rb +1 -1
  135. data/lib/braintree/xml/parser.rb +2 -2
  136. data/lib/braintree/xml/rexml.rb +2 -2
  137. data/lib/braintree/xml.rb +1 -1
  138. data/lib/braintree.rb +4 -1
  139. data/spec/integration/braintree/add_on_spec.rb +9 -9
  140. data/spec/integration/braintree/address_spec.rb +69 -69
  141. data/spec/integration/braintree/advanced_search_spec.rb +45 -45
  142. data/spec/integration/braintree/apple_pay_spec.rb +8 -8
  143. data/spec/integration/braintree/client_api/client_token_spec.rb +15 -15
  144. data/spec/integration/braintree/credit_card_spec.rb +223 -223
  145. data/spec/integration/braintree/credit_card_verification_search_spec.rb +16 -16
  146. data/spec/integration/braintree/credit_card_verification_spec.rb +52 -52
  147. data/spec/integration/braintree/customer_search_spec.rb +20 -20
  148. data/spec/integration/braintree/customer_spec.rb +313 -313
  149. data/spec/integration/braintree/disbursement_spec.rb +2 -2
  150. data/spec/integration/braintree/discount_spec.rb +9 -9
  151. data/spec/integration/braintree/dispute_search_spec.rb +0 -1
  152. data/spec/integration/braintree/dispute_spec.rb +87 -87
  153. data/spec/integration/braintree/document_upload_spec.rb +17 -17
  154. data/spec/integration/braintree/error_codes_spec.rb +2 -2
  155. data/spec/integration/braintree/http_spec.rb +28 -28
  156. data/spec/integration/braintree/merchant_account_spec.rb +127 -127
  157. data/spec/integration/braintree/merchant_spec.rb +103 -103
  158. data/spec/integration/braintree/oauth_spec.rb +61 -61
  159. data/spec/integration/braintree/payment_method_nonce_spec.rb +89 -69
  160. data/spec/integration/braintree/payment_method_spec.rb +389 -389
  161. data/spec/integration/braintree/payment_method_us_bank_account_spec.rb +150 -78
  162. data/spec/integration/braintree/paypal_account_spec.rb +38 -38
  163. data/spec/integration/braintree/plan_spec.rb +15 -15
  164. data/spec/integration/braintree/samsung_pay_card_spec.rb +65 -65
  165. data/spec/integration/braintree/sepa_direct_debit_account_spec.rb +51 -51
  166. data/spec/integration/braintree/settlement_batch_summary_spec.rb +11 -11
  167. data/spec/integration/braintree/subscription_spec.rb +364 -364
  168. data/spec/integration/braintree/test/transaction_amounts_spec.rb +2 -2
  169. data/spec/integration/braintree/test_transaction_spec.rb +19 -19
  170. data/spec/integration/braintree/transaction_line_item_spec.rb +6 -6
  171. data/spec/integration/braintree/transaction_search_spec.rb +225 -165
  172. data/spec/integration/braintree/transaction_spec.rb +1502 -1210
  173. data/spec/integration/braintree/transaction_us_bank_account_spec.rb +32 -32
  174. data/spec/integration/braintree/us_bank_account_spec.rb +30 -30
  175. data/spec/integration/braintree/us_bank_account_verification_search_spec.rb +18 -18
  176. data/spec/integration/braintree/us_bank_account_verification_spec.rb +33 -33
  177. data/spec/integration/braintree/visa_checkout_card_spec.rb +57 -57
  178. data/spec/spec_helper.rb +9 -8
  179. data/spec/unit/braintree/address_spec.rb +8 -8
  180. data/spec/unit/braintree/base_module_spec.rb +4 -4
  181. data/spec/unit/braintree/client_token_spec.rb +2 -2
  182. data/spec/unit/braintree/configuration_spec.rb +57 -57
  183. data/spec/unit/braintree/credentials_parser_spec.rb +6 -6
  184. data/spec/unit/braintree/credit_card_spec.rb +31 -29
  185. data/spec/unit/braintree/credit_card_verification_gateway_spec.rb +28 -28
  186. data/spec/unit/braintree/credit_card_verification_search_spec.rb +9 -9
  187. data/spec/unit/braintree/credit_card_verification_spec.rb +17 -17
  188. data/spec/unit/braintree/customer_spec.rb +41 -40
  189. data/spec/unit/braintree/digest_spec.rb +5 -5
  190. data/spec/unit/braintree/disbursement_spec.rb +11 -11
  191. data/spec/unit/braintree/dispute_search_spec.rb +2 -2
  192. data/spec/unit/braintree/dispute_spec.rb +56 -56
  193. data/spec/unit/braintree/document_upload_spec.rb +8 -8
  194. data/spec/unit/braintree/enriched_customer_data_spec.rb +11 -2
  195. data/spec/unit/braintree/error_result_spec.rb +5 -5
  196. data/spec/unit/braintree/errors_spec.rb +9 -9
  197. data/spec/unit/braintree/http_spec.rb +9 -9
  198. data/spec/unit/braintree/local_payment_completed_spec.rb +11 -11
  199. data/spec/unit/braintree/local_payment_expired_spec.rb +2 -2
  200. data/spec/unit/braintree/local_payment_funded_spec.rb +6 -6
  201. data/spec/unit/braintree/merchant_account_spec.rb +4 -4
  202. data/spec/unit/braintree/meta_checkout_card_details_spec.rb +60 -0
  203. data/spec/unit/braintree/meta_checkout_card_spec.rb +60 -0
  204. data/spec/unit/braintree/meta_checkout_token_details_spec.rb +63 -0
  205. data/spec/unit/braintree/meta_checkout_token_spec.rb +63 -0
  206. data/spec/unit/braintree/modification_spec.rb +1 -1
  207. data/spec/unit/braintree/payment_method_customer_data_updated_metadata_spec.rb +6 -6
  208. data/spec/unit/braintree/payment_method_nonce_details_payer_info_spec.rb +7 -7
  209. data/spec/unit/braintree/payment_method_nonce_details_spec.rb +14 -14
  210. data/spec/unit/braintree/payment_method_spec.rb +19 -19
  211. data/spec/unit/braintree/paypal_account_spec.rb +4 -4
  212. data/spec/unit/braintree/resource_collection_spec.rb +7 -7
  213. data/spec/unit/braintree/sepa_debit_account_nonce_details_spec.rb +1 -1
  214. data/spec/unit/braintree/sha256_digest_spec.rb +1 -1
  215. data/spec/unit/braintree/signature_service_spec.rb +2 -2
  216. data/spec/unit/braintree/subscription_search_spec.rb +17 -17
  217. data/spec/unit/braintree/subscription_spec.rb +8 -8
  218. data/spec/unit/braintree/successful_result_spec.rb +5 -5
  219. data/spec/unit/braintree/three_d_secure_info_spec.rb +20 -20
  220. data/spec/unit/braintree/transaction/credit_card_details_spec.rb +5 -5
  221. data/spec/unit/braintree/transaction/customer_details_spec.rb +1 -1
  222. data/spec/unit/braintree/transaction/deposit_details_spec.rb +2 -2
  223. data/spec/unit/braintree/transaction/local_payment_details_spec.rb +30 -0
  224. data/spec/unit/braintree/transaction_gateway_spec.rb +39 -7
  225. data/spec/unit/braintree/transaction_search_spec.rb +2 -2
  226. data/spec/unit/braintree/transaction_spec.rb +101 -93
  227. data/spec/unit/braintree/unknown_payment_method_spec.rb +4 -4
  228. data/spec/unit/braintree/us_bank_account_spec.rb +2 -2
  229. data/spec/unit/braintree/us_bank_account_verification_search_spec.rb +7 -7
  230. data/spec/unit/braintree/us_bank_account_verification_spec.rb +12 -7
  231. data/spec/unit/braintree/util_spec.rb +27 -27
  232. data/spec/unit/braintree/validation_error_collection_spec.rb +34 -34
  233. data/spec/unit/braintree/validation_error_spec.rb +4 -4
  234. data/spec/unit/braintree/venmo_profile_data_spec.rb +16 -5
  235. data/spec/unit/braintree/webhook_notification_spec.rb +206 -191
  236. data/spec/unit/braintree/xml/libxml_spec.rb +5 -5
  237. data/spec/unit/braintree/xml/parser_spec.rb +8 -8
  238. data/spec/unit/braintree/xml/rexml_spec.rb +5 -5
  239. data/spec/unit/braintree/xml_spec.rb +17 -17
  240. data/spec/unit/braintree_spec.rb +2 -2
  241. metadata +11 -2
@@ -21,42 +21,42 @@ describe Braintree::SamsungPayCard do
21
21
  :country_name => "United States of America"
22
22
  },
23
23
  )
24
- result.should be_success
24
+ expect(result).to be_success
25
25
 
26
26
  samsung_pay_card = result.payment_method
27
- samsung_pay_card.should be_a(Braintree::SamsungPayCard)
28
- samsung_pay_card.billing_address.should_not be_nil
29
- samsung_pay_card.bin.should_not be_nil
30
- samsung_pay_card.cardholder_name.should_not be_nil
31
- samsung_pay_card.card_type.should_not be_nil
32
- samsung_pay_card.commercial.should_not be_nil
33
- samsung_pay_card.country_of_issuance.should_not be_nil
34
- samsung_pay_card.created_at.should_not be_nil
35
- samsung_pay_card.customer_id.should_not be_nil
36
- samsung_pay_card.customer_location.should_not be_nil
37
- samsung_pay_card.debit.should_not be_nil
38
- samsung_pay_card.default?.should_not be_nil
39
- samsung_pay_card.durbin_regulated.should_not be_nil
40
- samsung_pay_card.expiration_date.should_not be_nil
41
- samsung_pay_card.expiration_month.should_not be_nil
42
- samsung_pay_card.expiration_year.should_not be_nil
43
- samsung_pay_card.expired?.should_not be_nil
44
- samsung_pay_card.healthcare.should_not be_nil
45
- samsung_pay_card.image_url.should_not be_nil
46
- samsung_pay_card.issuing_bank.should_not be_nil
47
- samsung_pay_card.last_4.should_not be_nil
48
- samsung_pay_card.payroll.should_not be_nil
49
- samsung_pay_card.prepaid.should_not be_nil
50
- samsung_pay_card.product_id.should_not be_nil
51
- samsung_pay_card.source_card_last_4.should_not be_nil
52
- samsung_pay_card.subscriptions.should_not be_nil
53
- samsung_pay_card.token.should_not be_nil
54
- samsung_pay_card.unique_number_identifier.should_not be_nil
55
- samsung_pay_card.updated_at.should_not be_nil
27
+ expect(samsung_pay_card).to be_a(Braintree::SamsungPayCard)
28
+ expect(samsung_pay_card.billing_address).not_to be_nil
29
+ expect(samsung_pay_card.bin).not_to be_nil
30
+ expect(samsung_pay_card.cardholder_name).not_to be_nil
31
+ expect(samsung_pay_card.card_type).not_to be_nil
32
+ expect(samsung_pay_card.commercial).not_to be_nil
33
+ expect(samsung_pay_card.country_of_issuance).not_to be_nil
34
+ expect(samsung_pay_card.created_at).not_to be_nil
35
+ expect(samsung_pay_card.customer_id).not_to be_nil
36
+ expect(samsung_pay_card.customer_location).not_to be_nil
37
+ expect(samsung_pay_card.debit).not_to be_nil
38
+ expect(samsung_pay_card.default?).not_to be_nil
39
+ expect(samsung_pay_card.durbin_regulated).not_to be_nil
40
+ expect(samsung_pay_card.expiration_date).not_to be_nil
41
+ expect(samsung_pay_card.expiration_month).not_to be_nil
42
+ expect(samsung_pay_card.expiration_year).not_to be_nil
43
+ expect(samsung_pay_card.expired?).not_to be_nil
44
+ expect(samsung_pay_card.healthcare).not_to be_nil
45
+ expect(samsung_pay_card.image_url).not_to be_nil
46
+ expect(samsung_pay_card.issuing_bank).not_to be_nil
47
+ expect(samsung_pay_card.last_4).not_to be_nil
48
+ expect(samsung_pay_card.payroll).not_to be_nil
49
+ expect(samsung_pay_card.prepaid).not_to be_nil
50
+ expect(samsung_pay_card.product_id).not_to be_nil
51
+ expect(samsung_pay_card.source_card_last_4).not_to be_nil
52
+ expect(samsung_pay_card.subscriptions).not_to be_nil
53
+ expect(samsung_pay_card.token).not_to be_nil
54
+ expect(samsung_pay_card.unique_number_identifier).not_to be_nil
55
+ expect(samsung_pay_card.updated_at).not_to be_nil
56
56
 
57
57
  customer = Braintree::Customer.find(customer.id)
58
- customer.samsung_pay_cards.size.should == 1
59
- customer.samsung_pay_cards.first.should == samsung_pay_card
58
+ expect(customer.samsung_pay_cards.size).to eq(1)
59
+ expect(customer.samsung_pay_cards.first).to eq(samsung_pay_card)
60
60
  end
61
61
 
62
62
  it "returns cardholder_name and billing_address" do
@@ -79,18 +79,18 @@ describe Braintree::SamsungPayCard do
79
79
  },
80
80
  )
81
81
 
82
- result.should be_success
83
- result.payment_method.cardholder_name.should == "Jenny Block"
82
+ expect(result).to be_success
83
+ expect(result.payment_method.cardholder_name).to eq("Jenny Block")
84
84
 
85
85
  address = result.payment_method.billing_address
86
- address.first_name.should == "New First Name"
87
- address.last_name.should == "New Last Name"
88
- address.company.should == "New Company"
89
- address.street_address.should == "123 New St"
90
- address.extended_address.should == "Apt New"
91
- address.locality.should == "New City"
92
- address.region.should == "New State"
93
- address.postal_code.should == "56789"
86
+ expect(address.first_name).to eq("New First Name")
87
+ expect(address.last_name).to eq("New Last Name")
88
+ expect(address.company).to eq("New Company")
89
+ expect(address.street_address).to eq("123 New St")
90
+ expect(address.extended_address).to eq("Apt New")
91
+ expect(address.locality).to eq("New City")
92
+ expect(address.region).to eq("New State")
93
+ expect(address.postal_code).to eq("56789")
94
94
  end
95
95
 
96
96
  it "can search for transactions" do
@@ -98,14 +98,14 @@ describe Braintree::SamsungPayCard do
98
98
  :payment_method_nonce => Braintree::Test::Nonce::SamsungPayDiscover,
99
99
  :amount => "47.00",
100
100
  )
101
- transaction_create_result.should be_success
101
+ expect(transaction_create_result).to be_success
102
102
  transaction_id = transaction_create_result.transaction.id
103
103
 
104
104
  search_results = Braintree::Transaction.search do |search|
105
105
  search.id.is transaction_id
106
106
  search.payment_instrument_type.is Braintree::PaymentInstrumentType::SamsungPayCard
107
107
  end
108
- search_results.first.id.should == transaction_id
108
+ expect(search_results.first.id).to eq(transaction_id)
109
109
  end
110
110
 
111
111
  it "can create transaction from nonce and vault" do
@@ -117,28 +117,28 @@ describe Braintree::SamsungPayCard do
117
117
  :amount => "47.00",
118
118
  :options => {:store_in_vault => true},
119
119
  )
120
- result.should be_success
120
+ expect(result).to be_success
121
121
 
122
122
  samsung_pay_card_details = result.transaction.samsung_pay_card_details
123
- samsung_pay_card_details.bin.should_not be_nil
124
- samsung_pay_card_details.card_type.should_not be_nil
125
- samsung_pay_card_details.commercial.should_not be_nil
126
- samsung_pay_card_details.country_of_issuance.should_not be_nil
127
- samsung_pay_card_details.customer_location.should_not be_nil
128
- samsung_pay_card_details.debit.should_not be_nil
129
- samsung_pay_card_details.durbin_regulated.should_not be_nil
130
- samsung_pay_card_details.expiration_date.should_not be_nil
131
- samsung_pay_card_details.expiration_month.should_not be_nil
132
- samsung_pay_card_details.expiration_year.should_not be_nil
133
- samsung_pay_card_details.healthcare.should_not be_nil
134
- samsung_pay_card_details.image_url.should_not be_nil
135
- samsung_pay_card_details.issuing_bank.should_not be_nil
136
- samsung_pay_card_details.last_4.should_not be_nil
137
- samsung_pay_card_details.payroll.should_not be_nil
138
- samsung_pay_card_details.prepaid.should_not be_nil
139
- samsung_pay_card_details.product_id.should_not be_nil
140
- samsung_pay_card_details.source_card_last_4.should_not be_nil
141
- samsung_pay_card_details.source_card_last_4.should == "3333"
142
- samsung_pay_card_details.token.should_not be_nil
123
+ expect(samsung_pay_card_details.bin).not_to be_nil
124
+ expect(samsung_pay_card_details.card_type).not_to be_nil
125
+ expect(samsung_pay_card_details.commercial).not_to be_nil
126
+ expect(samsung_pay_card_details.country_of_issuance).not_to be_nil
127
+ expect(samsung_pay_card_details.customer_location).not_to be_nil
128
+ expect(samsung_pay_card_details.debit).not_to be_nil
129
+ expect(samsung_pay_card_details.durbin_regulated).not_to be_nil
130
+ expect(samsung_pay_card_details.expiration_date).not_to be_nil
131
+ expect(samsung_pay_card_details.expiration_month).not_to be_nil
132
+ expect(samsung_pay_card_details.expiration_year).not_to be_nil
133
+ expect(samsung_pay_card_details.healthcare).not_to be_nil
134
+ expect(samsung_pay_card_details.image_url).not_to be_nil
135
+ expect(samsung_pay_card_details.issuing_bank).not_to be_nil
136
+ expect(samsung_pay_card_details.last_4).not_to be_nil
137
+ expect(samsung_pay_card_details.payroll).not_to be_nil
138
+ expect(samsung_pay_card_details.prepaid).not_to be_nil
139
+ expect(samsung_pay_card_details.product_id).not_to be_nil
140
+ expect(samsung_pay_card_details.source_card_last_4).not_to be_nil
141
+ expect(samsung_pay_card_details.source_card_last_4).to eq("3333")
142
+ expect(samsung_pay_card_details.token).not_to be_nil
143
143
  end
144
144
  end
@@ -25,19 +25,19 @@ describe Braintree::SepaDirectDebitAccount do
25
25
  context "when payment method exists" do
26
26
  it "returns a payment method" do
27
27
  sepa_direct_debit_account = subject
28
- sepa_direct_debit_account.should be_a(Braintree::SepaDirectDebitAccount)
29
- sepa_direct_debit_account.last_4.should == "1234"
30
- sepa_direct_debit_account.default.should == true
31
- sepa_direct_debit_account.customer_id.should == customer.id
32
- sepa_direct_debit_account.global_id.should_not be_empty
33
- sepa_direct_debit_account.customer_global_id.should_not be_empty
34
- sepa_direct_debit_account.bank_reference_token.should == "a-fake-bank-reference-token"
35
- sepa_direct_debit_account.mandate_type.should == "RECURRENT"
36
- sepa_direct_debit_account.merchant_or_partner_customer_id.should == "a-fake-mp-customer-id"
37
- sepa_direct_debit_account.token.should_not be_empty
38
- sepa_direct_debit_account.image_url.should_not be_empty
39
- sepa_direct_debit_account.created_at.should be_a Time
40
- sepa_direct_debit_account.updated_at.should be_a Time
28
+ expect(sepa_direct_debit_account).to be_a(Braintree::SepaDirectDebitAccount)
29
+ expect(sepa_direct_debit_account.last_4).to eq("1234")
30
+ expect(sepa_direct_debit_account.default).to eq(true)
31
+ expect(sepa_direct_debit_account.customer_id).to eq(customer.id)
32
+ expect(sepa_direct_debit_account.global_id).not_to be_empty
33
+ expect(sepa_direct_debit_account.customer_global_id).not_to be_empty
34
+ expect(sepa_direct_debit_account.bank_reference_token).to eq("a-fake-bank-reference-token")
35
+ expect(sepa_direct_debit_account.mandate_type).to eq("RECURRENT")
36
+ expect(sepa_direct_debit_account.merchant_or_partner_customer_id).to eq("a-fake-mp-customer-id")
37
+ expect(sepa_direct_debit_account.token).not_to be_empty
38
+ expect(sepa_direct_debit_account.image_url).not_to be_empty
39
+ expect(sepa_direct_debit_account.created_at).to be_a Time
40
+ expect(sepa_direct_debit_account.updated_at).to be_a Time
41
41
  end
42
42
  end
43
43
 
@@ -79,7 +79,7 @@ describe Braintree::SepaDirectDebitAccount do
79
79
 
80
80
  context "when payment method exists" do
81
81
  it "deletes a payment method" do
82
- should be_success
82
+ is_expected.to be_success
83
83
 
84
84
  expect {
85
85
  described_class.find(token)
@@ -111,28 +111,28 @@ describe Braintree::SepaDirectDebitAccount do
111
111
 
112
112
  context "when payment method exists" do
113
113
  it "creates a transaction" do
114
- should be_success
114
+ is_expected.to be_success
115
115
 
116
116
  transaction = subject.transaction
117
- transaction.amount.should eq(1.23)
118
- transaction.status.should == "settling"
117
+ expect(transaction.amount).to eq(1.23)
118
+ expect(transaction.status).to eq("settling")
119
119
  sepa_direct_debit_account_details = transaction.sepa_direct_debit_account_details
120
- sepa_direct_debit_account_details.should be_a(Braintree::Transaction::SepaDirectDebitAccountDetails)
121
- sepa_direct_debit_account_details.bank_reference_token.should == "a-fake-bank-reference-token"
122
- sepa_direct_debit_account_details.capture_id.should_not be_empty
123
- sepa_direct_debit_account_details.debug_id.should be_nil
124
- sepa_direct_debit_account_details.global_id.should_not be_empty
125
- sepa_direct_debit_account_details.last_4.should == "1234"
126
- sepa_direct_debit_account_details.mandate_type.should == "RECURRENT"
127
- sepa_direct_debit_account_details.merchant_or_partner_customer_id.should == "a-fake-mp-customer-id"
128
- sepa_direct_debit_account_details.paypal_v2_order_id.should be_nil
129
- sepa_direct_debit_account_details.refund_from_transaction_fee_amount.should be_nil
130
- sepa_direct_debit_account_details.refund_from_transaction_fee_currency_iso_code.should be_nil
131
- sepa_direct_debit_account_details.refund_id.should be_nil
132
- sepa_direct_debit_account_details.settlement_type.should be_nil
133
- sepa_direct_debit_account_details.token.should == token
134
- sepa_direct_debit_account_details.transaction_fee_amount.should == "0.01"
135
- sepa_direct_debit_account_details.transaction_fee_currency_iso_code.should == "USD"
120
+ expect(sepa_direct_debit_account_details).to be_a(Braintree::Transaction::SepaDirectDebitAccountDetails)
121
+ expect(sepa_direct_debit_account_details.bank_reference_token).to eq("a-fake-bank-reference-token")
122
+ expect(sepa_direct_debit_account_details.capture_id).not_to be_empty
123
+ expect(sepa_direct_debit_account_details.debug_id).to be_nil
124
+ expect(sepa_direct_debit_account_details.global_id).not_to be_empty
125
+ expect(sepa_direct_debit_account_details.last_4).to eq("1234")
126
+ expect(sepa_direct_debit_account_details.mandate_type).to eq("RECURRENT")
127
+ expect(sepa_direct_debit_account_details.merchant_or_partner_customer_id).to eq("a-fake-mp-customer-id")
128
+ expect(sepa_direct_debit_account_details.paypal_v2_order_id).to be_nil
129
+ expect(sepa_direct_debit_account_details.refund_from_transaction_fee_amount).to be_nil
130
+ expect(sepa_direct_debit_account_details.refund_from_transaction_fee_currency_iso_code).to be_nil
131
+ expect(sepa_direct_debit_account_details.refund_id).to be_nil
132
+ expect(sepa_direct_debit_account_details.settlement_type).to be_nil
133
+ expect(sepa_direct_debit_account_details.token).to eq(token)
134
+ expect(sepa_direct_debit_account_details.transaction_fee_amount).to eq("0.01")
135
+ expect(sepa_direct_debit_account_details.transaction_fee_currency_iso_code).to eq("USD")
136
136
  end
137
137
  end
138
138
 
@@ -161,25 +161,25 @@ describe Braintree::SepaDirectDebitAccount do
161
161
  context "when payment method exists" do
162
162
  it "creates a transaction" do
163
163
  transaction = subject
164
- transaction.amount.should eq(1.23)
165
- transaction.status.should == "settling"
164
+ expect(transaction.amount).to eq(1.23)
165
+ expect(transaction.status).to eq("settling")
166
166
  sepa_direct_debit_account_details = transaction.sepa_direct_debit_account_details
167
- sepa_direct_debit_account_details.should be_a(Braintree::Transaction::SepaDirectDebitAccountDetails)
168
- sepa_direct_debit_account_details.bank_reference_token.should == "a-fake-bank-reference-token"
169
- sepa_direct_debit_account_details.capture_id.should_not be_empty
170
- sepa_direct_debit_account_details.debug_id.should be_nil
171
- sepa_direct_debit_account_details.global_id.should_not be_empty
172
- sepa_direct_debit_account_details.last_4.should == "1234"
173
- sepa_direct_debit_account_details.mandate_type.should == "RECURRENT"
174
- sepa_direct_debit_account_details.merchant_or_partner_customer_id.should == "a-fake-mp-customer-id"
175
- sepa_direct_debit_account_details.paypal_v2_order_id.should be_nil
176
- sepa_direct_debit_account_details.refund_from_transaction_fee_amount.should be_nil
177
- sepa_direct_debit_account_details.refund_from_transaction_fee_currency_iso_code.should be_nil
178
- sepa_direct_debit_account_details.refund_id.should be_nil
179
- sepa_direct_debit_account_details.settlement_type.should be_nil
180
- sepa_direct_debit_account_details.token.should == token
181
- sepa_direct_debit_account_details.transaction_fee_amount.should == "0.01"
182
- sepa_direct_debit_account_details.transaction_fee_currency_iso_code.should == "USD"
167
+ expect(sepa_direct_debit_account_details).to be_a(Braintree::Transaction::SepaDirectDebitAccountDetails)
168
+ expect(sepa_direct_debit_account_details.bank_reference_token).to eq("a-fake-bank-reference-token")
169
+ expect(sepa_direct_debit_account_details.capture_id).not_to be_empty
170
+ expect(sepa_direct_debit_account_details.debug_id).to be_nil
171
+ expect(sepa_direct_debit_account_details.global_id).not_to be_empty
172
+ expect(sepa_direct_debit_account_details.last_4).to eq("1234")
173
+ expect(sepa_direct_debit_account_details.mandate_type).to eq("RECURRENT")
174
+ expect(sepa_direct_debit_account_details.merchant_or_partner_customer_id).to eq("a-fake-mp-customer-id")
175
+ expect(sepa_direct_debit_account_details.paypal_v2_order_id).to be_nil
176
+ expect(sepa_direct_debit_account_details.refund_from_transaction_fee_amount).to be_nil
177
+ expect(sepa_direct_debit_account_details.refund_from_transaction_fee_currency_iso_code).to be_nil
178
+ expect(sepa_direct_debit_account_details.refund_id).to be_nil
179
+ expect(sepa_direct_debit_account_details.settlement_type).to be_nil
180
+ expect(sepa_direct_debit_account_details.token).to eq(token)
181
+ expect(sepa_direct_debit_account_details.transaction_fee_amount).to eq("0.01")
182
+ expect(sepa_direct_debit_account_details.transaction_fee_currency_iso_code).to eq("USD")
183
183
  end
184
184
  end
185
185
 
@@ -5,14 +5,14 @@ describe Braintree::SettlementBatchSummary do
5
5
  describe "self.generate" do
6
6
  it "returns an empty collection if there is not data" do
7
7
  result = Braintree::SettlementBatchSummary.generate("1979-01-01")
8
- result.should be_success
9
- result.settlement_batch_summary.records.size.should be_zero
8
+ expect(result).to be_success
9
+ expect(result.settlement_batch_summary.records.size).to be_zero
10
10
  end
11
11
 
12
12
  it "returns an error response if the date cannot be parsed" do
13
13
  result = Braintree::SettlementBatchSummary.generate("NOT A DATE :(")
14
- result.should_not be_success
15
- result.errors.for(:settlement_batch_summary).on(:settlement_date).map { |e| e.code }.should include(Braintree::ErrorCodes::SettlementBatchSummary::SettlementDateIsInvalid)
14
+ expect(result).not_to be_success
15
+ expect(result.errors.for(:settlement_batch_summary).on(:settlement_date).map { |e| e.code }).to include(Braintree::ErrorCodes::SettlementBatchSummary::SettlementDateIsInvalid)
16
16
  end
17
17
 
18
18
  it "returns transactions settled on a given day" do
@@ -29,10 +29,10 @@ describe Braintree::SettlementBatchSummary do
29
29
  settlement_date = result[:transaction][:settlement_batch_id].split("_").first
30
30
  result = Braintree::SettlementBatchSummary.generate(settlement_date)
31
31
 
32
- result.should be_success
32
+ expect(result).to be_success
33
33
  amex_records = result.settlement_batch_summary.records.select { |row| row[:card_type] == Braintree::CreditCard::CardType::AmEx }
34
- amex_records.first[:count].to_i.should >= 1
35
- amex_records.first[:amount_settled].to_i.should >= Braintree::Test::TransactionAmounts::Authorize.to_i
34
+ expect(amex_records.first[:count].to_i).to be >= 1
35
+ expect(amex_records.first[:amount_settled].to_i).to be >= Braintree::Test::TransactionAmounts::Authorize.to_i
36
36
  end
37
37
 
38
38
  it "can be grouped by a custom field" do
@@ -52,11 +52,11 @@ describe Braintree::SettlementBatchSummary do
52
52
  settlement_date = result[:transaction][:settlement_batch_id].split("_").first
53
53
  result = Braintree::SettlementBatchSummary.generate(settlement_date, "store_me")
54
54
 
55
- result.should be_success
55
+ expect(result).to be_success
56
56
  amex_records = result.settlement_batch_summary.records.select { |row| row[:store_me] == "1" }
57
- amex_records.should_not be_empty
58
- amex_records.first[:count].to_i.should >= 1
59
- amex_records.first[:amount_settled].to_i.should >= Braintree::Test::TransactionAmounts::Authorize.to_i
57
+ expect(amex_records).not_to be_empty
58
+ expect(amex_records.first[:count].to_i).to be >= 1
59
+ expect(amex_records.first[:amount_settled].to_i).to be >= Braintree::Test::TransactionAmounts::Authorize.to_i
60
60
  end
61
61
  end
62
62
  end