braintree 4.14.0 → 4.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (247) 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_gateway.rb +28 -11
  22. data/lib/braintree/credit_card_verification_search.rb +1 -1
  23. data/lib/braintree/customer.rb +5 -9
  24. data/lib/braintree/customer_gateway.rb +7 -7
  25. data/lib/braintree/customer_search.rb +1 -1
  26. data/lib/braintree/descriptor.rb +1 -1
  27. data/lib/braintree/digest.rb +1 -1
  28. data/lib/braintree/disbursement.rb +5 -5
  29. data/lib/braintree/discount_gateway.rb +1 -1
  30. data/lib/braintree/dispute/evidence.rb +1 -1
  31. data/lib/braintree/dispute/paypal_message.rb +1 -1
  32. data/lib/braintree/dispute/status_history.rb +1 -1
  33. data/lib/braintree/dispute/transaction.rb +1 -1
  34. data/lib/braintree/dispute/transaction_details.rb +1 -1
  35. data/lib/braintree/dispute.rb +3 -3
  36. data/lib/braintree/dispute_gateway.rb +1 -1
  37. data/lib/braintree/dispute_search.rb +1 -1
  38. data/lib/braintree/document_upload.rb +2 -2
  39. data/lib/braintree/document_upload_gateway.rb +3 -3
  40. data/lib/braintree/enriched_customer_data.rb +2 -2
  41. data/lib/braintree/error_codes.rb +4 -0
  42. data/lib/braintree/error_result.rb +2 -3
  43. data/lib/braintree/errors.rb +3 -3
  44. data/lib/braintree/exceptions.rb +1 -2
  45. data/lib/braintree/exchange_rate.rb +2 -2
  46. data/lib/braintree/exchange_rate_quote.rb +3 -3
  47. data/lib/braintree/exchange_rate_quote_gateway.rb +1 -1
  48. data/lib/braintree/exchange_rate_quote_input.rb +3 -3
  49. data/lib/braintree/exchange_rate_quote_request.rb +3 -3
  50. data/lib/braintree/exchange_rate_quote_response.rb +3 -3
  51. data/lib/braintree/facilitated_details.rb +1 -1
  52. data/lib/braintree/facilitator_details.rb +1 -1
  53. data/lib/braintree/google_pay_card.rb +3 -3
  54. data/lib/braintree/granted_payment_instrument_update.rb +1 -1
  55. data/lib/braintree/graphql_client.rb +1 -1
  56. data/lib/braintree/http.rb +5 -5
  57. data/lib/braintree/local_payment_completed.rb +2 -2
  58. data/lib/braintree/local_payment_expired.rb +2 -2
  59. data/lib/braintree/local_payment_funded.rb +2 -2
  60. data/lib/braintree/local_payment_reversed.rb +2 -2
  61. data/lib/braintree/merchant.rb +3 -3
  62. data/lib/braintree/merchant_account.rb +2 -2
  63. data/lib/braintree/merchant_account_gateway.rb +9 -9
  64. data/lib/braintree/meta_checkout_card.rb +89 -0
  65. data/lib/braintree/meta_checkout_token.rb +88 -0
  66. data/lib/braintree/modification.rb +3 -3
  67. data/lib/braintree/oauth_credentials.rb +3 -3
  68. data/lib/braintree/paginated_collection.rb +2 -2
  69. data/lib/braintree/paginated_result.rb +1 -1
  70. data/lib/braintree/payment_instrument_type.rb +2 -0
  71. data/lib/braintree/payment_method_customer_data_updated_metadata.rb +2 -2
  72. data/lib/braintree/payment_method_gateway.rb +23 -10
  73. data/lib/braintree/payment_method_nonce.rb +4 -4
  74. data/lib/braintree/payment_method_nonce_details.rb +1 -1
  75. data/lib/braintree/payment_method_nonce_details_payer_info.rb +1 -1
  76. data/lib/braintree/payment_method_nonce_gateway.rb +1 -1
  77. data/lib/braintree/paypal_account.rb +1 -2
  78. data/lib/braintree/paypal_account_gateway.rb +5 -5
  79. data/lib/braintree/plan.rb +1 -1
  80. data/lib/braintree/plan_gateway.rb +2 -2
  81. data/lib/braintree/resource_collection.rb +2 -2
  82. data/lib/braintree/revoked_payment_method_metadata.rb +1 -1
  83. data/lib/braintree/risk_data.rb +1 -1
  84. data/lib/braintree/samsung_pay_card.rb +5 -5
  85. data/lib/braintree/sepa_direct_debit_account.rb +2 -2
  86. data/lib/braintree/sepa_direct_debit_account_nonce_details.rb +1 -1
  87. data/lib/braintree/settlement_batch_summary_gateway.rb +1 -1
  88. data/lib/braintree/sha256_digest.rb +1 -1
  89. data/lib/braintree/subscription/status_details.rb +1 -1
  90. data/lib/braintree/subscription.rb +2 -2
  91. data/lib/braintree/subscription_gateway.rb +6 -6
  92. data/lib/braintree/subscription_search.rb +1 -1
  93. data/lib/braintree/successful_result.rb +2 -2
  94. data/lib/braintree/test/credit_card.rb +7 -10
  95. data/lib/braintree/test/merchant_account.rb +1 -1
  96. data/lib/braintree/test/nonce.rb +4 -0
  97. data/lib/braintree/test/transaction_amounts.rb +2 -3
  98. data/lib/braintree/test/venmo_sdk.rb +2 -0
  99. data/lib/braintree/testing_gateway.rb +1 -1
  100. data/lib/braintree/three_d_secure_info.rb +1 -1
  101. data/lib/braintree/transaction/address_details.rb +2 -1
  102. data/lib/braintree/transaction/credit_card_details.rb +4 -1
  103. data/lib/braintree/transaction/customer_details.rb +1 -1
  104. data/lib/braintree/transaction/disbursement_details.rb +1 -1
  105. data/lib/braintree/transaction/local_payment_details.rb +2 -0
  106. data/lib/braintree/transaction/meta_checkout_card_details.rb +52 -0
  107. data/lib/braintree/transaction/meta_checkout_token_details.rb +54 -0
  108. data/lib/braintree/transaction/package_details.rb +16 -0
  109. data/lib/braintree/transaction/samsung_pay_card_details.rb +1 -1
  110. data/lib/braintree/transaction/sepa_direct_debit_account_details.rb +1 -1
  111. data/lib/braintree/transaction/status_details.rb +1 -1
  112. data/lib/braintree/transaction/subscription_details.rb +1 -1
  113. data/lib/braintree/transaction/us_bank_account_details.rb +1 -1
  114. data/lib/braintree/transaction/visa_checkout_card_details.rb +1 -1
  115. data/lib/braintree/transaction.rb +37 -20
  116. data/lib/braintree/transaction_gateway.rb +44 -15
  117. data/lib/braintree/transaction_line_item.rb +13 -10
  118. data/lib/braintree/transaction_line_item_gateway.rb +1 -1
  119. data/lib/braintree/transaction_review.rb +1 -1
  120. data/lib/braintree/transaction_search.rb +7 -6
  121. data/lib/braintree/unknown_payment_method.rb +1 -1
  122. data/lib/braintree/us_bank_account.rb +2 -2
  123. data/lib/braintree/us_bank_account_verification.rb +23 -15
  124. data/lib/braintree/us_bank_account_verification_search.rb +1 -1
  125. data/lib/braintree/util.rb +3 -3
  126. data/lib/braintree/validation_error.rb +1 -1
  127. data/lib/braintree/validation_error_collection.rb +3 -3
  128. data/lib/braintree/venmo_account.rb +3 -3
  129. data/lib/braintree/venmo_profile_data.rb +6 -4
  130. data/lib/braintree/version.rb +1 -1
  131. data/lib/braintree/visa_checkout_card.rb +7 -7
  132. data/lib/braintree/webhook_notification.rb +3 -2
  133. data/lib/braintree/webhook_notification_gateway.rb +4 -4
  134. data/lib/braintree/webhook_testing.rb +1 -1
  135. data/lib/braintree/webhook_testing_gateway.rb +18 -1
  136. data/lib/braintree/xml/generator.rb +1 -1
  137. data/lib/braintree/xml/libxml.rb +1 -1
  138. data/lib/braintree/xml/parser.rb +3 -3
  139. data/lib/braintree/xml/rexml.rb +2 -2
  140. data/lib/braintree/xml.rb +1 -1
  141. data/lib/braintree.rb +5 -1
  142. data/spec/integration/braintree/add_on_spec.rb +9 -9
  143. data/spec/integration/braintree/address_spec.rb +69 -69
  144. data/spec/integration/braintree/advanced_search_spec.rb +45 -45
  145. data/spec/integration/braintree/apple_pay_spec.rb +8 -8
  146. data/spec/integration/braintree/client_api/client_token_spec.rb +15 -15
  147. data/spec/integration/braintree/client_api/spec_helper.rb +2 -2
  148. data/spec/integration/braintree/credit_card_spec.rb +227 -228
  149. data/spec/integration/braintree/credit_card_verification_search_spec.rb +16 -16
  150. data/spec/integration/braintree/credit_card_verification_spec.rb +98 -53
  151. data/spec/integration/braintree/customer_search_spec.rb +20 -20
  152. data/spec/integration/braintree/customer_spec.rb +317 -317
  153. data/spec/integration/braintree/disbursement_spec.rb +2 -2
  154. data/spec/integration/braintree/discount_spec.rb +9 -9
  155. data/spec/integration/braintree/dispute_search_spec.rb +0 -1
  156. data/spec/integration/braintree/dispute_spec.rb +87 -87
  157. data/spec/integration/braintree/document_upload_spec.rb +17 -17
  158. data/spec/integration/braintree/error_codes_spec.rb +2 -2
  159. data/spec/integration/braintree/http_spec.rb +28 -28
  160. data/spec/integration/braintree/merchant_account_spec.rb +127 -127
  161. data/spec/integration/braintree/merchant_spec.rb +103 -103
  162. data/spec/integration/braintree/oauth_spec.rb +61 -61
  163. data/spec/integration/braintree/package_tracking_spec.rb +111 -0
  164. data/spec/integration/braintree/payment_method_nonce_spec.rb +89 -69
  165. data/spec/integration/braintree/payment_method_spec.rb +391 -391
  166. data/spec/integration/braintree/payment_method_us_bank_account_spec.rb +150 -78
  167. data/spec/integration/braintree/paypal_account_spec.rb +38 -38
  168. data/spec/integration/braintree/plan_spec.rb +15 -15
  169. data/spec/integration/braintree/samsung_pay_card_spec.rb +65 -65
  170. data/spec/integration/braintree/sepa_direct_debit_account_spec.rb +51 -51
  171. data/spec/integration/braintree/settlement_batch_summary_spec.rb +11 -11
  172. data/spec/integration/braintree/subscription_spec.rb +364 -364
  173. data/spec/integration/braintree/test/transaction_amounts_spec.rb +2 -2
  174. data/spec/integration/braintree/test_transaction_spec.rb +19 -19
  175. data/spec/integration/braintree/transaction_line_item_spec.rb +12 -6
  176. data/spec/integration/braintree/transaction_search_spec.rb +225 -165
  177. data/spec/integration/braintree/transaction_spec.rb +1606 -1230
  178. data/spec/integration/braintree/transaction_us_bank_account_spec.rb +32 -32
  179. data/spec/integration/braintree/us_bank_account_spec.rb +30 -30
  180. data/spec/integration/braintree/us_bank_account_verification_search_spec.rb +18 -18
  181. data/spec/integration/braintree/us_bank_account_verification_spec.rb +33 -33
  182. data/spec/integration/braintree/visa_checkout_card_spec.rb +57 -57
  183. data/spec/spec_helper.rb +9 -8
  184. data/spec/unit/braintree/address_spec.rb +8 -8
  185. data/spec/unit/braintree/base_module_spec.rb +4 -4
  186. data/spec/unit/braintree/client_token_spec.rb +2 -2
  187. data/spec/unit/braintree/configuration_spec.rb +57 -57
  188. data/spec/unit/braintree/credentials_parser_spec.rb +6 -6
  189. data/spec/unit/braintree/credit_card_spec.rb +31 -29
  190. data/spec/unit/braintree/credit_card_verification_gateway_spec.rb +33 -28
  191. data/spec/unit/braintree/credit_card_verification_search_spec.rb +9 -9
  192. data/spec/unit/braintree/credit_card_verification_spec.rb +17 -17
  193. data/spec/unit/braintree/customer_spec.rb +41 -40
  194. data/spec/unit/braintree/digest_spec.rb +5 -5
  195. data/spec/unit/braintree/disbursement_spec.rb +11 -11
  196. data/spec/unit/braintree/dispute_search_spec.rb +2 -2
  197. data/spec/unit/braintree/dispute_spec.rb +56 -56
  198. data/spec/unit/braintree/document_upload_spec.rb +8 -8
  199. data/spec/unit/braintree/enriched_customer_data_spec.rb +11 -2
  200. data/spec/unit/braintree/error_result_spec.rb +5 -5
  201. data/spec/unit/braintree/errors_spec.rb +9 -9
  202. data/spec/unit/braintree/http_spec.rb +9 -9
  203. data/spec/unit/braintree/local_payment_completed_spec.rb +11 -11
  204. data/spec/unit/braintree/local_payment_expired_spec.rb +2 -2
  205. data/spec/unit/braintree/local_payment_funded_spec.rb +6 -6
  206. data/spec/unit/braintree/merchant_account_spec.rb +4 -4
  207. data/spec/unit/braintree/meta_checkout_card_details_spec.rb +60 -0
  208. data/spec/unit/braintree/meta_checkout_card_spec.rb +60 -0
  209. data/spec/unit/braintree/meta_checkout_token_details_spec.rb +63 -0
  210. data/spec/unit/braintree/meta_checkout_token_spec.rb +63 -0
  211. data/spec/unit/braintree/modification_spec.rb +1 -1
  212. data/spec/unit/braintree/package_tracking_spec.rb +74 -0
  213. data/spec/unit/braintree/payment_method_customer_data_updated_metadata_spec.rb +6 -6
  214. data/spec/unit/braintree/payment_method_nonce_details_payer_info_spec.rb +7 -7
  215. data/spec/unit/braintree/payment_method_nonce_details_spec.rb +14 -14
  216. data/spec/unit/braintree/payment_method_spec.rb +19 -19
  217. data/spec/unit/braintree/paypal_account_spec.rb +4 -4
  218. data/spec/unit/braintree/resource_collection_spec.rb +7 -7
  219. data/spec/unit/braintree/sepa_debit_account_nonce_details_spec.rb +1 -1
  220. data/spec/unit/braintree/sha256_digest_spec.rb +1 -1
  221. data/spec/unit/braintree/signature_service_spec.rb +2 -2
  222. data/spec/unit/braintree/subscription_search_spec.rb +17 -17
  223. data/spec/unit/braintree/subscription_spec.rb +8 -8
  224. data/spec/unit/braintree/successful_result_spec.rb +5 -5
  225. data/spec/unit/braintree/three_d_secure_info_spec.rb +20 -20
  226. data/spec/unit/braintree/transaction/credit_card_details_spec.rb +5 -5
  227. data/spec/unit/braintree/transaction/customer_details_spec.rb +1 -1
  228. data/spec/unit/braintree/transaction/deposit_details_spec.rb +2 -2
  229. data/spec/unit/braintree/transaction/local_payment_details_spec.rb +30 -0
  230. data/spec/unit/braintree/transaction_gateway_spec.rb +41 -9
  231. data/spec/unit/braintree/transaction_search_spec.rb +2 -2
  232. data/spec/unit/braintree/transaction_spec.rb +101 -93
  233. data/spec/unit/braintree/unknown_payment_method_spec.rb +4 -4
  234. data/spec/unit/braintree/us_bank_account_spec.rb +2 -2
  235. data/spec/unit/braintree/us_bank_account_verification_search_spec.rb +7 -7
  236. data/spec/unit/braintree/us_bank_account_verification_spec.rb +12 -7
  237. data/spec/unit/braintree/util_spec.rb +27 -27
  238. data/spec/unit/braintree/validation_error_collection_spec.rb +34 -34
  239. data/spec/unit/braintree/validation_error_spec.rb +4 -4
  240. data/spec/unit/braintree/venmo_profile_data_spec.rb +16 -5
  241. data/spec/unit/braintree/webhook_notification_spec.rb +206 -191
  242. data/spec/unit/braintree/xml/libxml_spec.rb +5 -5
  243. data/spec/unit/braintree/xml/parser_spec.rb +8 -8
  244. data/spec/unit/braintree/xml/rexml_spec.rb +5 -5
  245. data/spec/unit/braintree/xml_spec.rb +17 -17
  246. data/spec/unit/braintree_spec.rb +2 -2
  247. metadata +14 -2
