stripe 4.18.0 → 4.18.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +11 -1
  3. data/.rubocop_todo.yml +3 -15
  4. data/CHANGELOG.md +3 -0
  5. data/Gemfile +3 -1
  6. data/VERSION +1 -1
  7. data/lib/stripe.rb +5 -3
  8. data/lib/stripe/account.rb +31 -17
  9. data/lib/stripe/alipay_account.rb +10 -3
  10. data/lib/stripe/api_operations/nested_resource.rb +12 -6
  11. data/lib/stripe/api_operations/request.rb +3 -7
  12. data/lib/stripe/api_operations/save.rb +1 -3
  13. data/lib/stripe/api_resource.rb +11 -3
  14. data/lib/stripe/application_fee.rb +2 -1
  15. data/lib/stripe/application_fee_refund.rb +11 -3
  16. data/lib/stripe/bank_account.rb +16 -4
  17. data/lib/stripe/bitcoin_receiver.rb +2 -1
  18. data/lib/stripe/capability.rb +10 -3
  19. data/lib/stripe/card.rb +16 -5
  20. data/lib/stripe/charge.rb +4 -6
  21. data/lib/stripe/customer.rb +5 -7
  22. data/lib/stripe/ephemeral_key.rb +4 -1
  23. data/lib/stripe/errors.rb +8 -8
  24. data/lib/stripe/invoice.rb +2 -1
  25. data/lib/stripe/list_object.rb +9 -4
  26. data/lib/stripe/login_link.rb +4 -1
  27. data/lib/stripe/order.rb +3 -5
  28. data/lib/stripe/person.rb +7 -2
  29. data/lib/stripe/reversal.rb +10 -3
  30. data/lib/stripe/singleton_api_resource.rb +3 -1
  31. data/lib/stripe/source.rb +4 -2
  32. data/lib/stripe/stripe_client.rb +84 -65
  33. data/lib/stripe/stripe_object.rb +50 -36
  34. data/lib/stripe/subscription.rb +1 -3
  35. data/lib/stripe/subscription_item.rb +2 -1
  36. data/lib/stripe/subscription_schedule_revision.rb +13 -4
  37. data/lib/stripe/tax_id.rb +7 -3
  38. data/lib/stripe/transfer.rb +2 -1
  39. data/lib/stripe/usage_record.rb +12 -3
  40. data/lib/stripe/util.rb +40 -24
  41. data/lib/stripe/version.rb +1 -1
  42. data/lib/stripe/webhook.rb +4 -2
  43. data/stripe.gemspec +4 -2
  44. data/test/stripe/account_link_test.rb +1 -1
  45. data/test/stripe/account_test.rb +1 -1
  46. data/test/stripe/alipay_account_test.rb +1 -1
  47. data/test/stripe/api_operations_test.rb +1 -2
  48. data/test/stripe/api_resource_test.rb +5 -8
  49. data/test/stripe/apple_pay_domain_test.rb +1 -1
  50. data/test/stripe/application_fee_refund_test.rb +1 -1
  51. data/test/stripe/application_fee_test.rb +1 -1
  52. data/test/stripe/balance_test.rb +1 -1
  53. data/test/stripe/bank_account_test.rb +1 -1
  54. data/test/stripe/capability_test.rb +1 -1
  55. data/test/stripe/charge_test.rb +1 -1
  56. data/test/stripe/checkout/session_test.rb +1 -1
  57. data/test/stripe/country_spec_test.rb +1 -1
  58. data/test/stripe/coupon_test.rb +1 -1
  59. data/test/stripe/credit_note_test.rb +1 -1
  60. data/test/stripe/customer_card_test.rb +1 -1
  61. data/test/stripe/customer_test.rb +1 -1
  62. data/test/stripe/dispute_test.rb +1 -1
  63. data/test/stripe/ephemeral_key_test.rb +1 -1
  64. data/test/stripe/errors_test.rb +1 -1
  65. data/test/stripe/exchange_rate_test.rb +1 -1
  66. data/test/stripe/file_link_test.rb +1 -1
  67. data/test/stripe/file_test.rb +1 -1
  68. data/test/stripe/file_upload_test.rb +1 -1
  69. data/test/stripe/invoice_item_test.rb +1 -1
  70. data/test/stripe/invoice_line_item_test.rb +1 -1
  71. data/test/stripe/invoice_test.rb +1 -1
  72. data/test/stripe/issuer_fraud_record_test.rb +1 -1
  73. data/test/stripe/issuing/authorization_test.rb +1 -1
  74. data/test/stripe/issuing/card_test.rb +1 -1
  75. data/test/stripe/issuing/cardholder_test.rb +1 -1
  76. data/test/stripe/issuing/dispute_test.rb +1 -1
  77. data/test/stripe/issuing/transaction_test.rb +1 -1
  78. data/test/stripe/list_object_test.rb +1 -1
  79. data/test/stripe/login_link_test.rb +1 -1
  80. data/test/stripe/oauth_test.rb +1 -1
  81. data/test/stripe/order_return_test.rb +1 -1
  82. data/test/stripe/order_test.rb +8 -1
  83. data/test/stripe/payment_intent_test.rb +1 -1
  84. data/test/stripe/payment_method_test.rb +1 -1
  85. data/test/stripe/payout_test.rb +1 -1
  86. data/test/stripe/person_test.rb +1 -1
  87. data/test/stripe/plan_test.rb +1 -1
  88. data/test/stripe/product_test.rb +1 -1
  89. data/test/stripe/radar/early_fraud_warning_test.rb +1 -1
  90. data/test/stripe/radar/value_list_item_test.rb +1 -1
  91. data/test/stripe/radar/value_list_test.rb +1 -1
  92. data/test/stripe/recipient_test.rb +1 -1
  93. data/test/stripe/refund_test.rb +1 -1
  94. data/test/stripe/reporting/report_run_test.rb +1 -1
  95. data/test/stripe/reporting/report_type_test.rb +1 -1
  96. data/test/stripe/reversal_test.rb +1 -1
  97. data/test/stripe/review_test.rb +1 -1
  98. data/test/stripe/sigma/scheduled_query_run_test.rb +1 -1
  99. data/test/stripe/sku_test.rb +1 -1
  100. data/test/stripe/source_test.rb +1 -1
  101. data/test/stripe/source_transaction_test.rb +1 -1
  102. data/test/stripe/stripe_client_test.rb +1 -1
  103. data/test/stripe/stripe_object_test.rb +1 -1
  104. data/test/stripe/stripe_response_test.rb +1 -1
  105. data/test/stripe/subscription_item_test.rb +1 -1
  106. data/test/stripe/subscription_schedule_revision_test.rb +1 -1
  107. data/test/stripe/subscription_schedule_test.rb +1 -1
  108. data/test/stripe/subscription_test.rb +1 -1
  109. data/test/stripe/tax_id_test.rb +1 -1
  110. data/test/stripe/tax_rate_test.rb +1 -1
  111. data/test/stripe/terminal/connection_token_test.rb +1 -1
  112. data/test/stripe/terminal/location_test.rb +1 -1
  113. data/test/stripe/terminal/reader_test.rb +1 -1
  114. data/test/stripe/three_d_secure_test.rb +1 -1
  115. data/test/stripe/topup_test.rb +1 -1
  116. data/test/stripe/transfer_test.rb +1 -1
  117. data/test/stripe/usage_record_summary_test.rb +1 -1
  118. data/test/stripe/usage_record_test.rb +1 -1
  119. data/test/stripe/util_test.rb +1 -1
  120. data/test/stripe/webhook_endpoint_test.rb +1 -1
  121. data/test/stripe/webhook_test.rb +2 -2
  122. data/test/stripe_test.rb +1 -1
  123. data/test/test_helper.rb +4 -6
  124. metadata +2 -2
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class PaymentMethodTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class PayoutTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class PersonTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class PlanTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class ProductTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../../test_helper", __FILE__)
3
+ require ::File.expand_path("../../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  module Radar
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../../test_helper", __FILE__)
3
+ require ::File.expand_path("../../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  module Radar
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../../test_helper", __FILE__)
3
+ require ::File.expand_path("../../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  module Radar
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class RecipientTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class RefundTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../../test_helper", __FILE__)
3
+ require ::File.expand_path("../../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  module Reporting
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../../test_helper", __FILE__)
3
+ require ::File.expand_path("../../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  module Reporting
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class ReversalTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class ReviewTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../../test_helper", __FILE__)
3
+ require ::File.expand_path("../../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  module Issuing
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class SKUTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class SourceTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class SourceTransactionTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class StripeClientTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class StripeObjectTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class StripeResponseTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class SubscriptionItemTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class SubscriptionScheduleRevisionTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class SubscriptionScheduleTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class SubscriptionTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class TaxIdTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class TaxRateTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../../test_helper", __FILE__)
3
+ require ::File.expand_path("../../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  module Terminal
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../../test_helper", __FILE__)
3
+ require ::File.expand_path("../../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  module Terminal
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../../test_helper", __FILE__)
3
+ require ::File.expand_path("../../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  module Terminal
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class ThreeDSecureTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class TopupTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class TransferTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class UsageRecordSummaryTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class UsageRecordTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class UtilTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class WebhookEndpointTest < Test::Unit::TestCase
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../../test_helper", __FILE__)
3
+ require ::File.expand_path("../test_helper", __dir__)
4
4
 
5
5
  module Stripe
6
6
  class WebhookTest < Test::Unit::TestCase
@@ -46,7 +46,7 @@ module Stripe
46
46
 
47
47
  context ".verify_signature_header" do
48
48
  should "raise a SignatureVerificationError when the header does not have the expected format" do
49
- header = 'i\'m not even a real signature header'
49
+ header = "i'm not even a real signature header"
50
50
  e = assert_raises(Stripe::SignatureVerificationError) do
51
51
  Stripe::Webhook::Signature.verify_header(EVENT_PAYLOAD, header, "secret")
52
52
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require ::File.expand_path("../test_helper", __FILE__)
3
+ require ::File.expand_path("test_helper", __dir__)
4
4
 
5
5
  class StripeTest < Test::Unit::TestCase
6
6
  should "warn that #refresh_from is deprecated" do
@@ -11,10 +11,10 @@ require "shoulda/context"
11
11
  require "timecop"
12
12
  require "webmock/test_unit"
13
13
 
14
- PROJECT_ROOT = ::File.expand_path("../../", __FILE__)
14
+ PROJECT_ROOT = ::File.expand_path("../", __dir__)
15
15
 
16
- require ::File.expand_path("../test_data", __FILE__)
17
- require ::File.expand_path("../stripe_mock", __FILE__)
16
+ require ::File.expand_path("test_data", __dir__)
17
+ require ::File.expand_path("stripe_mock", __dir__)
18
18
 
19
19
  # If changing this number, please also change it in `.travis.yml`.
20
20
  MOCK_MINIMUM_VERSION = "0.57.0".freeze
@@ -63,9 +63,7 @@ module Test
63
63
  Stripe.api_key = nil
64
64
  end
65
65
 
66
- private
67
-
68
- def stub_connect
66
+ private def stub_connect
69
67
  stub_request(:any, /^#{Stripe.connect_base}/).to_return(body: "{}")
70
68
  end
71
69
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.18.0
4
+ version: 4.18.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-24 00:00:00.000000000 Z
11
+ date: 2019-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday