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
@@ -4,7 +4,7 @@ describe Braintree::Xml::Libxml do
4
4
  describe "self.parse" do
5
5
  it "typecasts integers" do
6
6
  xml = "<root><foo type=\"integer\">123</foo></root>"
7
- Braintree::Xml::Libxml.parse(xml).should == {"root"=>{"foo"=>{"__content__"=>"123", "type"=>"integer"}}}
7
+ expect(Braintree::Xml::Libxml.parse(xml)).to eq({"root"=>{"foo"=>{"__content__"=>"123", "type"=>"integer"}}})
8
8
  end
9
9
 
10
10
  it "works with dashes or underscores" do
@@ -14,7 +14,7 @@ describe Braintree::Xml::Libxml do
14
14
  <under_scores />
15
15
  </root>
16
16
  END
17
- Braintree::Xml::Libxml.parse(xml).should == {"root"=>{"dash-es"=>{}, "under_scores"=>{}}}
17
+ expect(Braintree::Xml::Libxml.parse(xml)).to eq({"root"=>{"dash-es"=>{}, "under_scores"=>{}}})
18
18
  end
19
19
 
20
20
  it "uses nil if nil=true, otherwise uses empty string" do
@@ -24,7 +24,7 @@ describe Braintree::Xml::Libxml do
24
24
  <an_empty_string></an_empty_string>
25
25
  </root>
26
26
  END
27
- Braintree::Xml::Libxml.parse(xml).should == {"root"=>{"a_nil_value"=>{"nil"=>"true"}, "an_empty_string"=>{}}}
27
+ expect(Braintree::Xml::Libxml.parse(xml)).to eq({"root"=>{"a_nil_value"=>{"nil"=>"true"}, "an_empty_string"=>{}}})
28
28
  end
29
29
 
30
30
  it "typecasts dates and times" do
@@ -33,7 +33,7 @@ describe Braintree::Xml::Libxml do
33
33
  <created-at type="datetime">2009-10-28T10:19:49Z</created-at>
34
34
  </root>
35
35
  END
36
- Braintree::Xml::Libxml.parse(xml).should == {"root"=>{"created-at"=>{"__content__"=>"2009-10-28T10:19:49Z", "type"=>"datetime"}}}
36
+ expect(Braintree::Xml::Libxml.parse(xml)).to eq({"root"=>{"created-at"=>{"__content__"=>"2009-10-28T10:19:49Z", "type"=>"datetime"}}})
37
37
  end
38
38
 
39
39
  it "builds an array if type=array" do
@@ -45,7 +45,7 @@ describe Braintree::Xml::Libxml do
45
45
  </customers>
46
46
  </root>
47
47
  END
48
- Braintree::Xml::Libxml.parse(xml).should == {"root"=>{"customers"=>{"type"=>"array", "customer"=>[{"name"=>{"__content__"=>"Adam"}}, {"name"=>{"__content__"=>"Ben"}}]}}}
48
+ expect(Braintree::Xml::Libxml.parse(xml)).to eq({"root"=>{"customers"=>{"type"=>"array", "customer"=>[{"name"=>{"__content__"=>"Adam"}}, {"name"=>{"__content__"=>"Ben"}}]}}})
49
49
  end
50
50
  end
51
51
  end
@@ -4,7 +4,7 @@ describe Braintree::Xml::Parser do
4
4
  describe "self.hash_from_xml" do
5
5
  it "typecasts integers" do
6
6
  xml = "<root><foo type=\"integer\">123</foo></root>"
7
- xml.should parse_to(:root => {:foo => 123})
7
+ expect(xml).to parse_to(:root => {:foo => 123})
8
8
  end
9
9
 
10
10
  it "works with dashes or underscores" do
@@ -14,7 +14,7 @@ describe Braintree::Xml::Parser do
14
14
  <under_scores />
15
15
  </root>
16
16
  END
17
- xml.should parse_to(:root=>{:dash_es=>"", :under_scores=>""})
17
+ expect(xml).to parse_to(:root=>{:dash_es=>"", :under_scores=>""})
18
18
  end
19
19
 
20
20
  it "uses nil if nil=true, otherwise uses empty string" do
@@ -24,7 +24,7 @@ describe Braintree::Xml::Parser do
24
24
  <an_empty_string></an_empty_string>
25
25
  </root>
26
26
  END