@@ -84,8 +84,8 @@ describe Braintree::MerchantAccount do
84
84
  )
85
85
 
86
86
  result = gateway.merchant_account.all
87
- result.should be_success
88
- result.merchant_accounts.count.should > 20
87
+ expect(result).to be_success
88
+ expect(result.merchant_accounts.count).to be > 20
89
89
  end
90
90
 
91
91
  it "returns merchant account with correct attributes" do
@@ -107,11 +107,11 @@ describe Braintree::MerchantAccount do
107
107
  )
108
108
 
109
109
  result = gateway.merchant_account.all
110
- result.should be_success
111
- result.merchant_accounts.count.should == 1
112
- result.merchant_accounts.first.currency_iso_code.should == "USD"
113
- result.merchant_accounts.first.status.should == "active"
114
- result.merchant_accounts.first.default.should == true
110
+ expect(result).to be_success
111
+ expect(result.merchant_accounts.count).to eq(1)
112
+ expect(result.merchant_accounts.first.currency_iso_code).to eq("USD")
113
+ expect(result.merchant_accounts.first.status).to eq("active")
114
+ expect(result.merchant_accounts.first.default).to eq(true)
115
115
  end
116
116
 
117
117
  it "returns all merchant accounts for read_only scoped grants" do
@@ -137,8 +137,8 @@ describe Braintree::MerchantAccount do
137
137
  )
