stripe 5.31.0 → 5.35.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 +18 -0
- data/VERSION +1 -1
- data/lib/stripe/api_operations/request.rb +35 -2
- data/lib/stripe/api_resource.rb +8 -0
- data/lib/stripe/connection_manager.rb +17 -2
- data/lib/stripe/object_types.rb +3 -0
- data/lib/stripe/resources.rb +3 -0
- data/lib/stripe/resources/identity/verification_report.rb +12 -0
- data/lib/stripe/resources/identity/verification_session.rb +35 -0
- data/lib/stripe/resources/tax_code.rb +10 -0
- data/lib/stripe/stripe_client.rb +120 -57
- data/lib/stripe/stripe_response.rb +80 -52
- data/lib/stripe/util.rb +3 -1
- data/lib/stripe/version.rb +1 -1
- data/stripe.gemspec +9 -2
- metadata +9 -198
- data/.editorconfig +0 -10
- data/.gitattributes +0 -4
- data/.github/ISSUE_TEMPLATE.md +0 -5
- data/.github/workflows/ci.yml +0 -34
- data/.gitignore +0 -8
- data/.rubocop.yml +0 -81
- 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/configuration_test.rb +0 -37
- 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 -210
- 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 -149
- 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 -1456
- data/test/stripe/stripe_configuration_test.rb +0 -159
- data/test/stripe/stripe_object_test.rb +0 -510
- 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 -137
- data/test/test_data.rb +0 -61
- data/test/test_helper.rb +0 -74
data/test/test_helper.rb
DELETED
@@ -1,74 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "stripe"
|
4
|
-
require "test/unit"
|
5
|
-
require "mocha/setup"
|
6
|
-
require "stringio"
|
7
|
-
require "shoulda/context"
|
8
|
-
require "webmock/test_unit"
|
9
|
-
|
10
|
-
PROJECT_ROOT = ::File.expand_path("../", __dir__)
|
11
|
-
|
12
|
-
require ::File.expand_path("test_data", __dir__)
|
13
|
-
require ::File.expand_path("stripe_mock", __dir__)
|
14
|
-
|
15
|
-
# If changing this number, please also change it in `.travis.yml`.
|
16
|
-
MOCK_MINIMUM_VERSION = "0.103.0"
|
17
|
-
MOCK_PORT = Stripe::StripeMock.start
|
18
|
-
|
19
|
-
# Disable all real network connections except those that are outgoing to
|
20
|
-
# stripe-mock.
|
21
|
-
WebMock.disable_net_connect!(allow: "localhost:#{MOCK_PORT}")
|
22
|
-
|
23
|
-
# Try one initial test connection to stripe-mock so that if there's a problem
|
24
|
-
# we can print one error and fail fast so that it's more clear to the user how
|
25
|
-
# they should fix the problem.
|
26
|
-
begin
|
27
|
-
resp = Net::HTTP.get_response(URI("http://localhost:#{MOCK_PORT}/"))
|
28
|
-
version = resp["Stripe-Mock-Version"]
|
29
|
-
|
30
|
-
if version.nil?
|
31
|
-
abort("Couldn't find `Stripe-Mock-Version` in response from " \
|
32
|
-
"`localhost:#{MOCK_PORT}`. Is the service running there stripe-mock?")
|
33
|
-
end
|
34
|
-
|
35
|
-
if version != "master" &&
|
36
|
-
Gem::Version.new(version) < Gem::Version.new(MOCK_MINIMUM_VERSION)
|
37
|
-
abort("Your version of stripe-mock (#{version}) is too old. The minimum " \
|
38
|
-
"version to run this test suite is #{MOCK_MINIMUM_VERSION}. Please " \
|
39
|
-
"see its repository for upgrade instructions.")
|
40
|
-
end
|
41
|
-
rescue Errno::ECONNREFUSED
|
42
|
-
abort("Couldn't reach stripe-mock at `localhost:#{MOCK_PORT}`. Is " \
|
43
|
-
"it running? Please see README for setup instructions.")
|
44
|
-
end
|
45
|
-
|
46
|
-
Test::Unit.at_exit do
|
47
|
-
Stripe::StripeMock.stop
|
48
|
-
end
|
49
|
-
|
50
|
-
module Test
|
51
|
-
module Unit
|
52
|
-
class TestCase
|
53
|
-
include Stripe::TestData
|
54
|
-
include Mocha
|
55
|
-
|
56
|
-
WRITE_TIMEOUT_SUPPORTED = Net::HTTP.instance_methods.include?(:write_timeout=)
|
57
|
-
|
58
|
-
setup do
|
59
|
-
Stripe.api_key = "sk_test_123"
|
60
|
-
Stripe.api_base = "http://localhost:#{MOCK_PORT}"
|
61
|
-
|
62
|
-
stub_connect
|
63
|
-
end
|
64
|
-
|
65
|
-
teardown do
|
66
|
-
Stripe.api_key = nil
|
67
|
-
end
|
68
|
-
|
69
|
-
private def stub_connect
|
70
|
-
stub_request(:any, /^#{Stripe.connect_base}/).to_return(body: "{}")
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|