27
- xml.should parse_to(:root => {:a_nil_value => nil, :an_empty_string => ""})
27
+ expect(xml).to parse_to(:root => {:a_nil_value => nil, :an_empty_string => ""})
28
28
  end
29
29
 
30
30
  it "typecasts datetimes" do
@@ -33,7 +33,7 @@ describe Braintree::Xml::Parser do
33
33
  <created-at type="datetime">2009-10-28T10:19:49Z</created-at>
34
34
  </root>
35
35
  END
36
- xml.should parse_to(:root => {:created_at => Time.utc(2009, 10, 28, 10, 19, 49)})
36
+ expect(xml).to parse_to(:root => {:created_at => Time.utc(2009, 10, 28, 10, 19, 49)})
37
37
  end
38
38
 
39
39
  it "doesn't typecast dates" do
@@ -42,7 +42,7 @@ describe Braintree::Xml::Parser do
42
42
  <created-at type="date">2009-10-28</created-at>
43
43
  </root>
44
44
  END
45
- xml.should parse_to(:root => {:created_at => "2009-10-28"})
45
+ expect(xml).to parse_to(:root => {:created_at => "2009-10-28"})
46
46
  end
47
47
 
48
48
  it "builds an array if type=array" do
@@ -54,7 +54,7 @@ describe Braintree::Xml::Parser do
54
54
  </customers>
55
55
  </root>
56
56
  END
57
- xml.should parse_to(:root => {:customers => [{:name => "Adam"}, {:name => "Ben"}]})
57
+ expect(xml).to parse_to(:root => {:customers => [{:name => "Adam"}, {:name => "Ben"}]})
58
58
  end
59
59
 
60
60
  it "parses an array" do
@@ -66,7 +66,7 @@ describe Braintree::Xml::Parser do
66
66
  </customers>
67
67
  </root>
68
68
  END
69
- xml.should parse_to(:root => {:customers => [{:name => "Adam", :customer_id => "1"}, {:name => "Ben", :customer_id => "2"}]})
69
+ expect(xml).to parse_to(:root => {:customers => [{:name => "Adam", :customer_id => "1"}, {:name => "Ben", :customer_id => "2"}]})
70
70
  end
71
71
 
72
72
  it "parses nested objects" do
@@ -79,7 +79,7 @@ describe Braintree::Xml::Parser do
79
79
  </paypal-details>
80
80
  </root>
81
81
  END
82
- xml.should parse_to(:root => {:paypal_details => {:deets => [{:secret_code => "1234"}], :payer_email => "abc@test.com", :payment_id => "1234567890"}})
82
+ expect(xml).to parse_to(:root => {:paypal_details => {:deets => [{:secret_code => "1234"}], :payer_email => "abc@test.com", :payment_id => "1234567890"}})
83
83
  end
84
84
  end
85
85
  end
@@ -4,7 +4,7 @@ describe Braintree::Xml::Rexml do
4
4
  describe "self.parse" do
5
5
  it "typecasts integers" do
6
6
  xml = "<root><foo type=\"integer\">123</foo></root>"
7
- Braintree::Xml::Rexml.parse(xml).should == {"root"=>{"foo"=>{"__content__"=>"123", "type"=>"integer"}}}
7
+ expect(Braintree::Xml::Rexml.parse(xml)).to eq({"root"=>{"foo"=>{"__content__"=>"123", "type"=>"integer"}}})
8
8
  end
9
9
 
10
10
  it "works with dashes or underscores" do
@@ -14,7 +14,7 @@ describe Braintree::Xml::Rexml do
14
14
  <under_scores />
15
15
  </root>
16
16
  END
17
- Braintree::Xml::Rexml.parse(xml).should == {"root"=>{"dash-es"=>{}, "under_scores"=>{}}}
17
+ expect(Braintree::Xml::Rexml.parse(xml)).to eq({"root"=>{"dash-es"=>{}, "under_scores"=>{}}})
18
18
  end
19
19
 
20
20
  it "uses nil if nil=true, otherwise uses empty string" do
@@ -24,7 +24,7 @@ describe Braintree::Xml::Rexml do
24
24
  <an_empty_string></an_empty_string>
25
25
  </root>
26
26
  END
27
- Braintree::Xml::Rexml.parse(xml).should == {"root"=>{"a_nil_value"=>{"nil"=>"true"}, "an_empty_string"=>{}}}
27
+ expect(Braintree::Xml::Rexml.parse(xml)).to eq({"root"=>{"a_nil_value"=>{"nil"=>"true"}, "an_empty_string"=>{}}})
28
28
  end