138
138
 
139
139
  result = gateway.merchant_account.all
140
- result.should be_success
141
- result.merchant_accounts.count.should > 20
140
+ expect(result).to be_success
141
+ expect(result.merchant_accounts.count).to be > 20
142
142
  end
143
143
  end
144
144
 
@@ -146,17 +146,17 @@ describe Braintree::MerchantAccount do
146
146
  it "accepts the deprecated parameters" do
147
147
  result = Braintree::MerchantAccount.create(DEPRECATED_APPLICATION_PARAMS)
148
148
 
149
- result.should be_success
150
- result.merchant_account.status.should == Braintree::MerchantAccount::Status::Pending
151
- result.merchant_account.master_merchant_account.id.should == "sandbox_master_merchant_account"
149
+ expect(result).to be_success
150
+ expect(result.merchant_account.status).to eq(Braintree::MerchantAccount::Status::Pending)
151
+ expect(result.merchant_account.master_merchant_account.id).to eq("sandbox_master_merchant_account")
152
152
  end
153
153
 
154
154
  it "creates a merchant account with the new parameters and doesn't require an id" do
155
155
  result = Braintree::MerchantAccount.create(VALID_APPLICATION_PARAMS)
156
156
 
157
- result.should be_success
158
- result.merchant_account.status.should == Braintree::MerchantAccount::Status::Pending
159
- result.merchant_account.master_merchant_account.id.should == "sandbox_master_merchant_account"
157
+ expect(result).to be_success
158
+ expect(result.merchant_account.status).to eq(Braintree::MerchantAccount::Status::Pending)
159
+ expect(result.merchant_account.master_merchant_account.id).to eq("sandbox_master_merchant_account")
160
160
  end
