stripe 5.28.0 → 5.32.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/Gemfile +0 -1
- data/README.md +4 -1
- data/VERSION +1 -1
- data/lib/stripe.rb +23 -22
- data/lib/stripe/connection_manager.rb +10 -8
- data/lib/stripe/oauth.rb +4 -3
- data/lib/stripe/object_types.rb +1 -0
- data/lib/stripe/resources.rb +1 -0
- data/lib/stripe/resources/account.rb +3 -8
- data/lib/stripe/resources/billing_portal/configuration.rb +14 -0
- data/lib/stripe/resources/customer.rb +6 -1
- data/lib/stripe/resources/file.rb +2 -1
- data/lib/stripe/stripe_client.rb +131 -64
- data/lib/stripe/stripe_configuration.rb +25 -9
- data/lib/stripe/stripe_object.rb +23 -0
- data/lib/stripe/util.rb +12 -6
- data/lib/stripe/version.rb +1 -1
- data/stripe.gemspec +9 -2
- metadata +7 -195
- data/.editorconfig +0 -10
- data/.gitattributes +0 -4
- data/.github/ISSUE_TEMPLATE.md +0 -5
- data/.gitignore +0 -8
- data/.rubocop.yml +0 -80
- data/.rubocop_todo.yml +0 -33
- data/.travis.yml +0 -38
- data/.vscode/extensions.json +0 -7
- data/.vscode/settings.json +0 -8
- data/test/openapi/README.md +0 -9
- data/test/stripe/account_link_test.rb +0 -18
- data/test/stripe/account_test.rb +0 -412
- data/test/stripe/alipay_account_test.rb +0 -37
- data/test/stripe/api_operations_test.rb +0 -80
- data/test/stripe/api_resource_test.rb +0 -646
- data/test/stripe/apple_pay_domain_test.rb +0 -46
- data/test/stripe/application_fee_refund_test.rb +0 -37
- data/test/stripe/application_fee_test.rb +0 -58
- data/test/stripe/balance_test.rb +0 -13
- data/test/stripe/balance_transaction_test.rb +0 -20
- data/test/stripe/bank_account_test.rb +0 -36
- data/test/stripe/billing_portal/session_test.rb +0 -18
- data/test/stripe/capability_test.rb +0 -45
- data/test/stripe/charge_test.rb +0 -64
- data/test/stripe/checkout/session_test.rb +0 -53
- data/test/stripe/connection_manager_test.rb +0 -167
- data/test/stripe/country_spec_test.rb +0 -20
- data/test/stripe/coupon_test.rb +0 -61
- data/test/stripe/credit_note_test.rb +0 -90
- data/test/stripe/customer_balance_transaction_test.rb +0 -37
- data/test/stripe/customer_card_test.rb +0 -48
- data/test/stripe/customer_test.rb +0 -226
- data/test/stripe/dispute_test.rb +0 -51
- data/test/stripe/ephemeral_key_test.rb +0 -93
- data/test/stripe/errors_test.rb +0 -53
- data/test/stripe/exchange_rate_test.rb +0 -20
- data/test/stripe/file_link_test.rb +0 -41
- data/test/stripe/file_test.rb +0 -87
- data/test/stripe/instrumentation_test.rb +0 -74
- data/test/stripe/invoice_item_test.rb +0 -66
- data/test/stripe/invoice_line_item_test.rb +0 -8
- data/test/stripe/invoice_test.rb +0 -229
- data/test/stripe/issuing/authorization_test.rb +0 -72
- data/test/stripe/issuing/card_test.rb +0 -74
- data/test/stripe/issuing/cardholder_test.rb +0 -53
- data/test/stripe/issuing/dispute_test.rb +0 -54
- data/test/stripe/issuing/transaction_test.rb +0 -48
- data/test/stripe/list_object_test.rb +0 -202
- data/test/stripe/login_link_test.rb +0 -37
- data/test/stripe/mandate_test.rb +0 -14
- data/test/stripe/multipart_encoder_test.rb +0 -130
- data/test/stripe/oauth_test.rb +0 -104
- data/test/stripe/order_return_test.rb +0 -21
- data/test/stripe/order_test.rb +0 -82
- data/test/stripe/payment_intent_test.rb +0 -107
- data/test/stripe/payment_method_test.rb +0 -84
- data/test/stripe/payout_test.rb +0 -72
- data/test/stripe/person_test.rb +0 -46
- data/test/stripe/plan_test.rb +0 -98
- data/test/stripe/price_test.rb +0 -48
- data/test/stripe/product_test.rb +0 -58
- data/test/stripe/promotion_code_test.rb +0 -42
- data/test/stripe/radar/early_fraud_warning_test.rb +0 -22
- data/test/stripe/radar/value_list_item_test.rb +0 -48
- data/test/stripe/radar/value_list_test.rb +0 -61
- data/test/stripe/recipient_test.rb +0 -62
- data/test/stripe/refund_test.rb +0 -39
- data/test/stripe/reporting/report_run_test.rb +0 -33
- data/test/stripe/reporting/report_type_test.rb +0 -22
- data/test/stripe/reversal_test.rb +0 -43
- data/test/stripe/review_test.rb +0 -27
- data/test/stripe/setup_attempt_test.rb +0 -16
- data/test/stripe/setup_intent_test.rb +0 -84
- data/test/stripe/sigma/scheduled_query_run_test.rb +0 -22
- data/test/stripe/sku_test.rb +0 -60
- data/test/stripe/source_test.rb +0 -119
- data/test/stripe/stripe_client_test.rb +0 -1291
- data/test/stripe/stripe_configuration_test.rb +0 -131
- data/test/stripe/stripe_object_test.rb +0 -500
- data/test/stripe/stripe_response_test.rb +0 -95
- data/test/stripe/subscription_item_test.rb +0 -84
- data/test/stripe/subscription_schedule_test.rb +0 -82
- data/test/stripe/subscription_test.rb +0 -80
- data/test/stripe/tax_id_test.rb +0 -31
- data/test/stripe/tax_rate_test.rb +0 -43
- data/test/stripe/terminal/connection_token_test.rb +0 -16
- data/test/stripe/terminal/location_test.rb +0 -68
- data/test/stripe/terminal/reader_test.rb +0 -62
- data/test/stripe/three_d_secure_test.rb +0 -23
- data/test/stripe/topup_test.rb +0 -62
- data/test/stripe/transfer_test.rb +0 -88
- data/test/stripe/usage_record_summary_test.rb +0 -29
- data/test/stripe/util_test.rb +0 -402
- data/test/stripe/webhook_endpoint_test.rb +0 -59
- data/test/stripe/webhook_test.rb +0 -135
- data/test/stripe_mock.rb +0 -78
- data/test/stripe_test.rb +0 -132
- data/test/test_data.rb +0 -61
- 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
|