29
29
 
30
30
  it "typecasts dates and times" do
@@ -33,7 +33,7 @@ describe Braintree::Xml::Rexml do
33
33
  <created-at type="datetime">2009-10-28T10:19:49Z</created-at>
34
34
  </root>
35
35
  END
36
- Braintree::Xml::Rexml.parse(xml).should == {"root"=>{"created-at"=>{"__content__"=>"2009-10-28T10:19:49Z", "type"=>"datetime"}}}
36
+ expect(Braintree::Xml::Rexml.parse(xml)).to eq({"root"=>{"created-at"=>{"__content__"=>"2009-10-28T10:19:49Z", "type"=>"datetime"}}})
37
37
  end
38
38
 
39
39
  it "builds an array if type=array" do
@@ -45,7 +45,7 @@ describe Braintree::Xml::Rexml do
45
45
  </customers>
46
46
  </root>
47
47
  END
48
- Braintree::Xml::Rexml.parse(xml).should == {"root"=>{"customers"=>{"type"=>"array", "customer"=>[{"name"=>{"__content__"=>"Adam"}}, {"name"=>{"__content__"=>"Ben"}}]}}}
48
+ expect(Braintree::Xml::Rexml.parse(xml)).to eq({"root"=>{"customers"=>{"type"=>"array", "customer"=>[{"name"=>{"__content__"=>"Adam"}}, {"name"=>{"__content__"=>"Ben"}}]}}})
49
49
  end
50
50
  end
51
51
  end
@@ -4,7 +4,7 @@ describe Braintree::Xml do
4
4
  describe "self.hash_from_xml" do
5
5
  it "typecasts integers" do
6
6
  hash = Braintree::Xml.hash_from_xml("<root><foo type=\"integer\">123</foo></root>")
7
- hash.should == {:root => {:foo => 123}}
7
+ expect(hash).to eq({:root => {:foo => 123}})
8
8
  end
9
9
 
10
10
  it "works with dashes or underscores" do
@@ -16,7 +16,7 @@ describe Braintree::Xml do
16
16
  END
17
17
 
18
18
  hash = Braintree::Xml.hash_from_xml(xml)
19
- hash.should == {:root => {:dash_es => "", :under_scores => ""}}
19
+ expect(hash).to eq({:root => {:dash_es => "", :under_scores => ""}})
20
20
  end
21
21
 
22
22
  it "uses nil if nil=true, otherwise uses empty string" do
@@ -27,7 +27,7 @@ describe Braintree::Xml do
27
27
  </root>
28
28
  END
29
29
  hash = Braintree::Xml.hash_from_xml(xml)
30
- hash.should == {:root => {:a_nil_value => nil, :an_empty_string => ""}}
30
+ expect(hash).to eq({:root => {:a_nil_value => nil, :an_empty_string => ""}})
31
31
  end
32
32
 
33
33
  it "typecasts dates and times" do
@@ -36,7 +36,7 @@ describe Braintree::Xml do
36
36
  <created-at type="datetime">2009-10-28T10:19:49Z</created-at>
37
37
  </root>
38
38
  END
39
- hash.should == {:root => {:created_at => Time.utc(2009, 10, 28, 10, 19, 49)}}
39
+ expect(hash).to eq({:root => {:created_at => Time.utc(2009, 10, 28, 10, 19, 49)}})
40
40
  end
41
41
 
42
42
  it "builds an array if type=array" do
@@ -48,7 +48,7 @@ describe Braintree::Xml do
48
48
  </customers>
49
49
  </root>
50
50
  END
51
- hash.should == {:root => {:customers => [{:name => "Adam"}, {:name => "Ben"}]}}
51
+ expect(hash).to eq({:root => {:customers => [{:name => "Adam"}, {:name => "Ben"}]}})
52
52
  end
53
53
 
54
54
  it "turns 1 and true to boolean if type = boolean" do
@@ -61,10 +61,10 @@ describe Braintree::Xml do
61
61
  <uncasted-true>true</uncasted-true>
62
62
  </root>
63
63
  END
64
- hash.should == {:root => {
64
+ expect(hash).to eq({:root => {
65
65
  :casted_true => true, :casted_one => true, :casted_anything => false, :casted_false => false,
66
66
  :uncasted_true => "true"
67
- }}
67
+ }})
68
68
  end