161
161
 
162
162
  it "allows an id to be passed" do
@@ -168,24 +168,24 @@ describe Braintree::MerchantAccount do
168
168
  ),
169
169
  )
170
170
 
171
- result.should be_success
172
- result.merchant_account.status.should == Braintree::MerchantAccount::Status::Pending
173
- result.merchant_account.id.should == sub_merchant_account_id
174
- result.merchant_account.master_merchant_account.id.should == "sandbox_master_merchant_account"
171
+ expect(result).to be_success
172
+ expect(result.merchant_account.status).to eq(Braintree::MerchantAccount::Status::Pending)
173
+ expect(result.merchant_account.id).to eq(sub_merchant_account_id)
174
+ expect(result.merchant_account.master_merchant_account.id).to eq("sandbox_master_merchant_account")
175
175
  end
176
176
 
177
177
  it "handles unsuccessful results" do
178
178
  result = Braintree::MerchantAccount.create({})
179
- result.should_not be_success
180
- result.errors.for(:merchant_account).on(:master_merchant_account_id).first.code.should == Braintree::ErrorCodes::MerchantAccount::MasterMerchantAccountIdIsRequired
179
+ expect(result).not_to be_success
180
+ expect(result.errors.for(:merchant_account).on(:master_merchant_account_id).first.code).to eq(Braintree::ErrorCodes::MerchantAccount::MasterMerchantAccountIdIsRequired)
181
181
  end
182
182
 
183
183
  it "requires all fields" do
184
184
  result = Braintree::MerchantAccount.create(
185
185
  :master_merchant_account_id => "sandbox_master_merchant_account",
186
186
  )
187
- result.should_not be_success
188
- result.errors.for(:merchant_account).on(:tos_accepted).first.code.should == Braintree::ErrorCodes::MerchantAccount::TosAcceptedIsRequired
187
+ expect(result).not_to be_success
188
+ expect(result.errors.for(:merchant_account).on(:tos_accepted).first.code).to eq(Braintree::ErrorCodes::MerchantAccount::TosAcceptedIsRequired)
189
189
  end
190
190
 
191
191
  context "funding destination" do
@@ -194,7 +194,7 @@ describe Braintree::MerchantAccount do
194
194
  params[:funding][:destination] = ::Braintree::MerchantAccount::FundingDestination::Bank
195
195
  result = Braintree::MerchantAccount.create(params)
196
196
 
197
- result.should be_success
197
+ expect(result).to be_success
198
198
  end
199
199
 
200
200
  it "accepts an email" do
@@ -203,7 +203,7 @@ describe Braintree::MerchantAccount do
203
203
  params[:funding][:email] = "joebloggs@compuserve.com"
204
204
  result = Braintree::MerchantAccount.create(params)
205
205
 
206
- result.should be_success
206
+ expect(result).to be_success
207
207
  end
208
208
 
209
209
  it "accepts a mobile_phone" do
@@ -212,7 +212,7 @@ describe Braintree::MerchantAccount do
212
212
  params[:funding][:mobile_phone] = "3125882300"
213
213
  result = Braintree::MerchantAccount.create(params)
214
214
 
215
- result.should be_success
215
+ expect(result).to be_success
216
216
  end
217
217
  end
218
218
  end
@@ -221,15 +221,15 @@ describe Braintree::MerchantAccount do
221
221
  it "creates a merchant account with the new parameters and doesn't require an id" do
222
222
  merchant_account = Braintree::MerchantAccount.create!(VALID_APPLICATION_PARAMS)
223
223
 
224
- merchant_account.status.should == Braintree::MerchantAccount::Status::Pending
225
- merchant_account.master_merchant_account.id.should == "sandbox_master_merchant_account"
224
+ expect(merchant_account.status).to eq(Braintree::MerchantAccount::Status::Pending)
225
+ expect(merchant_account.master_merchant_account.id).to eq("sandbox_master_merchant_account")
226
226
  end
