stripe 5.28.0 → 8.7.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 +286 -0
- data/Gemfile +5 -3
- data/Makefile +13 -0
- data/OPENAPI_VERSION +1 -0
- data/README.md +43 -5
- data/VERSION +1 -1
- data/lib/data/ca-certificates.crt +1241 -1937
- data/lib/stripe/api_operations/create.rb +6 -2
- data/lib/stripe/api_operations/delete.rb +12 -7
- data/lib/stripe/api_operations/list.rb +6 -9
- data/lib/stripe/api_operations/nested_resource.rb +62 -34
- data/lib/stripe/api_operations/request.rb +45 -2
- data/lib/stripe/api_operations/save.rb +13 -3
- data/lib/stripe/api_operations/search.rb +16 -0
- data/lib/stripe/api_resource.rb +11 -18
- data/lib/stripe/api_resource_test_helpers.rb +49 -0
- data/lib/stripe/api_version.rb +8 -0
- data/lib/stripe/connection_manager.rb +49 -11
- data/lib/stripe/error_object.rb +2 -3
- data/lib/stripe/instrumentation.rb +46 -6
- data/lib/stripe/oauth.rb +4 -3
- data/lib/stripe/object_types.rb +36 -10
- data/lib/stripe/resources/account.rb +39 -17
- data/lib/stripe/resources/account_link.rb +4 -0
- data/lib/stripe/resources/application_fee_refund.rb +7 -1
- data/lib/stripe/resources/apps/secret.rb +40 -0
- data/lib/stripe/resources/balance.rb +11 -0
- data/lib/stripe/resources/balance_transaction.rb +4 -0
- data/lib/stripe/resources/bank_account.rb +7 -0
- data/lib/stripe/resources/billing_portal/configuration.rb +15 -0
- data/lib/stripe/resources/billing_portal/session.rb +14 -0
- data/lib/stripe/resources/capability.rb +5 -1
- data/lib/stripe/resources/card.rb +6 -3
- data/lib/stripe/resources/cash_balance.rb +23 -0
- data/lib/stripe/resources/charge.rb +23 -3
- data/lib/stripe/resources/checkout/session.rb +49 -2
- data/lib/stripe/resources/country_spec.rb +6 -0
- data/lib/stripe/resources/coupon.rb +3 -0
- data/lib/stripe/resources/credit_note.rb +27 -9
- data/lib/stripe/resources/credit_note_line_item.rb +2 -0
- data/lib/stripe/resources/customer.rb +132 -4
- data/lib/stripe/resources/customer_balance_transaction.rb +9 -2
- data/lib/stripe/resources/customer_cash_balance_transaction.rb +14 -0
- data/lib/stripe/resources/discount.rb +5 -0
- data/lib/stripe/resources/dispute.rb +17 -3
- data/lib/stripe/resources/event.rb +29 -0
- data/lib/stripe/resources/exchange_rate.rb +11 -0
- data/lib/stripe/resources/file.rb +9 -1
- data/lib/stripe/resources/file_link.rb +3 -0
- data/lib/stripe/resources/financial_connections/account.rb +67 -0
- data/lib/stripe/resources/financial_connections/account_owner.rb +11 -0
- data/lib/stripe/resources/financial_connections/account_ownership.rb +11 -0
- data/lib/stripe/resources/financial_connections/session.rb +13 -0
- data/lib/stripe/resources/funding_instructions.rb +21 -0
- data/lib/stripe/resources/identity/verification_report.rb +23 -0
- data/lib/stripe/resources/identity/verification_session.rb +61 -0
- data/lib/stripe/resources/invoice.rb +105 -17
- data/lib/stripe/resources/invoice_item.rb +11 -0
- data/lib/stripe/resources/invoice_line_item.rb +1 -0
- data/lib/stripe/resources/issuing/authorization.rb +25 -5
- data/lib/stripe/resources/issuing/card.rb +78 -8
- data/lib/stripe/resources/issuing/cardholder.rb +3 -0
- data/lib/stripe/resources/issuing/dispute.rb +13 -3
- data/lib/stripe/resources/issuing/transaction.rb +5 -0
- data/lib/stripe/resources/line_item.rb +2 -0
- data/lib/stripe/resources/login_link.rb +2 -0
- data/lib/stripe/resources/mandate.rb +1 -0
- data/lib/stripe/resources/payment_intent.rb +103 -6
- data/lib/stripe/resources/payment_link.rb +35 -0
- data/lib/stripe/resources/payment_method.rb +25 -5
- data/lib/stripe/resources/payout.rb +28 -5
- data/lib/stripe/resources/person.rb +7 -0
- data/lib/stripe/resources/plan.rb +8 -0
- data/lib/stripe/resources/price.rb +15 -0
- data/lib/stripe/resources/product.rb +17 -0
- data/lib/stripe/resources/promotion_code.rb +2 -0
- data/lib/stripe/resources/quote.rb +128 -0
- data/lib/stripe/resources/radar/early_fraud_warning.rb +4 -0
- data/lib/stripe/resources/radar/value_list.rb +3 -0
- data/lib/stripe/resources/radar/value_list_item.rb +3 -0
- data/lib/stripe/resources/refund.rb +49 -0
- data/lib/stripe/resources/reporting/report_run.rb +8 -0
- data/lib/stripe/resources/reporting/report_type.rb +8 -1
- data/lib/stripe/resources/reversal.rb +16 -2
- data/lib/stripe/resources/review.rb +14 -3
- data/lib/stripe/resources/setup_attempt.rb +4 -0
- data/lib/stripe/resources/setup_intent.rb +60 -5
- data/lib/stripe/resources/shipping_rate.rb +14 -0
- data/lib/stripe/resources/sigma/scheduled_query_run.rb +4 -0
- data/lib/stripe/resources/source.rb +26 -6
- data/lib/stripe/resources/source_transaction.rb +5 -0
- data/lib/stripe/resources/subscription.rb +57 -3
- data/lib/stripe/resources/subscription_item.rb +2 -7
- data/lib/stripe/resources/subscription_schedule.rb +23 -5
- data/lib/stripe/resources/tax/calculation.rb +33 -0
- data/lib/stripe/resources/tax/calculation_line_item.rb +10 -0
- data/lib/stripe/resources/tax/settings.rb +15 -0
- data/lib/stripe/resources/tax/transaction.rb +49 -0
- data/lib/stripe/resources/tax/transaction_line_item.rb +10 -0
- data/lib/stripe/resources/tax_code.rb +11 -0
- data/lib/stripe/resources/tax_id.rb +5 -0
- data/lib/stripe/resources/tax_rate.rb +3 -0
- data/lib/stripe/resources/terminal/configuration.rb +16 -0
- data/lib/stripe/resources/terminal/connection_token.rb +3 -0
- data/lib/stripe/resources/terminal/location.rb +3 -0
- data/lib/stripe/resources/terminal/reader.rb +119 -0
- data/lib/stripe/resources/test_helpers/test_clock.rb +35 -0
- data/lib/stripe/resources/token.rb +20 -0
- data/lib/stripe/resources/topup.rb +15 -3
- data/lib/stripe/resources/transfer.rb +10 -11
- data/lib/stripe/resources/treasury/credit_reversal.rb +14 -0
- data/lib/stripe/resources/treasury/debit_reversal.rb +14 -0
- data/lib/stripe/resources/treasury/financial_account.rb +52 -0
- data/lib/stripe/resources/treasury/financial_account_features.rb +12 -0
- data/lib/stripe/resources/treasury/inbound_transfer.rb +94 -0
- data/lib/stripe/resources/treasury/outbound_payment.rb +96 -0
- data/lib/stripe/resources/treasury/outbound_transfer.rb +100 -0
- data/lib/stripe/resources/treasury/received_credit.rb +30 -0
- data/lib/stripe/resources/treasury/received_debit.rb +30 -0
- data/lib/stripe/resources/treasury/transaction.rb +13 -0
- data/lib/stripe/resources/treasury/transaction_entry.rb +17 -0
- data/lib/stripe/resources/usage_record.rb +5 -0
- data/lib/stripe/resources/usage_record_summary.rb +1 -0
- data/lib/stripe/resources/webhook_endpoint.rb +7 -0
- data/lib/stripe/resources.rb +34 -10
- data/lib/stripe/search_result_object.rb +86 -0
- data/lib/stripe/stripe_client.rb +267 -121
- data/lib/stripe/stripe_configuration.rb +29 -10
- data/lib/stripe/stripe_object.rb +25 -2
- data/lib/stripe/stripe_response.rb +80 -52
- data/lib/stripe/util.rb +100 -9
- data/lib/stripe/version.rb +1 -1
- data/lib/stripe.rb +27 -23
- data/stripe.gemspec +12 -5
- metadata +46 -204
- 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/lib/stripe/resources/bitcoin_receiver.rb +0 -24
- data/lib/stripe/resources/bitcoin_transaction.rb +0 -15
- data/lib/stripe/resources/issuing/card_details.rb +0 -9
- data/lib/stripe/resources/order.rb +0 -33
- data/lib/stripe/resources/order_return.rb +0 -10
- data/lib/stripe/resources/recipient.rb +0 -14
- data/lib/stripe/resources/sku.rb +0 -13
- data/lib/stripe/resources/three_d_secure.rb +0 -14
- 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
@@ -0,0 +1,52 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Treasury
|
6
|
+
# Stripe Treasury provides users with a container for money called a FinancialAccount that is separate from their Payments balance.
|
7
|
+
# FinancialAccounts serve as the source and destination of Treasury's money movement APIs.
|
8
|
+
class FinancialAccount < APIResource
|
9
|
+
extend Stripe::APIOperations::Create
|
10
|
+
extend Stripe::APIOperations::List
|
11
|
+
include Stripe::APIOperations::Save
|
12
|
+
|
13
|
+
OBJECT_NAME = "treasury.financial_account"
|
14
|
+
|
15
|
+
def retrieve_features(params = {}, opts = {})
|
16
|
+
request_stripe_object(
|
17
|
+
method: :get,
|
18
|
+
path: format("/v1/treasury/financial_accounts/%<financial_account>s/features", { financial_account: CGI.escape(self["id"]) }),
|
19
|
+
params: params,
|
20
|
+
opts: opts
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def update_features(params = {}, opts = {})
|
25
|
+
request_stripe_object(
|
26
|
+
method: :post,
|
27
|
+
path: format("/v1/treasury/financial_accounts/%<financial_account>s/features", { financial_account: CGI.escape(self["id"]) }),
|
28
|
+
params: params,
|
29
|
+
opts: opts
|
30
|
+
)
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.retrieve_features(financial_account, params = {}, opts = {})
|
34
|
+
request_stripe_object(
|
35
|
+
method: :get,
|
36
|
+
path: format("/v1/treasury/financial_accounts/%<financial_account>s/features", { financial_account: CGI.escape(financial_account) }),
|
37
|
+
params: params,
|
38
|
+
opts: opts
|
39
|
+
)
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.update_features(financial_account, params = {}, opts = {})
|
43
|
+
request_stripe_object(
|
44
|
+
method: :post,
|
45
|
+
path: format("/v1/treasury/financial_accounts/%<financial_account>s/features", { financial_account: CGI.escape(financial_account) }),
|
46
|
+
params: params,
|
47
|
+
opts: opts
|
48
|
+
)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Treasury
|
6
|
+
# Encodes whether a FinancialAccount has access to a particular Feature, with a `status` enum and associated `status_details`.
|
7
|
+
# Stripe or the platform can control Features via the requested field.
|
8
|
+
class FinancialAccountFeatures < APIResource
|
9
|
+
OBJECT_NAME = "treasury.financial_account_features"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Treasury
|
6
|
+
# Use [InboundTransfers](https://stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit.
|
7
|
+
class InboundTransfer < APIResource
|
8
|
+
extend Stripe::APIOperations::Create
|
9
|
+
extend Stripe::APIOperations::List
|
10
|
+
|
11
|
+
OBJECT_NAME = "treasury.inbound_transfer"
|
12
|
+
|
13
|
+
def cancel(params = {}, opts = {})
|
14
|
+
request_stripe_object(
|
15
|
+
method: :post,
|
16
|
+
path: format("/v1/treasury/inbound_transfers/%<inbound_transfer>s/cancel", { inbound_transfer: CGI.escape(self["id"]) }),
|
17
|
+
params: params,
|
18
|
+
opts: opts
|
19
|
+
)
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.cancel(inbound_transfer, params = {}, opts = {})
|
23
|
+
request_stripe_object(
|
24
|
+
method: :post,
|
25
|
+
path: format("/v1/treasury/inbound_transfers/%<inbound_transfer>s/cancel", { inbound_transfer: CGI.escape(inbound_transfer) }),
|
26
|
+
params: params,
|
27
|
+
opts: opts
|
28
|
+
)
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_helpers
|
32
|
+
TestHelpers.new(self)
|
33
|
+
end
|
34
|
+
|
35
|
+
class TestHelpers < APIResourceTestHelpers
|
36
|
+
RESOURCE_CLASS = InboundTransfer
|
37
|
+
|
38
|
+
def self.fail(id, params = {}, opts = {})
|
39
|
+
request_stripe_object(
|
40
|
+
method: :post,
|
41
|
+
path: format("/v1/test_helpers/treasury/inbound_transfers/%<id>s/fail", { id: CGI.escape(id) }),
|
42
|
+
params: params,
|
43
|
+
opts: opts
|
44
|
+
)
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.return_inbound_transfer(id, params = {}, opts = {})
|
48
|
+
request_stripe_object(
|
49
|
+
method: :post,
|
50
|
+
path: format("/v1/test_helpers/treasury/inbound_transfers/%<id>s/return", { id: CGI.escape(id) }),
|
51
|
+
params: params,
|
52
|
+
opts: opts
|
53
|
+
)
|
54
|
+
end
|
55
|
+
|
56
|
+
def self.succeed(id, params = {}, opts = {})
|
57
|
+
request_stripe_object(
|
58
|
+
method: :post,
|
59
|
+
path: format("/v1/test_helpers/treasury/inbound_transfers/%<id>s/succeed", { id: CGI.escape(id) }),
|
60
|
+
params: params,
|
61
|
+
opts: opts
|
62
|
+
)
|
63
|
+
end
|
64
|
+
|
65
|
+
def fail(params = {}, opts = {})
|
66
|
+
@resource.request_stripe_object(
|
67
|
+
method: :post,
|
68
|
+
path: format("/v1/test_helpers/treasury/inbound_transfers/%<id>s/fail", { id: CGI.escape(@resource["id"]) }),
|
69
|
+
params: params,
|
70
|
+
opts: opts
|
71
|
+
)
|
72
|
+
end
|
73
|
+
|
74
|
+
def return_inbound_transfer(params = {}, opts = {})
|
75
|
+
@resource.request_stripe_object(
|
76
|
+
method: :post,
|
77
|
+
path: format("/v1/test_helpers/treasury/inbound_transfers/%<id>s/return", { id: CGI.escape(@resource["id"]) }),
|
78
|
+
params: params,
|
79
|
+
opts: opts
|
80
|
+
)
|
81
|
+
end
|
82
|
+
|
83
|
+
def succeed(params = {}, opts = {})
|
84
|
+
@resource.request_stripe_object(
|
85
|
+
method: :post,
|
86
|
+
path: format("/v1/test_helpers/treasury/inbound_transfers/%<id>s/succeed", { id: CGI.escape(@resource["id"]) }),
|
87
|
+
params: params,
|
88
|
+
opts: opts
|
89
|
+
)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
@@ -0,0 +1,96 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Treasury
|
6
|
+
# Use OutboundPayments to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers).
|
7
|
+
#
|
8
|
+
# Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects.
|
9
|
+
class OutboundPayment < APIResource
|
10
|
+
extend Stripe::APIOperations::Create
|
11
|
+
extend Stripe::APIOperations::List
|
12
|
+
|
13
|
+
OBJECT_NAME = "treasury.outbound_payment"
|
14
|
+
|
15
|
+
def cancel(params = {}, opts = {})
|
16
|
+
request_stripe_object(
|
17
|
+
method: :post,
|
18
|
+
path: format("/v1/treasury/outbound_payments/%<id>s/cancel", { id: CGI.escape(self["id"]) }),
|
19
|
+
params: params,
|
20
|
+
opts: opts
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.cancel(id, params = {}, opts = {})
|
25
|
+
request_stripe_object(
|
26
|
+
method: :post,
|
27
|
+
path: format("/v1/treasury/outbound_payments/%<id>s/cancel", { id: CGI.escape(id) }),
|
28
|
+
params: params,
|
29
|
+
opts: opts
|
30
|
+
)
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_helpers
|
34
|
+
TestHelpers.new(self)
|
35
|
+
end
|
36
|
+
|
37
|
+
class TestHelpers < APIResourceTestHelpers
|
38
|
+
RESOURCE_CLASS = OutboundPayment
|
39
|
+
|
40
|
+
def self.fail(id, params = {}, opts = {})
|
41
|
+
request_stripe_object(
|
42
|
+
method: :post,
|
43
|
+
path: format("/v1/test_helpers/treasury/outbound_payments/%<id>s/fail", { id: CGI.escape(id) }),
|
44
|
+
params: params,
|
45
|
+
opts: opts
|
46
|
+
)
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.post(id, params = {}, opts = {})
|
50
|
+
request_stripe_object(
|
51
|
+
method: :post,
|
52
|
+
path: format("/v1/test_helpers/treasury/outbound_payments/%<id>s/post", { id: CGI.escape(id) }),
|
53
|
+
params: params,
|
54
|
+
opts: opts
|
55
|
+
)
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.return_outbound_payment(id, params = {}, opts = {})
|
59
|
+
request_stripe_object(
|
60
|
+
method: :post,
|
61
|
+
path: format("/v1/test_helpers/treasury/outbound_payments/%<id>s/return", { id: CGI.escape(id) }),
|
62
|
+
params: params,
|
63
|
+
opts: opts
|
64
|
+
)
|
65
|
+
end
|
66
|
+
|
67
|
+
def fail(params = {}, opts = {})
|
68
|
+
@resource.request_stripe_object(
|
69
|
+
method: :post,
|
70
|
+
path: format("/v1/test_helpers/treasury/outbound_payments/%<id>s/fail", { id: CGI.escape(@resource["id"]) }),
|
71
|
+
params: params,
|
72
|
+
opts: opts
|
73
|
+
)
|
74
|
+
end
|
75
|
+
|
76
|
+
def post(params = {}, opts = {})
|
77
|
+
@resource.request_stripe_object(
|
78
|
+
method: :post,
|
79
|
+
path: format("/v1/test_helpers/treasury/outbound_payments/%<id>s/post", { id: CGI.escape(@resource["id"]) }),
|
80
|
+
params: params,
|
81
|
+
opts: opts
|
82
|
+
)
|
83
|
+
end
|
84
|
+
|
85
|
+
def return_outbound_payment(params = {}, opts = {})
|
86
|
+
@resource.request_stripe_object(
|
87
|
+
method: :post,
|
88
|
+
path: format("/v1/test_helpers/treasury/outbound_payments/%<id>s/return", { id: CGI.escape(@resource["id"]) }),
|
89
|
+
params: params,
|
90
|
+
opts: opts
|
91
|
+
)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
@@ -0,0 +1,100 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Treasury
|
6
|
+
# Use OutboundTransfers to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account.
|
7
|
+
#
|
8
|
+
# Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects.
|
9
|
+
class OutboundTransfer < APIResource
|
10
|
+
extend Stripe::APIOperations::Create
|
11
|
+
extend Stripe::APIOperations::List
|
12
|
+
|
13
|
+
OBJECT_NAME = "treasury.outbound_transfer"
|
14
|
+
|
15
|
+
def cancel(params = {}, opts = {})
|
16
|
+
request_stripe_object(
|
17
|
+
method: :post,
|
18
|
+
path: format("/v1/treasury/outbound_transfers/%<outbound_transfer>s/cancel", { outbound_transfer: CGI.escape(self["id"]) }),
|
19
|
+
params: params,
|
20
|
+
opts: opts
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.cancel(outbound_transfer, params = {}, opts = {})
|
25
|
+
request_stripe_object(
|
26
|
+
method: :post,
|
27
|
+
path: format("/v1/treasury/outbound_transfers/%<outbound_transfer>s/cancel", { outbound_transfer: CGI.escape(outbound_transfer) }),
|
28
|
+
params: params,
|
29
|
+
opts: opts
|
30
|
+
)
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_helpers
|
34
|
+
TestHelpers.new(self)
|
35
|
+
end
|
36
|
+
|
37
|
+
class TestHelpers < APIResourceTestHelpers
|
38
|
+
RESOURCE_CLASS = OutboundTransfer
|
39
|
+
|
40
|
+
def self.fail(outbound_transfer, params = {}, opts = {})
|
41
|
+
request_stripe_object(
|
42
|
+
method: :post,
|
43
|
+
path: format("/v1/test_helpers/treasury/outbound_transfers/%<outbound_transfer>s/fail", { outbound_transfer: CGI.escape(outbound_transfer) }),
|
44
|
+
params: params,
|
45
|
+
opts: opts
|
46
|
+
)
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.post(outbound_transfer, params = {}, opts = {})
|
50
|
+
request_stripe_object(
|
51
|
+
method: :post,
|
52
|
+
path: format("/v1/test_helpers/treasury/outbound_transfers/%<outbound_transfer>s/post", { outbound_transfer: CGI.escape(outbound_transfer) }),
|
53
|
+
params: params,
|
54
|
+
opts: opts
|
55
|
+
)
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.return_outbound_transfer(
|
59
|
+
outbound_transfer,
|
60
|
+
params = {},
|
61
|
+
opts = {}
|
62
|
+
)
|
63
|
+
request_stripe_object(
|
64
|
+
method: :post,
|
65
|
+
path: format("/v1/test_helpers/treasury/outbound_transfers/%<outbound_transfer>s/return", { outbound_transfer: CGI.escape(outbound_transfer) }),
|
66
|
+
params: params,
|
67
|
+
opts: opts
|
68
|
+
)
|
69
|
+
end
|
70
|
+
|
71
|
+
def fail(params = {}, opts = {})
|
72
|
+
@resource.request_stripe_object(
|
73
|
+
method: :post,
|
74
|
+
path: format("/v1/test_helpers/treasury/outbound_transfers/%<outbound_transfer>s/fail", { outbound_transfer: CGI.escape(@resource["id"]) }),
|
75
|
+
params: params,
|
76
|
+
opts: opts
|
77
|
+
)
|
78
|
+
end
|
79
|
+
|
80
|
+
def post(params = {}, opts = {})
|
81
|
+
@resource.request_stripe_object(
|
82
|
+
method: :post,
|
83
|
+
path: format("/v1/test_helpers/treasury/outbound_transfers/%<outbound_transfer>s/post", { outbound_transfer: CGI.escape(@resource["id"]) }),
|
84
|
+
params: params,
|
85
|
+
opts: opts
|
86
|
+
)
|
87
|
+
end
|
88
|
+
|
89
|
+
def return_outbound_transfer(params = {}, opts = {})
|
90
|
+
@resource.request_stripe_object(
|
91
|
+
method: :post,
|
92
|
+
path: format("/v1/test_helpers/treasury/outbound_transfers/%<outbound_transfer>s/return", { outbound_transfer: CGI.escape(@resource["id"]) }),
|
93
|
+
params: params,
|
94
|
+
opts: opts
|
95
|
+
)
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Treasury
|
6
|
+
# ReceivedCredits represent funds sent to a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount.
|
7
|
+
class ReceivedCredit < APIResource
|
8
|
+
extend Stripe::APIOperations::List
|
9
|
+
|
10
|
+
OBJECT_NAME = "treasury.received_credit"
|
11
|
+
|
12
|
+
def test_helpers
|
13
|
+
TestHelpers.new(self)
|
14
|
+
end
|
15
|
+
|
16
|
+
class TestHelpers < APIResourceTestHelpers
|
17
|
+
RESOURCE_CLASS = ReceivedCredit
|
18
|
+
|
19
|
+
def self.create(params = {}, opts = {})
|
20
|
+
request_stripe_object(
|
21
|
+
method: :post,
|
22
|
+
path: "/v1/test_helpers/treasury/received_credits",
|
23
|
+
params: params,
|
24
|
+
opts: opts
|
25
|
+
)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Treasury
|
6
|
+
# ReceivedDebits represent funds pulled from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts). These are not initiated from the FinancialAccount.
|
7
|
+
class ReceivedDebit < APIResource
|
8
|
+
extend Stripe::APIOperations::List
|
9
|
+
|
10
|
+
OBJECT_NAME = "treasury.received_debit"
|
11
|
+
|
12
|
+
def test_helpers
|
13
|
+
TestHelpers.new(self)
|
14
|
+
end
|
15
|
+
|
16
|
+
class TestHelpers < APIResourceTestHelpers
|
17
|
+
RESOURCE_CLASS = ReceivedDebit
|
18
|
+
|
19
|
+
def self.create(params = {}, opts = {})
|
20
|
+
request_stripe_object(
|
21
|
+
method: :post,
|
22
|
+
path: "/v1/test_helpers/treasury/received_debits",
|
23
|
+
params: params,
|
24
|
+
opts: opts
|
25
|
+
)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Treasury
|
6
|
+
# Transactions represent changes to a [FinancialAccount's](https://stripe.com/docs/api#financial_accounts) balance.
|
7
|
+
class Transaction < APIResource
|
8
|
+
extend Stripe::APIOperations::List
|
9
|
+
|
10
|
+
OBJECT_NAME = "treasury.transaction"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Treasury
|
6
|
+
# TransactionEntries represent individual units of money movements within a single [Transaction](https://stripe.com/docs/api#transactions).
|
7
|
+
class TransactionEntry < APIResource
|
8
|
+
extend Stripe::APIOperations::List
|
9
|
+
|
10
|
+
OBJECT_NAME = "treasury.transaction_entry"
|
11
|
+
|
12
|
+
def self.resource_url
|
13
|
+
"/v1/treasury/transaction_entries"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -1,6 +1,11 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
1
2
|
# frozen_string_literal: true
|
2
3
|
|
3
4
|
module Stripe
|
5
|
+
# Usage records allow you to report customer usage and metrics to Stripe for
|
6
|
+
# metered billing of subscription prices.
|
7
|
+
#
|
8
|
+
# Related guide: [Metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing)
|
4
9
|
class UsageRecord < APIResource
|
5
10
|
OBJECT_NAME = "usage_record"
|
6
11
|
end
|
@@ -2,6 +2,13 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# You can configure [webhook endpoints](https://stripe.com/docs/webhooks/) via the API to be
|
6
|
+
# notified about events that happen in your Stripe account or connected
|
7
|
+
# accounts.
|
8
|
+
#
|
9
|
+
# Most users configure webhooks from [the dashboard](https://dashboard.stripe.com/webhooks), which provides a user interface for registering and testing your webhook endpoints.
|
10
|
+
#
|
11
|
+
# Related guide: [Setting up webhooks](https://stripe.com/docs/webhooks/configure)
|
5
12
|
class WebhookEndpoint < APIResource
|
6
13
|
extend Stripe::APIOperations::Create
|
7
14
|
include Stripe::APIOperations::Delete
|
data/lib/stripe/resources.rb
CHANGED
@@ -1,19 +1,20 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
1
2
|
# frozen_string_literal: true
|
2
3
|
|
3
4
|
require "stripe/resources/account"
|
4
5
|
require "stripe/resources/account_link"
|
5
|
-
require "stripe/resources/alipay_account"
|
6
6
|
require "stripe/resources/apple_pay_domain"
|
7
7
|
require "stripe/resources/application_fee"
|
8
8
|
require "stripe/resources/application_fee_refund"
|
9
|
+
require "stripe/resources/apps/secret"
|
9
10
|
require "stripe/resources/balance"
|
10
11
|
require "stripe/resources/balance_transaction"
|
11
12
|
require "stripe/resources/bank_account"
|
13
|
+
require "stripe/resources/billing_portal/configuration"
|
12
14
|
require "stripe/resources/billing_portal/session"
|
13
|
-
require "stripe/resources/bitcoin_receiver"
|
14
|
-
require "stripe/resources/bitcoin_transaction"
|
15
15
|
require "stripe/resources/capability"
|
16
16
|
require "stripe/resources/card"
|
17
|
+
require "stripe/resources/cash_balance"
|
17
18
|
require "stripe/resources/charge"
|
18
19
|
require "stripe/resources/checkout/session"
|
19
20
|
require "stripe/resources/country_spec"
|
@@ -22,6 +23,7 @@ require "stripe/resources/credit_note"
|
|
22
23
|
require "stripe/resources/credit_note_line_item"
|
23
24
|
require "stripe/resources/customer"
|
24
25
|
require "stripe/resources/customer_balance_transaction"
|
26
|
+
require "stripe/resources/customer_cash_balance_transaction"
|
25
27
|
require "stripe/resources/discount"
|
26
28
|
require "stripe/resources/dispute"
|
27
29
|
require "stripe/resources/ephemeral_key"
|
@@ -29,21 +31,26 @@ require "stripe/resources/event"
|
|
29
31
|
require "stripe/resources/exchange_rate"
|
30
32
|
require "stripe/resources/file"
|
31
33
|
require "stripe/resources/file_link"
|
34
|
+
require "stripe/resources/financial_connections/account"
|
35
|
+
require "stripe/resources/financial_connections/account_owner"
|
36
|
+
require "stripe/resources/financial_connections/account_ownership"
|
37
|
+
require "stripe/resources/financial_connections/session"
|
38
|
+
require "stripe/resources/funding_instructions"
|
39
|
+
require "stripe/resources/identity/verification_report"
|
40
|
+
require "stripe/resources/identity/verification_session"
|
32
41
|
require "stripe/resources/invoice"
|
33
42
|
require "stripe/resources/invoice_item"
|
34
43
|
require "stripe/resources/invoice_line_item"
|
35
44
|
require "stripe/resources/issuing/authorization"
|
36
45
|
require "stripe/resources/issuing/card"
|
37
|
-
require "stripe/resources/issuing/card_details"
|
38
46
|
require "stripe/resources/issuing/cardholder"
|
39
47
|
require "stripe/resources/issuing/dispute"
|
40
48
|
require "stripe/resources/issuing/transaction"
|
41
49
|
require "stripe/resources/line_item"
|
42
50
|
require "stripe/resources/login_link"
|
43
51
|
require "stripe/resources/mandate"
|
44
|
-
require "stripe/resources/order"
|
45
|
-
require "stripe/resources/order_return"
|
46
52
|
require "stripe/resources/payment_intent"
|
53
|
+
require "stripe/resources/payment_link"
|
47
54
|
require "stripe/resources/payment_method"
|
48
55
|
require "stripe/resources/payout"
|
49
56
|
require "stripe/resources/person"
|
@@ -51,11 +58,10 @@ require "stripe/resources/plan"
|
|
51
58
|
require "stripe/resources/price"
|
52
59
|
require "stripe/resources/product"
|
53
60
|
require "stripe/resources/promotion_code"
|
61
|
+
require "stripe/resources/quote"
|
54
62
|
require "stripe/resources/radar/early_fraud_warning"
|
55
63
|
require "stripe/resources/radar/value_list"
|
56
64
|
require "stripe/resources/radar/value_list_item"
|
57
|
-
require "stripe/resources/recipient"
|
58
|
-
require "stripe/resources/recipient_transfer"
|
59
65
|
require "stripe/resources/refund"
|
60
66
|
require "stripe/resources/reporting/report_run"
|
61
67
|
require "stripe/resources/reporting/report_type"
|
@@ -63,22 +69,40 @@ require "stripe/resources/reversal"
|
|
63
69
|
require "stripe/resources/review"
|
64
70
|
require "stripe/resources/setup_attempt"
|
65
71
|
require "stripe/resources/setup_intent"
|
72
|
+
require "stripe/resources/shipping_rate"
|
66
73
|
require "stripe/resources/sigma/scheduled_query_run"
|
67
|
-
require "stripe/resources/sku"
|
68
74
|
require "stripe/resources/source"
|
69
75
|
require "stripe/resources/source_transaction"
|
70
76
|
require "stripe/resources/subscription"
|
71
77
|
require "stripe/resources/subscription_item"
|
72
78
|
require "stripe/resources/subscription_schedule"
|
79
|
+
require "stripe/resources/tax/calculation"
|
80
|
+
require "stripe/resources/tax/calculation_line_item"
|
81
|
+
require "stripe/resources/tax/settings"
|
82
|
+
require "stripe/resources/tax/transaction"
|
83
|
+
require "stripe/resources/tax/transaction_line_item"
|
84
|
+
require "stripe/resources/tax_code"
|
73
85
|
require "stripe/resources/tax_id"
|
74
86
|
require "stripe/resources/tax_rate"
|
87
|
+
require "stripe/resources/terminal/configuration"
|
75
88
|
require "stripe/resources/terminal/connection_token"
|
76
89
|
require "stripe/resources/terminal/location"
|
77
90
|
require "stripe/resources/terminal/reader"
|
78
|
-
require "stripe/resources/
|
91
|
+
require "stripe/resources/test_helpers/test_clock"
|
79
92
|
require "stripe/resources/token"
|
80
93
|
require "stripe/resources/topup"
|
81
94
|
require "stripe/resources/transfer"
|
95
|
+
require "stripe/resources/treasury/credit_reversal"
|
96
|
+
require "stripe/resources/treasury/debit_reversal"
|
97
|
+
require "stripe/resources/treasury/financial_account"
|
98
|
+
require "stripe/resources/treasury/financial_account_features"
|
99
|
+
require "stripe/resources/treasury/inbound_transfer"
|
100
|
+
require "stripe/resources/treasury/outbound_payment"
|
101
|
+
require "stripe/resources/treasury/outbound_transfer"
|
102
|
+
require "stripe/resources/treasury/received_credit"
|
103
|
+
require "stripe/resources/treasury/received_debit"
|
104
|
+
require "stripe/resources/treasury/transaction"
|
105
|
+
require "stripe/resources/treasury/transaction_entry"
|
82
106
|
require "stripe/resources/usage_record"
|
83
107
|
require "stripe/resources/usage_record_summary"
|
84
108
|
require "stripe/resources/webhook_endpoint"
|