69
69
 
70
70
  it "handles values that are arrays of hashes" do
@@ -75,13 +75,13 @@ describe Braintree::Xml do
75
75
  <elem><value>three</value></elem>
76
76
  </container>
77
77
  ")
78
- hash.should == {:container => {:elem => [{:value => "one"}, {:value => "two"}, {:value => "three"}]}}
78
+ expect(hash).to eq({:container => {:elem => [{:value => "one"}, {:value => "two"}, {:value => "three"}]}})
79
79
  end
80
80
  end
81
81
 
82
82
  describe "self.hash_to_xml" do
83
83
  def verify_to_xml_and_back(hash)
84
- Braintree::Xml.hash_from_xml(Braintree::Xml.hash_to_xml(hash)).should == hash
84
+ expect(Braintree::Xml.hash_from_xml(Braintree::Xml.hash_to_xml(hash))).to eq(hash)
85
85
  end
86
86
 
87
87
  it "works for a simple case" do
@@ -102,30 +102,30 @@ describe Braintree::Xml do
102
102
  context "Integer" do
103
103
  it "works for integers" do
104
104
  hash = {:root => {:foo => 1}}
105
- Braintree::Xml.hash_to_xml(hash).should include("<foo type=\"integer\">1</foo>")
105
+ expect(Braintree::Xml.hash_to_xml(hash)).to include("<foo type=\"integer\">1</foo>")
106
106
  end
107
107
  end
108
108
 
109
109
  context "BigDecimal" do
110
110
  it "works for BigDecimals" do
111
111
  hash = {:root => {:foo => BigDecimal("123.45")}}
112
- Braintree::Xml.hash_to_xml(hash).should include("<foo>123.45</foo>")
112
+ expect(Braintree::Xml.hash_to_xml(hash)).to include("<foo>123.45</foo>")
113
113
  end
114
114
 
115
115
  it "works for BigDecimals with fewer than 2 digits" do
116
116
  hash = {:root => {:foo => BigDecimal("1000.0")}}
117
- Braintree::Xml.hash_to_xml(hash).should include("<foo>1000.00</foo>")
117
+ expect(Braintree::Xml.hash_to_xml(hash)).to include("<foo>1000.00</foo>")
118
118
  end
119
119
 
120
120
  it "works for BigDecimals with more than 2 digits" do
121
121
  hash = {:root => {:foo => BigDecimal("12.345")}}
122
- Braintree::Xml.hash_to_xml(hash).should include("<foo>12.345</foo>")
122
+ expect(Braintree::Xml.hash_to_xml(hash)).to include("<foo>12.345</foo>")
123
123
  end
124
124
  end
125
125
 
126
126
  it "works for symbols" do
127
127
  hash = {:root => {:foo => :bar}}
128
- Braintree::Xml.hash_to_xml(hash).should include("<foo>bar</foo>")
128
+ expect(Braintree::Xml.hash_to_xml(hash)).to include("<foo>bar</foo>")
129
129
  end
130
130
 
131
131
  it "type casts booleans" do
@@ -145,7 +145,7 @@ describe Braintree::Xml do
145
145
 
146
146
  it "includes the encoding" do
147
147
  xml = Braintree::Xml.hash_to_xml(:root => {:root => "bar"})
148
- xml.should include("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")
148
+ expect(xml).to include("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")
149
149
  end
150
150
 
151
151
  it "works for only a root node and a string" do
@@ -155,12 +155,12 @@ describe Braintree::Xml do
155
155
 
156
156
  it "escapes keys and values" do
157
157
  hash = {"ke<y" => "val>ue"}
158
- Braintree::Xml.hash_to_xml(hash).should include("<ke&lt;y>val&gt;ue</ke&lt;y>")
158
+ expect(Braintree::Xml.hash_to_xml(hash)).to include("<ke&lt;y>val&gt;ue</ke&lt;y>")
159
159
  end
160
160
 
161
161
  it "escapes nested keys and values" do
162
162
  hash = {"top<" => {"ke<y" => "val>ue"}}
163
- Braintree::Xml.hash_to_xml(hash).gsub(/\s/, "").should include("<top&lt;><ke&lt;y>val&gt;ue</ke&lt;y></top&lt;>")
163
+ expect(Braintree::Xml.hash_to_xml(hash).gsub(/\s/, "")).to include("<top&lt;><ke&lt;y>val&gt;ue</ke&lt;y></top&lt;>")
164
164
  end