227
227
  end
228
228
 
229
229
  describe "create_for_currency" do
230
230
  it "creates a new merchant account for currency" do
231
231
  result = SpecHelper::create_merchant
232
- result.should be_success
232
+ expect(result).to be_success
233
233
 
234
234
  gateway = Braintree::Gateway.new(
235
235
  :access_token => result.credentials.access_token,
@@ -239,13 +239,13 @@ describe Braintree::MerchantAccount do
239
239
  result = gateway.merchant_account.create_for_currency(
240
240
  :currency => "JPY",
241
241
  )
242
- result.should be_success
243
- result.merchant_account.currency_iso_code.should == "JPY"
242
+ expect(result).to be_success
243
+ expect(result.merchant_account.currency_iso_code).to eq("JPY")
244
244
  end
245
245
 
246
246
  it "returns error if a merchant account already exists for that currency" do
247
247
  result = SpecHelper::create_merchant
248
- result.should be_success
248
+ expect(result).to be_success
249
249
 
250
250
  gateway = Braintree::Gateway.new(
251
251
  :access_token => result.credentials.access_token,
@@ -255,20 +255,20 @@ describe Braintree::MerchantAccount do
255
255
  result = gateway.merchant_account.create_for_currency(
256
256
  :currency => "USD",
257
257
  )
258
- result.should be_success
258
+ expect(result).to be_success
259
259
 
260
260
  result = gateway.merchant_account.create_for_currency(
261
261
  :currency => "USD",
262
262
  )
263
- result.should_not be_success
263
+ expect(result).not_to be_success
264
264
 
265
265
  errors = result.errors.for(:merchant).on(:currency)
266
- errors[0].code.should == Braintree::ErrorCodes::Merchant::MerchantAccountExistsForCurrency
266
+ expect(errors[0].code).to eq(Braintree::ErrorCodes::Merchant::MerchantAccountExistsForCurrency)
267
267
  end
268
268
 
269
269
  it "returns error if no currency is provided" do
270
270
  result = SpecHelper::create_merchant
271
- result.should be_success
271
+ expect(result).to be_success
272
272
 
273
273
  gateway = Braintree::Gateway.new(
274
274
  :access_token => result.credentials.access_token,
@@ -278,21 +278,21 @@ describe Braintree::MerchantAccount do
278
278
  result = gateway.merchant_account.create_for_currency(
279
279
  :currency => nil,
280
280
  )
281
- result.should_not be_success
281
+ expect(result).not_to be_success
282
282
 
283
283
  errors = result.errors.for(:merchant).on(:currency)
284
- errors[0].code.should == Braintree::ErrorCodes::Merchant::CurrencyIsRequired
284
+ expect(errors[0].code).to eq(Braintree::ErrorCodes::Merchant::CurrencyIsRequired)
285
285
 
286
286
  result = gateway.merchant_account.create_for_currency({})
287
- result.should_not be_success
287
+ expect(result).not_to be_success
288
288
 
289
289
  errors = result.errors.for(:merchant).on(:currency)
290
- errors[0].code.should == Braintree::ErrorCodes::Merchant::CurrencyIsRequired
290
+ expect(errors[0].code).to eq(Braintree::ErrorCodes::Merchant::CurrencyIsRequired)
291
291
  end
292
292
 
293
293
  it "returns error if a currency is not supported" do
294
294
  result = SpecHelper::create_merchant
295
- result.should be_success
295
+ expect(result).to be_success
296
296
 
297
297
  gateway = Braintree::Gateway.new(
298
298
  :access_token => result.credentials.access_token,
@@ -302,15 +302,15 @@ describe Braintree::MerchantAccount do
302
302
  result = gateway.merchant_account.create_for_currency(
303
303
  :currency => "FAKE_CURRENCY",
304
304
  )
305
- result.should_not be_success
305
+ expect(result).not_to be_success
306
306
 
307
307
  errors = result.errors.for(:merchant).on(:currency)
308
- errors[0].code.should == Braintree::ErrorCodes::Merchant::CurrencyIsInvalid
308
+ expect(errors[0].code).to eq(Braintree::ErrorCodes::Merchant::CurrencyIsInvalid)
309
309
  end
310
310
 
311
311
  it "returns error if id is passed and already taken" do
312
312
  result = SpecHelper::create_merchant
313
- result.should be_success
313
+ expect(result).to be_success
314
314
 
315
315
  gateway = Braintree::Gateway.new(
316
316
  :access_token => result.credentials.access_token,
@@ -322,30 +322,30 @@ describe Braintree::MerchantAccount do
322
322
  :currency => "USD",
323
323
  :id => merchant.merchant_accounts.first.id,
324
324
  )
325
- result.should_not be_success
325
+ expect(result).not_to be_success
326
326
 
327
327
  errors = result.errors.for(:merchant).on(:id)
328
- errors[0].code.should == Braintree::ErrorCodes::Merchant::MerchantAccountExistsForId
328
+ expect(errors[0].code).to eq(Braintree::ErrorCodes::Merchant::MerchantAccountExistsForId)
329
329
  end
330
330
  end
331
331
 
332
332
  describe "find" do
333
333
  it "finds the merchant account with the given token" do
334
334
  result = Braintree::MerchantAccount.create(VALID_APPLICATION_PARAMS)
335
- result.should be_success
336
- result.merchant_account.status.should == Braintree::MerchantAccount::Status::Pending
335
+ expect(result).to be_success
336
+ expect(result.merchant_account.status).to eq(Braintree::MerchantAccount::Status::Pending)
337
337
 
338
338
  id = result.merchant_account.id
339
339
  merchant_account = Braintree::MerchantAccount.find(id)
340
340
 
341
- merchant_account.individual_details.first_name.should == VALID_APPLICATION_PARAMS[:individual][:first_name]
342
- merchant_account.individual_details.last_name.should == VALID_APPLICATION_PARAMS[:individual][:last_name]
341
+ expect(merchant_account.individual_details.first_name).to eq(VALID_APPLICATION_PARAMS[:individual][:first_name])
342
+ expect(merchant_account.individual_details.last_name).to eq(VALID_APPLICATION_PARAMS[:individual][:last_name])
343
343
  end
344
344
 
345
345
  it "retrieves the currency iso code for an existing master merchant account" do
346
346
  merchant_account = Braintree::MerchantAccount.find("sandbox_master_merchant_account")
347
347
 
348
- merchant_account.currency_iso_code.should == "USD"
348
+ expect(merchant_account.currency_iso_code).to eq("USD")
349
349
  end
350
350
 
351
351
  it "raises a NotFoundError exception if merchant account cannot be found" do
@@ -382,37 +382,37 @@ describe Braintree::MerchantAccount do
382
382
  params[:funding][:mobile_phone] = "1234567890"
383
383
  params[:funding][:destination] = Braintree::MerchantAccount::FundingDestination::MobilePhone
384
384
  result = Braintree::MerchantAccount.update("sandbox_sub_merchant_account", params)
385
- result.should be_success
386
- result.merchant_account.status.should == "active"
387
- result.merchant_account.id.should == "sandbox_sub_merchant_account"
388
- result.merchant_account.master_merchant_account.id.should == "sandbox_master_merchant_account"
389
- result.merchant_account.individual_details.first_name.should == "John"
390
- result.merchant_account.individual_details.last_name.should == "Doe"
391
- result.merchant_account.individual_details.email.should == "john.doe@example.com"
392
- result.merchant_account.individual_details.date_of_birth.should == "1970-01-01"
393
- result.merchant_account.individual_details.phone.should == "3125551234"
394
- result.merchant_account.individual_details.address_details.street_address.should == "123 Fake St"
395
- result.merchant_account.individual_details.address_details.locality.should == "Chicago"
396
- result.merchant_account.individual_details.address_details.region.should == "IL"
397
- result.merchant_account.individual_details.address_details.postal_code.should == "60622"
398
- result.merchant_account.business_details.dba_name.should == "James's Bloggs"
399
- result.merchant_account.business_details.legal_name.should == "James's Bloggs Inc"
400
- result.merchant_account.business_details.tax_id.should == "423456789"
401
- result.merchant_account.business_details.address_details.street_address.should == "999 Fake St"
402
- result.merchant_account.business_details.address_details.locality.should == "Miami"
403
- result.merchant_account.business_details.address_details.region.should == "FL"
404
- result.merchant_account.business_details.address_details.postal_code.should == "99999"
405
- result.merchant_account.funding_details.account_number_last_4.should == "8798"
406
- result.merchant_account.funding_details.routing_number.should == "071000013"
407
- result.merchant_account.funding_details.email.should == "check@this.com"
408
- result.merchant_account.funding_details.mobile_phone.should == "1234567890"
409
- result.merchant_account.funding_details.destination.should == Braintree::MerchantAccount::FundingDestination::MobilePhone
410
- result.merchant_account.funding_details.descriptor.should == "Joes Bloggs MI"
385
+ expect(result).to be_success
386
+ expect(result.merchant_account.status).to eq("active")
387
+ expect(result.merchant_account.id).to eq("sandbox_sub_merchant_account")
388
+ expect(result.merchant_account.master_merchant_account.id).to eq("sandbox_master_merchant_account")
389
+ expect(result.merchant_account.individual_details.first_name).to eq("John")
390
+ expect(result.merchant_account.individual_details.last_name).to eq("Doe")
391
+ expect(result.merchant_account.individual_details.email).to eq("john.doe@example.com")
392
+ expect(result.merchant_account.individual_details.date_of_birth).to eq("1970-01-01")
393
+ expect(result.merchant_account.individual_details.phone).to eq("3125551234")
394
+ expect(result.merchant_account.individual_details.address_details.street_address).to eq("123 Fake St")
395
+ expect(result.merchant_account.individual_details.address_details.locality).to eq("Chicago")
396
+ expect(result.merchant_account.individual_details.address_details.region).to eq("IL")
397
+ expect(result.merchant_account.individual_details.address_details.postal_code).to eq("60622")
398
+ expect(result.merchant_account.business_details.dba_name).to eq("James's Bloggs")
399
+ expect(result.merchant_account.business_details.legal_name).to eq("James's Bloggs Inc")
400
+ expect(result.merchant_account.business_details.tax_id).to eq("423456789")
401
+ expect(result.merchant_account.business_details.address_details.street_address).to eq("999 Fake St")
402
+ expect(result.merchant_account.business_details.address_details.locality).to eq("Miami")
403
+ expect(result.merchant_account.business_details.address_details.region).to eq("FL")
404
+ expect(result.merchant_account.business_details.address_details.postal_code).to eq("99999")
405
+ expect(result.merchant_account.funding_details.account_number_last_4).to eq("8798")
406
+ expect(result.merchant_account.funding_details.routing_number).to eq("071000013")
407
+ expect(result.merchant_account.funding_details.email).to eq("check@this.com")
408
+ expect(result.merchant_account.funding_details.mobile_phone).to eq("1234567890")
409
+ expect(result.merchant_account.funding_details.destination).to eq(Braintree::MerchantAccount::FundingDestination::MobilePhone)
410
+ expect(result.merchant_account.funding_details.descriptor).to eq("Joes Bloggs MI")
411
411
  end
412
412
 
413
413
  it "does not require all fields" do
414
414
  result = Braintree::MerchantAccount.update("sandbox_sub_merchant_account", {:individual => {:first_name => "Jose"}})
415
- result.should be_success
415
+ expect(result).to be_success
416
416
  end
417
417
 
418
418
  it "handles validation errors for blank fields" do
@@ -445,17 +445,17 @@ describe Braintree::MerchantAccount do
445
445
  }
446
446
  )
447
447
 
448
- result.should_not be_success
449
- result.errors.for(:merchant_account).for(:individual).on(:first_name).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Individual::FirstNameIsRequired]
450
- result.errors.for(:merchant_account).for(:individual).on(:last_name).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Individual::LastNameIsRequired]
451
- result.errors.for(:merchant_account).for(:individual).on(:date_of_birth).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Individual::DateOfBirthIsRequired]
452
- result.errors.for(:merchant_account).for(:individual).on(:email).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Individual::EmailIsRequired]
453
- result.errors.for(:merchant_account).for(:individual).for(:address).on(:street_address).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Individual::Address::StreetAddressIsRequired]
454
- result.errors.for(:merchant_account).for(:individual).for(:address).on(:postal_code).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Individual::Address::PostalCodeIsRequired]
455
- result.errors.for(:merchant_account).for(:individual).for(:address).on(:locality).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Individual::Address::LocalityIsRequired]
456
- result.errors.for(:merchant_account).for(:individual).for(:address).on(:region).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Individual::Address::RegionIsRequired]
457
- result.errors.for(:merchant_account).for(:funding).on(:destination).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Funding::DestinationIsRequired]
458
- result.errors.for(:merchant_account).on(:base).should be_empty
448
+ expect(result).not_to be_success
449
+ expect(result.errors.for(:merchant_account).for(:individual).on(:first_name).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Individual::FirstNameIsRequired])
450
+ expect(result.errors.for(:merchant_account).for(:individual).on(:last_name).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Individual::LastNameIsRequired])
451
+ expect(result.errors.for(:merchant_account).for(:individual).on(:date_of_birth).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Individual::DateOfBirthIsRequired])
452
+ expect(result.errors.for(:merchant_account).for(:individual).on(:email).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Individual::EmailIsRequired])
453
+ expect(result.errors.for(:merchant_account).for(:individual).for(:address).on(:street_address).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Individual::Address::StreetAddressIsRequired])
454
+ expect(result.errors.for(:merchant_account).for(:individual).for(:address).on(:postal_code).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Individual::Address::PostalCodeIsRequired])
455
+ expect(result.errors.for(:merchant_account).for(:individual).for(:address).on(:locality).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Individual::Address::LocalityIsRequired])
456
+ expect(result.errors.for(:merchant_account).for(:individual).for(:address).on(:region).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Individual::Address::RegionIsRequired])
457
+ expect(result.errors.for(:merchant_account).for(:funding).on(:destination).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Funding::DestinationIsRequired])
458
+ expect(result.errors.for(:merchant_account).on(:base)).to be_empty
459
459
  end
