stripe 5.28.0 → 5.32.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +19 -0
  3. data/Gemfile +0 -1
  4. data/README.md +4 -1
  5. data/VERSION +1 -1
  6. data/lib/stripe.rb +23 -22
  7. data/lib/stripe/connection_manager.rb +10 -8
  8. data/lib/stripe/oauth.rb +4 -3
  9. data/lib/stripe/object_types.rb +1 -0
  10. data/lib/stripe/resources.rb +1 -0
  11. data/lib/stripe/resources/account.rb +3 -8
  12. data/lib/stripe/resources/billing_portal/configuration.rb +14 -0
  13. data/lib/stripe/resources/customer.rb +6 -1
  14. data/lib/stripe/resources/file.rb +2 -1
  15. data/lib/stripe/stripe_client.rb +131 -64
  16. data/lib/stripe/stripe_configuration.rb +25 -9
  17. data/lib/stripe/stripe_object.rb +23 -0
  18. data/lib/stripe/util.rb +12 -6
  19. data/lib/stripe/version.rb +1 -1
  20. data/stripe.gemspec +9 -2
  21. metadata +7 -195
  22. data/.editorconfig +0 -10
  23. data/.gitattributes +0 -4
  24. data/.github/ISSUE_TEMPLATE.md +0 -5
  25. data/.gitignore +0 -8
  26. data/.rubocop.yml +0 -80
  27. data/.rubocop_todo.yml +0 -33
  28. data/.travis.yml +0 -38
  29. data/.vscode/extensions.json +0 -7
  30. data/.vscode/settings.json +0 -8
  31. data/test/openapi/README.md +0 -9
  32. data/test/stripe/account_link_test.rb +0 -18
  33. data/test/stripe/account_test.rb +0 -412
  34. data/test/stripe/alipay_account_test.rb +0 -37
  35. data/test/stripe/api_operations_test.rb +0 -80
  36. data/test/stripe/api_resource_test.rb +0 -646
  37. data/test/stripe/apple_pay_domain_test.rb +0 -46
  38. data/test/stripe/application_fee_refund_test.rb +0 -37
  39. data/test/stripe/application_fee_test.rb +0 -58
  40. data/test/stripe/balance_test.rb +0 -13
  41. data/test/stripe/balance_transaction_test.rb +0 -20
  42. data/test/stripe/bank_account_test.rb +0 -36
  43. data/test/stripe/billing_portal/session_test.rb +0 -18
  44. data/test/stripe/capability_test.rb +0 -45
  45. data/test/stripe/charge_test.rb +0 -64
  46. data/test/stripe/checkout/session_test.rb +0 -53
  47. data/test/stripe/connection_manager_test.rb +0 -167
  48. data/test/stripe/country_spec_test.rb +0 -20
  49. data/test/stripe/coupon_test.rb +0 -61
  50. data/test/stripe/credit_note_test.rb +0 -90
  51. data/test/stripe/customer_balance_transaction_test.rb +0 -37
  52. data/test/stripe/customer_card_test.rb +0 -48
  53. data/test/stripe/customer_test.rb +0 -226
  54. data/test/stripe/dispute_test.rb +0 -51
  55. data/test/stripe/ephemeral_key_test.rb +0 -93
  56. data/test/stripe/errors_test.rb +0 -53
  57. data/test/stripe/exchange_rate_test.rb +0 -20
  58. data/test/stripe/file_link_test.rb +0 -41
  59. data/test/stripe/file_test.rb +0 -87
  60. data/test/stripe/instrumentation_test.rb +0 -74
  61. data/test/stripe/invoice_item_test.rb +0 -66
  62. data/test/stripe/invoice_line_item_test.rb +0 -8
  63. data/test/stripe/invoice_test.rb +0 -229
  64. data/test/stripe/issuing/authorization_test.rb +0 -72
  65. data/test/stripe/issuing/card_test.rb +0 -74
  66. data/test/stripe/issuing/cardholder_test.rb +0 -53
  67. data/test/stripe/issuing/dispute_test.rb +0 -54
  68. data/test/stripe/issuing/transaction_test.rb +0 -48
  69. data/test/stripe/list_object_test.rb +0 -202
  70. data/test/stripe/login_link_test.rb +0 -37
  71. data/test/stripe/mandate_test.rb +0 -14
  72. data/test/stripe/multipart_encoder_test.rb +0 -130
  73. data/test/stripe/oauth_test.rb +0 -104
  74. data/test/stripe/order_return_test.rb +0 -21
  75. data/test/stripe/order_test.rb +0 -82
  76. data/test/stripe/payment_intent_test.rb +0 -107
  77. data/test/stripe/payment_method_test.rb +0 -84
  78. data/test/stripe/payout_test.rb +0 -72
  79. data/test/stripe/person_test.rb +0 -46
  80. data/test/stripe/plan_test.rb +0 -98
  81. data/test/stripe/price_test.rb +0 -48
  82. data/test/stripe/product_test.rb +0 -58
  83. data/test/stripe/promotion_code_test.rb +0 -42
  84. data/test/stripe/radar/early_fraud_warning_test.rb +0 -22
  85. data/test/stripe/radar/value_list_item_test.rb +0 -48
  86. data/test/stripe/radar/value_list_test.rb +0 -61
  87. data/test/stripe/recipient_test.rb +0 -62
  88. data/test/stripe/refund_test.rb +0 -39
  89. data/test/stripe/reporting/report_run_test.rb +0 -33
  90. data/test/stripe/reporting/report_type_test.rb +0 -22
  91. data/test/stripe/reversal_test.rb +0 -43
  92. data/test/stripe/review_test.rb +0 -27
  93. data/test/stripe/setup_attempt_test.rb +0 -16
  94. data/test/stripe/setup_intent_test.rb +0 -84
  95. data/test/stripe/sigma/scheduled_query_run_test.rb +0 -22
  96. data/test/stripe/sku_test.rb +0 -60
  97. data/test/stripe/source_test.rb +0 -119
  98. data/test/stripe/stripe_client_test.rb +0 -1291
  99. data/test/stripe/stripe_configuration_test.rb +0 -131
  100. data/test/stripe/stripe_object_test.rb +0 -500
  101. data/test/stripe/stripe_response_test.rb +0 -95
  102. data/test/stripe/subscription_item_test.rb +0 -84
  103. data/test/stripe/subscription_schedule_test.rb +0 -82
  104. data/test/stripe/subscription_test.rb +0 -80
  105. data/test/stripe/tax_id_test.rb +0 -31
  106. data/test/stripe/tax_rate_test.rb +0 -43
  107. data/test/stripe/terminal/connection_token_test.rb +0 -16
  108. data/test/stripe/terminal/location_test.rb +0 -68
  109. data/test/stripe/terminal/reader_test.rb +0 -62
  110. data/test/stripe/three_d_secure_test.rb +0 -23
  111. data/test/stripe/topup_test.rb +0 -62
  112. data/test/stripe/transfer_test.rb +0 -88
  113. data/test/stripe/usage_record_summary_test.rb +0 -29
  114. data/test/stripe/util_test.rb +0 -402
  115. data/test/stripe/webhook_endpoint_test.rb +0 -59
  116. data/test/stripe/webhook_test.rb +0 -135
  117. data/test/stripe_mock.rb +0 -78
  118. data/test/stripe_test.rb +0 -132
  119. data/test/test_data.rb +0 -61
  120. data/test/test_helper.rb +0 -77