165
165
  end
166
166
  end
@@ -4,9 +4,9 @@ describe Braintree do
4
4
  it "doesn't produce warnings if loading braintree.rb twice" do
5
5
  lib_dir = File.expand_path(File.dirname(__FILE__) + "/../../lib")
6
6
  braintree_file = "#{lib_dir}/braintree.rb"
7
- File.exist?(braintree_file).should == true
7
+ expect(File.exist?(braintree_file)).to eq(true)
8
8
  output = `ruby -r rubygems -I #{lib_dir} -e 'load #{braintree_file.inspect}; load #{braintree_file.inspect}' 2>&1`
9
9
  output = output.gsub(/^.*warning: constant ::Fixnum is deprecated.*\n/, "")
10
- output.should == ""
10
+ expect(output).to eq("")
11
11
  end
12
12
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: braintree
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.14.0
4
+ version: 4.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Braintree
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-19 00:00:00.000000000 Z
11
+ date: 2024-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: builder
@@ -122,6 +122,8 @@ files:
122
122
  - lib/braintree/merchant_account/individual_details.rb
123
123
  - lib/braintree/merchant_account_gateway.rb
124
124
  - lib/braintree/merchant_gateway.rb
125
+ - lib/braintree/meta_checkout_card.rb
126
+ - lib/braintree/meta_checkout_token.rb
125
127
  - lib/braintree/modification.rb
126
128
  - lib/braintree/oauth_credentials.rb
127
129
  - lib/braintree/oauth_gateway.rb
@@ -177,6 +179,9 @@ files:
177
179
  - lib/braintree/transaction/installment.rb
178
180
  - lib/braintree/transaction/installment/adjustment.rb
179
181
  - lib/braintree/transaction/local_payment_details.rb
182
+ - lib/braintree/transaction/meta_checkout_card_details.rb
183
+ - lib/braintree/transaction/meta_checkout_token_details.rb
184
+ - lib/braintree/transaction/package_details.rb
180
185
  - lib/braintree/transaction/payment_receipt.rb
181
186
  - lib/braintree/transaction/payment_receipt/card_present_data.rb
182
187
  - lib/braintree/transaction/payment_receipt/merchant_address.rb
@@ -246,6 +251,7 @@ files:
246
251
  - spec/integration/braintree/merchant_account_spec.rb
247
252
  - spec/integration/braintree/merchant_spec.rb
248
253
  - spec/integration/braintree/oauth_spec.rb
254
+ - spec/integration/braintree/package_tracking_spec.rb
249
255
  - spec/integration/braintree/payment_method_nonce_spec.rb
250
256
  - spec/integration/braintree/payment_method_spec.rb
251
257
  - spec/integration/braintree/payment_method_us_bank_account_spec.rb
@@ -302,7 +308,12 @@ files:
302
308
  - spec/unit/braintree/local_payment_expired_spec.rb
303
309
  - spec/unit/braintree/local_payment_funded_spec.rb
304
310
  - spec/unit/braintree/merchant_account_spec.rb
311
+ - spec/unit/braintree/meta_checkout_card_details_spec.rb
312
+ - spec/unit/braintree/meta_checkout_card_spec.rb
313
+ - spec/unit/braintree/meta_checkout_token_details_spec.rb
314
+ - spec/unit/braintree/meta_checkout_token_spec.rb
305
315
  - spec/unit/braintree/modification_spec.rb
316
+ - spec/unit/braintree/package_tracking_spec.rb
306
317
  - spec/unit/braintree/payment_method_customer_data_updated_metadata_spec.rb
307
318
  - spec/unit/braintree/payment_method_nonce_details_payer_info_spec.rb
308
319
  - spec/unit/braintree/payment_method_nonce_details_spec.rb
@@ -324,6 +335,7 @@ files:
324
335
  - spec/unit/braintree/transaction/customer_details_spec.rb
325
336
  - spec/unit/braintree/transaction/deposit_details_spec.rb
326
337
  - spec/unit/braintree/transaction/installment_spec.rb
338
+ - spec/unit/braintree/transaction/local_payment_details_spec.rb
327
339
  - spec/unit/braintree/transaction/payment_receipt_spec.rb
328
340
  - spec/unit/braintree/transaction/paypal_details_spec.rb
329
341
  - spec/unit/braintree/transaction/sepa_direct_debit_account_details_spec.rb