460
460
 
461
461
  it "handles validation errors for invalid fields" do
@@ -494,30 +494,30 @@ describe Braintree::MerchantAccount do
494
494
  }
495
495
  )
496
496
 
497
- result.should_not be_success
498
- result.errors.for(:merchant_account).for(:individual).on(:first_name).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Individual::FirstNameIsInvalid]
499
- result.errors.for(:merchant_account).for(:individual).on(:last_name).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Individual::LastNameIsInvalid]
500
- result.errors.for(:merchant_account).for(:individual).on(:email).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Individual::EmailIsInvalid]
501
- result.errors.for(:merchant_account).for(:individual).on(:phone).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Individual::PhoneIsInvalid]
502
- result.errors.for(:merchant_account).for(:individual).for(:address).on(:street_address).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Individual::Address::StreetAddressIsInvalid]
503
- result.errors.for(:merchant_account).for(:individual).for(:address).on(:postal_code).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Individual::Address::PostalCodeIsInvalid]
504
- result.errors.for(:merchant_account).for(:individual).for(:address).on(:region).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Individual::Address::RegionIsInvalid]
505
- result.errors.for(:merchant_account).for(:individual).on(:ssn).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Individual::SsnIsInvalid]
506
-
507
- result.errors.for(:merchant_account).for(:business).on(:legal_name).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Business::LegalNameIsInvalid]
508
- result.errors.for(:merchant_account).for(:business).on(:dba_name).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Business::DbaNameIsInvalid]
509
- result.errors.for(:merchant_account).for(:business).on(:tax_id).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Business::TaxIdIsInvalid]
510
- result.errors.for(:merchant_account).for(:business).for(:address).on(:street_address).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Business::Address::StreetAddressIsInvalid]
511
- result.errors.for(:merchant_account).for(:business).for(:address).on(:postal_code).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Business::Address::PostalCodeIsInvalid]
512
- result.errors.for(:merchant_account).for(:business).for(:address).on(:region).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Business::Address::RegionIsInvalid]
513
-
514
- result.errors.for(:merchant_account).for(:funding).on(:destination).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Funding::DestinationIsInvalid]
515
- result.errors.for(:merchant_account).for(:funding).on(:routing_number).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Funding::RoutingNumberIsInvalid]
516
- result.errors.for(:merchant_account).for(:funding).on(:account_number).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Funding::AccountNumberIsInvalid]
517
- result.errors.for(:merchant_account).for(:funding).on(:email).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Funding::EmailIsInvalid]
518
- result.errors.for(:merchant_account).for(:funding).on(:mobile_phone).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Funding::MobilePhoneIsInvalid]
519
-
520
- result.errors.for(:merchant_account).on(:base).should be_empty
497
+ expect(result).not_to be_success
498
+ expect(result.errors.for(:merchant_account).for(:individual).on(:first_name).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Individual::FirstNameIsInvalid])
499
+ expect(result.errors.for(:merchant_account).for(:individual).on(:last_name).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Individual::LastNameIsInvalid])
500
+ expect(result.errors.for(:merchant_account).for(:individual).on(:email).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Individual::EmailIsInvalid])
501
+ expect(result.errors.for(:merchant_account).for(:individual).on(:phone).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Individual::PhoneIsInvalid])
502
+ expect(result.errors.for(:merchant_account).for(:individual).for(:address).on(:street_address).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Individual::Address::StreetAddressIsInvalid])
503
+ expect(result.errors.for(:merchant_account).for(:individual).for(:address).on(:postal_code).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Individual::Address::PostalCodeIsInvalid])
504
+ expect(result.errors.for(:merchant_account).for(:individual).for(:address).on(:region).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Individual::Address::RegionIsInvalid])
505
+ expect(result.errors.for(:merchant_account).for(:individual).on(:ssn).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Individual::SsnIsInvalid])
506
+
507
+ expect(result.errors.for(:merchant_account).for(:business).on(:legal_name).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Business::LegalNameIsInvalid])
508
+ expect(result.errors.for(:merchant_account).for(:business).on(:dba_name).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Business::DbaNameIsInvalid])
509
+ expect(result.errors.for(:merchant_account).for(:business).on(:tax_id).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Business::TaxIdIsInvalid])
510
+ expect(result.errors.for(:merchant_account).for(:business).for(:address).on(:street_address).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Business::Address::StreetAddressIsInvalid])
511
+ expect(result.errors.for(:merchant_account).for(:business).for(:address).on(:postal_code).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Business::Address::PostalCodeIsInvalid])
512
+ expect(result.errors.for(:merchant_account).for(:business).for(:address).on(:region).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Business::Address::RegionIsInvalid])
513
+
514
+ expect(result.errors.for(:merchant_account).for(:funding).on(:destination).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Funding::DestinationIsInvalid])
515
+ expect(result.errors.for(:merchant_account).for(:funding).on(:routing_number).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Funding::RoutingNumberIsInvalid])
516
+ expect(result.errors.for(:merchant_account).for(:funding).on(:account_number).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Funding::AccountNumberIsInvalid])
517
+ expect(result.errors.for(:merchant_account).for(:funding).on(:email).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Funding::EmailIsInvalid])
518
+ expect(result.errors.for(:merchant_account).for(:funding).on(:mobile_phone).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Funding::MobilePhoneIsInvalid])
519
+
520
+ expect(result.errors.for(:merchant_account).on(:base)).to be_empty
521
521
  end