data/test/test_helper.rb DELETED
@@ -1,77 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "coveralls"
4
- Coveralls.wear!("test_frameworks")
5
-
6
- require "stripe"
7
- require "test/unit"
8
- require "mocha/setup"
9
- require "stringio"
10
- require "shoulda/context"
11
- require "webmock/test_unit"
12
-
13
- PROJECT_ROOT = ::File.expand_path("../", __dir__)
14
-
15
- require ::File.expand_path("test_data", __dir__)
16
- require ::File.expand_path("stripe_mock", __dir__)
17
-
18
- # If changing this number, please also change it in `.travis.yml`.
19
- MOCK_MINIMUM_VERSION = "0.101.0"
20
- MOCK_PORT = Stripe::StripeMock.start
21
-
22
- # Disable all real network connections except those that are outgoing to
23
- # stripe-mock.
24
- WebMock.disable_net_connect!(allow: "localhost:#{MOCK_PORT}")
25
-
26
- # Try one initial test connection to stripe-mock so that if there's a problem
27
- # we can print one error and fail fast so that it's more clear to the user how
28
- # they should fix the problem.
29
- begin
30
- resp = Net::HTTP.get_response(URI("http://localhost:#{MOCK_PORT}/"))
31
- version = resp["Stripe-Mock-Version"]
32
-
33
- if version.nil?
34
- abort("Couldn't find `Stripe-Mock-Version` in response from " \
35
- "`localhost:#{MOCK_PORT}`. Is the service running there stripe-mock?")
36
- end
37
-
38
- if version != "master" &&
39
- Gem::Version.new(version) < Gem::Version.new(MOCK_MINIMUM_VERSION)
40
- abort("Your version of stripe-mock (#{version}) is too old. The minimum " \
41
- "version to run this test suite is #{MOCK_MINIMUM_VERSION}. Please " \
42
- "see its repository for upgrade instructions.")
43
- end
44
- rescue Errno::ECONNREFUSED
45
- abort("Couldn't reach stripe-mock at `localhost:#{MOCK_PORT}`. Is " \
46
- "it running? Please see README for setup instructions.")
47
- end
48
-
49
- Test::Unit.at_exit do
50
- Stripe::StripeMock.stop
51
- end
52
-
53
- module Test
54
- module Unit
55
- class TestCase
56
- include Stripe::TestData
57
- include Mocha
58
-
59
- WRITE_TIMEOUT_SUPPORTED = Net::HTTP.instance_methods.include?(:write_timeout=)
60
-
61
- setup do
62
- Stripe.api_key = "sk_test_123"
63
- Stripe.api_base = "http://localhost:#{MOCK_PORT}"
64
-
65
- stub_connect
66
- end
67
-
68
- teardown do
69
- Stripe.api_key = nil
70
- end
71
-
72
- private def stub_connect
73
- stub_request(:any, /^#{Stripe.connect_base}/).to_return(body: "{}")
74
- end
75
- end
76
- end
77
- end