522
522
 
523
523
  it "handles validation errors for business fields" do
@@ -530,9 +530,9 @@ describe Braintree::MerchantAccount do
530
530
  }
531
531
  )
532
532
 
533
- result.should_not be_success
534
- result.errors.for(:merchant_account).for(:business).on(:legal_name).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Business::LegalNameIsRequiredWithTaxId]
535
- result.errors.for(:merchant_account).for(:business).on(:tax_id).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Business::TaxIdMustBeBlank]
533
+ expect(result).not_to be_success
534
+ expect(result.errors.for(:merchant_account).for(:business).on(:legal_name).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Business::LegalNameIsRequiredWithTaxId])
535
+ expect(result.errors.for(:merchant_account).for(:business).on(:tax_id).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Business::TaxIdMustBeBlank])
536
536
 
537
537
  result = Braintree::MerchantAccount.update(
538
538
  "sandbox_sub_merchant_account", {
@@ -543,8 +543,8 @@ describe Braintree::MerchantAccount do
543
543
  }
544
544
  )
545
545
 
546
- result.should_not be_success
547
- result.errors.for(:merchant_account).for(:business).on(:tax_id).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Business::TaxIdIsRequiredWithLegalName]
546
+ expect(result).not_to be_success
547
+ expect(result.errors.for(:merchant_account).for(:business).on(:tax_id).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Business::TaxIdIsRequiredWithLegalName])
548
548
  end
549
549
 
550
550
  it "handles validation errors for funding fields" do
@@ -558,9 +558,9 @@ describe Braintree::MerchantAccount do
558
558
  }
559
559
  )
560
560
 
561
- result.should_not be_success
562
- result.errors.for(:merchant_account).for(:funding).on(:routing_number).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Funding::RoutingNumberIsRequired]
563
- result.errors.for(:merchant_account).for(:funding).on(:account_number).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Funding::AccountNumberIsRequired]
561
+ expect(result).not_to be_success
562
+ expect(result.errors.for(:merchant_account).for(:funding).on(:routing_number).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Funding::RoutingNumberIsRequired])
563
+ expect(result.errors.for(:merchant_account).for(:funding).on(:account_number).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Funding::AccountNumberIsRequired])
564
564
 
565
565
  result = Braintree::MerchantAccount.update(
566
566
  "sandbox_sub_merchant_account", {
@@ -571,8 +571,8 @@ describe Braintree::MerchantAccount do
571
571
  }
572
572
  )
573
573
 
574
- result.should_not be_success
575
- result.errors.for(:merchant_account).for(:funding).on(:email).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Funding::EmailIsRequired]
574
+ expect(result).not_to be_success
575
+ expect(result.errors.for(:merchant_account).for(:funding).on(:email).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Funding::EmailIsRequired])
576
576
 
577
577
  result = Braintree::MerchantAccount.update(
578
578
  "sandbox_sub_merchant_account", {
@@ -583,8 +583,8 @@ describe Braintree::MerchantAccount do
583
583
  }
584
584
  )
585
585
 
586
- result.should_not be_success
587
- result.errors.for(:merchant_account).for(:funding).on(:mobile_phone).map(&:code).should == [Braintree::ErrorCodes::MerchantAccount::Funding::MobilePhoneIsRequired]
586
+ expect(result).not_to be_success
587
+ expect(result.errors.for(:merchant_account).for(:funding).on(:mobile_phone).map(&:code)).to eq([Braintree::ErrorCodes::MerchantAccount::Funding::MobilePhoneIsRequired])
588
588
  end
589
589
  end
590
590
 
@@ -596,8 +596,8 @@ describe Braintree::MerchantAccount do
596
596
  params[:individual][:first_name] = "John"
597
597
  params[:individual][:last_name] = "Doe"
598
598
  merchant_account = Braintree::MerchantAccount.update!("sandbox_sub_merchant_account", params)
599
- merchant_account.individual_details.first_name.should == "John"
600
- merchant_account.individual_details.last_name.should == "Doe"
599
+ expect(merchant_account.individual_details.first_name).to eq("John")
600
+ expect(merchant_account.individual_details.last_name).to eq("Doe")
601
601
  end
602
602
  end
603
603
  end