stripe 5.41.0 → 9.0.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 +256 -0
- data/Gemfile +5 -2
- data/Makefile +13 -0
- data/OPENAPI_VERSION +1 -0
- data/README.md +40 -6
- 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 +10 -0
- data/lib/stripe/api_operations/save.rb +13 -3
- data/lib/stripe/api_operations/search.rb +16 -0
- data/lib/stripe/api_resource.rb +3 -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 +22 -1
- data/lib/stripe/instrumentation.rb +45 -7
- data/lib/stripe/object_types.rb +29 -10
- data/lib/stripe/resources/account.rb +36 -9
- data/lib/stripe/resources/account_link.rb +4 -0
- data/lib/stripe/resources/application_fee_refund.rb +5 -0
- 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 +1 -0
- data/lib/stripe/resources/billing_portal/session.rb +14 -0
- data/lib/stripe/resources/capability.rb +3 -0
- 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 +41 -5
- 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 +1 -0
- data/lib/stripe/resources/customer.rb +124 -12
- data/lib/stripe/resources/customer_balance_transaction.rb +6 -0
- data/lib/stripe/resources/customer_cash_balance_transaction.rb +14 -0
- data/lib/stripe/resources/discount.rb +4 -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 +7 -0
- 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 +11 -0
- data/lib/stripe/resources/identity/verification_session.rb +31 -5
- data/lib/stripe/resources/invoice.rb +105 -17
- data/lib/stripe/resources/invoice_item.rb +11 -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 +1 -0
- data/lib/stripe/resources/login_link.rb +1 -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 +6 -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 +58 -35
- 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 +13 -0
- 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 +2 -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 +4 -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 +1 -0
- data/lib/stripe/resources/tax_id.rb +4 -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 +4 -0
- data/lib/stripe/resources/webhook_endpoint.rb +7 -0
- data/lib/stripe/resources.rb +27 -10
- data/lib/stripe/search_result_object.rb +86 -0
- data/lib/stripe/stripe_client.rb +37 -22
- data/lib/stripe/stripe_configuration.rb +5 -1
- data/lib/stripe/stripe_object.rb +2 -2
- data/lib/stripe/util.rb +85 -2
- data/lib/stripe/version.rb +1 -1
- data/lib/stripe.rb +5 -1
- data/stripe.gemspec +3 -3
- metadata +39 -14
- data/lib/stripe/resources/bitcoin_receiver.rb +0 -24
- data/lib/stripe/resources/bitcoin_transaction.rb +0 -16
- data/lib/stripe/resources/issuing/card_details.rb +0 -10
- 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
@@ -3,6 +3,9 @@
|
|
3
3
|
|
4
4
|
module Stripe
|
5
5
|
module Issuing
|
6
|
+
# As a [card issuer](https://stripe.com/docs/issuing), you can dispute transactions that the cardholder does not recognize, suspects to be fraudulent, or has other issues with.
|
7
|
+
#
|
8
|
+
# Related guide: [Issuing disputes](https://stripe.com/docs/issuing/purchases/disputes)
|
6
9
|
class Dispute < APIResource
|
7
10
|
extend Stripe::APIOperations::Create
|
8
11
|
extend Stripe::APIOperations::List
|
@@ -10,12 +13,19 @@ module Stripe
|
|
10
13
|
|
11
14
|
OBJECT_NAME = "issuing.dispute"
|
12
15
|
|
13
|
-
custom_method :submit, http_verb: :post
|
14
|
-
|
15
16
|
def submit(params = {}, opts = {})
|
16
17
|
request_stripe_object(
|
17
18
|
method: :post,
|
18
|
-
path:
|
19
|
+
path: format("/v1/issuing/disputes/%<dispute>s/submit", { dispute: CGI.escape(self["id"]) }),
|
20
|
+
params: params,
|
21
|
+
opts: opts
|
22
|
+
)
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.submit(dispute, params = {}, opts = {})
|
26
|
+
request_stripe_object(
|
27
|
+
method: :post,
|
28
|
+
path: format("/v1/issuing/disputes/%<dispute>s/submit", { dispute: CGI.escape(dispute) }),
|
19
29
|
params: params,
|
20
30
|
opts: opts
|
21
31
|
)
|
@@ -3,6 +3,11 @@
|
|
3
3
|
|
4
4
|
module Stripe
|
5
5
|
module Issuing
|
6
|
+
# Any use of an [issued card](https://stripe.com/docs/issuing) that results in funds entering or leaving
|
7
|
+
# your Stripe account, such as a completed purchase or refund, is represented by an Issuing
|
8
|
+
# `Transaction` object.
|
9
|
+
#
|
10
|
+
# Related guide: [Issued card transactions](https://stripe.com/docs/issuing/purchases/transactions)
|
6
11
|
class Transaction < APIResource
|
7
12
|
extend Stripe::APIOperations::List
|
8
13
|
include Stripe::APIOperations::Save
|
@@ -2,21 +2,38 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# A PaymentIntent guides you through the process of collecting a payment from your customer.
|
6
|
+
# We recommend that you create exactly one PaymentIntent for each order or
|
7
|
+
# customer session in your system. You can reference the PaymentIntent later to
|
8
|
+
# see the history of payment attempts for a particular session.
|
9
|
+
#
|
10
|
+
# A PaymentIntent transitions through
|
11
|
+
# [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses)
|
12
|
+
# throughout its lifetime as it interfaces with Stripe.js to perform
|
13
|
+
# authentication flows and ultimately creates at most one successful charge.
|
14
|
+
#
|
15
|
+
# Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents)
|
5
16
|
class PaymentIntent < APIResource
|
6
17
|
extend Stripe::APIOperations::Create
|
7
18
|
extend Stripe::APIOperations::List
|
19
|
+
extend Stripe::APIOperations::Search
|
8
20
|
include Stripe::APIOperations::Save
|
9
21
|
|
10
22
|
OBJECT_NAME = "payment_intent"
|
11
23
|
|
12
|
-
|
13
|
-
|
14
|
-
|
24
|
+
def apply_customer_balance(params = {}, opts = {})
|
25
|
+
request_stripe_object(
|
26
|
+
method: :post,
|
27
|
+
path: format("/v1/payment_intents/%<intent>s/apply_customer_balance", { intent: CGI.escape(self["id"]) }),
|
28
|
+
params: params,
|
29
|
+
opts: opts
|
30
|
+
)
|
31
|
+
end
|
15
32
|
|
16
33
|
def cancel(params = {}, opts = {})
|
17
34
|
request_stripe_object(
|
18
35
|
method: :post,
|
19
|
-
path:
|
36
|
+
path: format("/v1/payment_intents/%<intent>s/cancel", { intent: CGI.escape(self["id"]) }),
|
20
37
|
params: params,
|
21
38
|
opts: opts
|
22
39
|
)
|
@@ -25,7 +42,7 @@ module Stripe
|
|
25
42
|
def capture(params = {}, opts = {})
|
26
43
|
request_stripe_object(
|
27
44
|
method: :post,
|
28
|
-
path:
|
45
|
+
path: format("/v1/payment_intents/%<intent>s/capture", { intent: CGI.escape(self["id"]) }),
|
29
46
|
params: params,
|
30
47
|
opts: opts
|
31
48
|
)
|
@@ -34,10 +51,90 @@ module Stripe
|
|
34
51
|
def confirm(params = {}, opts = {})
|
35
52
|
request_stripe_object(
|
36
53
|
method: :post,
|
37
|
-
path:
|
54
|
+
path: format("/v1/payment_intents/%<intent>s/confirm", { intent: CGI.escape(self["id"]) }),
|
55
|
+
params: params,
|
56
|
+
opts: opts
|
57
|
+
)
|
58
|
+
end
|
59
|
+
|
60
|
+
def increment_authorization(params = {}, opts = {})
|
61
|
+
request_stripe_object(
|
62
|
+
method: :post,
|
63
|
+
path: format("/v1/payment_intents/%<intent>s/increment_authorization", { intent: CGI.escape(self["id"]) }),
|
64
|
+
params: params,
|
65
|
+
opts: opts
|
66
|
+
)
|
67
|
+
end
|
68
|
+
|
69
|
+
def verify_microdeposits(params = {}, opts = {})
|
70
|
+
request_stripe_object(
|
71
|
+
method: :post,
|
72
|
+
path: format("/v1/payment_intents/%<intent>s/verify_microdeposits", { intent: CGI.escape(self["id"]) }),
|
73
|
+
params: params,
|
74
|
+
opts: opts
|
75
|
+
)
|
76
|
+
end
|
77
|
+
|
78
|
+
def self.apply_customer_balance(intent, params = {}, opts = {})
|
79
|
+
request_stripe_object(
|
80
|
+
method: :post,
|
81
|
+
path: format("/v1/payment_intents/%<intent>s/apply_customer_balance", { intent: CGI.escape(intent) }),
|
82
|
+
params: params,
|
83
|
+
opts: opts
|
84
|
+
)
|
85
|
+
end
|
86
|
+
|
87
|
+
def self.cancel(intent, params = {}, opts = {})
|
88
|
+
request_stripe_object(
|
89
|
+
method: :post,
|
90
|
+
path: format("/v1/payment_intents/%<intent>s/cancel", { intent: CGI.escape(intent) }),
|
38
91
|
params: params,
|
39
92
|
opts: opts
|
40
93
|
)
|
41
94
|
end
|
95
|
+
|
96
|
+
def self.capture(intent, params = {}, opts = {})
|
97
|
+
request_stripe_object(
|
98
|
+
method: :post,
|
99
|
+
path: format("/v1/payment_intents/%<intent>s/capture", { intent: CGI.escape(intent) }),
|
100
|
+
params: params,
|
101
|
+
opts: opts
|
102
|
+
)
|
103
|
+
end
|
104
|
+
|
105
|
+
def self.confirm(intent, params = {}, opts = {})
|
106
|
+
request_stripe_object(
|
107
|
+
method: :post,
|
108
|
+
path: format("/v1/payment_intents/%<intent>s/confirm", { intent: CGI.escape(intent) }),
|
109
|
+
params: params,
|
110
|
+
opts: opts
|
111
|
+
)
|
112
|
+
end
|
113
|
+
|
114
|
+
def self.increment_authorization(intent, params = {}, opts = {})
|
115
|
+
request_stripe_object(
|
116
|
+
method: :post,
|
117
|
+
path: format("/v1/payment_intents/%<intent>s/increment_authorization", { intent: CGI.escape(intent) }),
|
118
|
+
params: params,
|
119
|
+
opts: opts
|
120
|
+
)
|
121
|
+
end
|
122
|
+
|
123
|
+
def self.verify_microdeposits(intent, params = {}, opts = {})
|
124
|
+
request_stripe_object(
|
125
|
+
method: :post,
|
126
|
+
path: format("/v1/payment_intents/%<intent>s/verify_microdeposits", { intent: CGI.escape(intent) }),
|
127
|
+
params: params,
|
128
|
+
opts: opts
|
129
|
+
)
|
130
|
+
end
|
131
|
+
|
132
|
+
def self.search(params = {}, opts = {})
|
133
|
+
_search("/v1/payment_intents/search", params, opts)
|
134
|
+
end
|
135
|
+
|
136
|
+
def self.search_auto_paging_each(params = {}, opts = {}, &blk)
|
137
|
+
search(params, opts).auto_paging_each(&blk)
|
138
|
+
end
|
42
139
|
end
|
43
140
|
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
# A payment link is a shareable URL that will take your customers to a hosted payment page. A payment link can be shared and used multiple times.
|
6
|
+
#
|
7
|
+
# When a customer opens a payment link it will open a new [checkout session](https://stripe.com/docs/api/checkout/sessions) to render the payment page. You can use [checkout session events](https://stripe.com/docs/api/events/types#event_types-checkout.session.completed) to track payments through payment links.
|
8
|
+
#
|
9
|
+
# Related guide: [Payment Links API](https://stripe.com/docs/payment-links)
|
10
|
+
class PaymentLink < APIResource
|
11
|
+
extend Stripe::APIOperations::Create
|
12
|
+
extend Stripe::APIOperations::List
|
13
|
+
include Stripe::APIOperations::Save
|
14
|
+
|
15
|
+
OBJECT_NAME = "payment_link"
|
16
|
+
|
17
|
+
def list_line_items(params = {}, opts = {})
|
18
|
+
request_stripe_object(
|
19
|
+
method: :get,
|
20
|
+
path: format("/v1/payment_links/%<payment_link>s/line_items", { payment_link: CGI.escape(self["id"]) }),
|
21
|
+
params: params,
|
22
|
+
opts: opts
|
23
|
+
)
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.list_line_items(payment_link, params = {}, opts = {})
|
27
|
+
request_stripe_object(
|
28
|
+
method: :get,
|
29
|
+
path: format("/v1/payment_links/%<payment_link>s/line_items", { payment_link: CGI.escape(payment_link) }),
|
30
|
+
params: params,
|
31
|
+
opts: opts
|
32
|
+
)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -2,6 +2,11 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# PaymentMethod objects represent your customer's payment instruments.
|
6
|
+
# You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to
|
7
|
+
# Customer objects to store instrument details for future payments.
|
8
|
+
#
|
9
|
+
# Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios).
|
5
10
|
class PaymentMethod < APIResource
|
6
11
|
extend Stripe::APIOperations::Create
|
7
12
|
extend Stripe::APIOperations::List
|
@@ -9,13 +14,10 @@ module Stripe
|
|
9
14
|
|
10
15
|
OBJECT_NAME = "payment_method"
|
11
16
|
|
12
|
-
custom_method :attach, http_verb: :post
|
13
|
-
custom_method :detach, http_verb: :post
|
14
|
-
|
15
17
|
def attach(params = {}, opts = {})
|
16
18
|
request_stripe_object(
|
17
19
|
method: :post,
|
18
|
-
path:
|
20
|
+
path: format("/v1/payment_methods/%<payment_method>s/attach", { payment_method: CGI.escape(self["id"]) }),
|
19
21
|
params: params,
|
20
22
|
opts: opts
|
21
23
|
)
|
@@ -24,7 +26,25 @@ module Stripe
|
|
24
26
|
def detach(params = {}, opts = {})
|
25
27
|
request_stripe_object(
|
26
28
|
method: :post,
|
27
|
-
path:
|
29
|
+
path: format("/v1/payment_methods/%<payment_method>s/detach", { payment_method: CGI.escape(self["id"]) }),
|
30
|
+
params: params,
|
31
|
+
opts: opts
|
32
|
+
)
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.attach(payment_method, params = {}, opts = {})
|
36
|
+
request_stripe_object(
|
37
|
+
method: :post,
|
38
|
+
path: format("/v1/payment_methods/%<payment_method>s/attach", { payment_method: CGI.escape(payment_method) }),
|
39
|
+
params: params,
|
40
|
+
opts: opts
|
41
|
+
)
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.detach(payment_method, params = {}, opts = {})
|
45
|
+
request_stripe_object(
|
46
|
+
method: :post,
|
47
|
+
path: format("/v1/payment_methods/%<payment_method>s/detach", { payment_method: CGI.escape(payment_method) }),
|
28
48
|
params: params,
|
29
49
|
opts: opts
|
30
50
|
)
|
@@ -2,6 +2,14 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# A `Payout` object is created when you receive funds from Stripe, or when you
|
6
|
+
# initiate a payout to either a bank account or debit card of a [connected
|
7
|
+
# Stripe account](https://stripe.com/docs/connect/bank-debit-card-payouts). You can retrieve individual payouts,
|
8
|
+
# as well as list all payouts. Payouts are made on [varying
|
9
|
+
# schedules](https://stripe.com/docs/connect/manage-payout-schedule), depending on your country and
|
10
|
+
# industry.
|
11
|
+
#
|
12
|
+
# Related guide: [Receiving payouts](https://stripe.com/docs/payouts)
|
5
13
|
class Payout < APIResource
|
6
14
|
extend Stripe::APIOperations::Create
|
7
15
|
extend Stripe::APIOperations::List
|
@@ -9,13 +17,10 @@ module Stripe
|
|
9
17
|
|
10
18
|
OBJECT_NAME = "payout"
|
11
19
|
|
12
|
-
custom_method :cancel, http_verb: :post
|
13
|
-
custom_method :reverse, http_verb: :post
|
14
|
-
|
15
20
|
def cancel(params = {}, opts = {})
|
16
21
|
request_stripe_object(
|
17
22
|
method: :post,
|
18
|
-
path:
|
23
|
+
path: format("/v1/payouts/%<payout>s/cancel", { payout: CGI.escape(self["id"]) }),
|
19
24
|
params: params,
|
20
25
|
opts: opts
|
21
26
|
)
|
@@ -24,7 +29,25 @@ module Stripe
|
|
24
29
|
def reverse(params = {}, opts = {})
|
25
30
|
request_stripe_object(
|
26
31
|
method: :post,
|
27
|
-
path:
|
32
|
+
path: format("/v1/payouts/%<payout>s/reverse", { payout: CGI.escape(self["id"]) }),
|
33
|
+
params: params,
|
34
|
+
opts: opts
|
35
|
+
)
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.cancel(payout, params = {}, opts = {})
|
39
|
+
request_stripe_object(
|
40
|
+
method: :post,
|
41
|
+
path: format("/v1/payouts/%<payout>s/cancel", { payout: CGI.escape(payout) }),
|
42
|
+
params: params,
|
43
|
+
opts: opts
|
44
|
+
)
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.reverse(payout, params = {}, opts = {})
|
48
|
+
request_stripe_object(
|
49
|
+
method: :post,
|
50
|
+
path: format("/v1/payouts/%<payout>s/reverse", { payout: CGI.escape(payout) }),
|
28
51
|
params: params,
|
29
52
|
opts: opts
|
30
53
|
)
|
@@ -2,6 +2,12 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# This is an object representing a person associated with a Stripe account.
|
6
|
+
#
|
7
|
+
# A platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account.
|
8
|
+
# See the [Standard onboarding](https://stripe.com/docs/connect/standard-accounts) or [Express onboarding documentation](https://stripe.com/docs/connect/express-accounts) for information about platform prefilling and account onboarding steps.
|
9
|
+
#
|
10
|
+
# Related guide: [Handling identity verification with the API](https://stripe.com/docs/connect/identity-verification-api#person-information)
|
5
11
|
class Person < APIResource
|
6
12
|
extend Stripe::APIOperations::List
|
7
13
|
include Stripe::APIOperations::Save
|
@@ -2,6 +2,14 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration.
|
6
|
+
#
|
7
|
+
# Plans define the base price, currency, and billing cycle for recurring purchases of products.
|
8
|
+
# [Products](https://stripe.com/docs/api#products) help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme.
|
9
|
+
#
|
10
|
+
# For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year.
|
11
|
+
#
|
12
|
+
# Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription) and more about [products and prices](https://stripe.com/docs/products-prices/overview).
|
5
13
|
class Plan < APIResource
|
6
14
|
extend Stripe::APIOperations::Create
|
7
15
|
include Stripe::APIOperations::Delete
|
@@ -2,11 +2,26 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products.
|
6
|
+
# [Products](https://stripe.com/docs/api#products) help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme.
|
7
|
+
#
|
8
|
+
# For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once.
|
9
|
+
#
|
10
|
+
# Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription), [create an invoice](https://stripe.com/docs/billing/invoices/create), and more about [products and prices](https://stripe.com/docs/products-prices/overview).
|
5
11
|
class Price < APIResource
|
6
12
|
extend Stripe::APIOperations::Create
|
7
13
|
extend Stripe::APIOperations::List
|
14
|
+
extend Stripe::APIOperations::Search
|
8
15
|
include Stripe::APIOperations::Save
|
9
16
|
|
10
17
|
OBJECT_NAME = "price"
|
18
|
+
|
19
|
+
def self.search(params = {}, opts = {})
|
20
|
+
_search("/v1/prices/search", params, opts)
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.search_auto_paging_each(params = {}, opts = {}, &blk)
|
24
|
+
search(params, opts).auto_paging_each(&blk)
|
25
|
+
end
|
11
26
|
end
|
12
27
|
end
|
@@ -2,12 +2,29 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# Products describe the specific goods or services you offer to your customers.
|
6
|
+
# For example, you might offer a Standard and Premium version of your goods or service; each version would be a separate Product.
|
7
|
+
# They can be used in conjunction with [Prices](https://stripe.com/docs/api#prices) to configure pricing in Payment Links, Checkout, and Subscriptions.
|
8
|
+
#
|
9
|
+
# Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription),
|
10
|
+
# [share a Payment Link](https://stripe.com/docs/payment-links),
|
11
|
+
# [accept payments with Checkout](https://stripe.com/docs/payments/accept-a-payment#create-product-prices-upfront),
|
12
|
+
# and more about [Products and Prices](https://stripe.com/docs/products-prices/overview)
|
5
13
|
class Product < APIResource
|
6
14
|
extend Stripe::APIOperations::Create
|
7
15
|
include Stripe::APIOperations::Delete
|
8
16
|
extend Stripe::APIOperations::List
|
17
|
+
extend Stripe::APIOperations::Search
|
9
18
|
include Stripe::APIOperations::Save
|
10
19
|
|
11
20
|
OBJECT_NAME = "product"
|
21
|
+
|
22
|
+
def self.search(params = {}, opts = {})
|
23
|
+
_search("/v1/products/search", params, opts)
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.search_auto_paging_each(params = {}, opts = {}, &blk)
|
27
|
+
search(params, opts).auto_paging_each(&blk)
|
28
|
+
end
|
12
29
|
end
|
13
30
|
end
|
@@ -2,6 +2,8 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# A Promotion Code represents a customer-redeemable code for a [coupon](https://stripe.com/docs/api#coupons). It can be used to
|
6
|
+
# create multiple codes for a single coupon.
|
5
7
|
class PromotionCode < APIResource
|
6
8
|
extend Stripe::APIOperations::Create
|
7
9
|
extend Stripe::APIOperations::List
|
@@ -2,6 +2,8 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# A Quote is a way to model prices that you'd like to provide to a customer.
|
6
|
+
# Once accepted, it will automatically create an invoice, subscription or subscription schedule.
|
5
7
|
class Quote < APIResource
|
6
8
|
extend Stripe::APIOperations::Create
|
7
9
|
extend Stripe::APIOperations::List
|
@@ -9,16 +11,10 @@ module Stripe
|
|
9
11
|
|
10
12
|
OBJECT_NAME = "quote"
|
11
13
|
|
12
|
-
custom_method :accept, http_verb: :post
|
13
|
-
custom_method :cancel, http_verb: :post
|
14
|
-
custom_method :finalize_quote, http_verb: :post, http_path: "finalize"
|
15
|
-
custom_method :list_computed_upfront_line_items, http_verb: :get, http_path: "computed_upfront_line_items"
|
16
|
-
custom_method :list_line_items, http_verb: :get, http_path: "line_items"
|
17
|
-
|
18
14
|
def accept(params = {}, opts = {})
|
19
15
|
request_stripe_object(
|
20
16
|
method: :post,
|
21
|
-
path:
|
17
|
+
path: format("/v1/quotes/%<quote>s/accept", { quote: CGI.escape(self["id"]) }),
|
22
18
|
params: params,
|
23
19
|
opts: opts
|
24
20
|
)
|
@@ -27,7 +23,7 @@ module Stripe
|
|
27
23
|
def cancel(params = {}, opts = {})
|
28
24
|
request_stripe_object(
|
29
25
|
method: :post,
|
30
|
-
path:
|
26
|
+
path: format("/v1/quotes/%<quote>s/cancel", { quote: CGI.escape(self["id"]) }),
|
31
27
|
params: params,
|
32
28
|
opts: opts
|
33
29
|
)
|
@@ -36,7 +32,7 @@ module Stripe
|
|
36
32
|
def finalize_quote(params = {}, opts = {})
|
37
33
|
request_stripe_object(
|
38
34
|
method: :post,
|
39
|
-
path:
|
35
|
+
path: format("/v1/quotes/%<quote>s/finalize", { quote: CGI.escape(self["id"]) }),
|
40
36
|
params: params,
|
41
37
|
opts: opts
|
42
38
|
)
|
@@ -45,7 +41,7 @@ module Stripe
|
|
45
41
|
def list_computed_upfront_line_items(params = {}, opts = {})
|
46
42
|
request_stripe_object(
|
47
43
|
method: :get,
|
48
|
-
path:
|
44
|
+
path: format("/v1/quotes/%<quote>s/computed_upfront_line_items", { quote: CGI.escape(self["id"]) }),
|
49
45
|
params: params,
|
50
46
|
opts: opts
|
51
47
|
)
|
@@ -54,52 +50,79 @@ module Stripe
|
|
54
50
|
def list_line_items(params = {}, opts = {})
|
55
51
|
request_stripe_object(
|
56
52
|
method: :get,
|
57
|
-
path:
|
53
|
+
path: format("/v1/quotes/%<quote>s/line_items", { quote: CGI.escape(self["id"]) }),
|
58
54
|
params: params,
|
59
55
|
opts: opts
|
60
56
|
)
|
61
57
|
end
|
62
58
|
|
63
59
|
def pdf(params = {}, opts = {}, &read_body_chunk_block)
|
64
|
-
unless block_given?
|
65
|
-
raise ArgumentError, "A read_body_chunk_block block parameter is required when calling the pdf method."
|
66
|
-
end
|
67
|
-
|
68
60
|
config = opts[:client]&.config || Stripe.config
|
69
|
-
|
61
|
+
opts = { api_base: config.uploads_base }.merge(opts)
|
70
62
|
request_stream(
|
71
63
|
method: :get,
|
72
|
-
path:
|
64
|
+
path: format("/v1/quotes/%<quote>s/pdf", { quote: CGI.escape(self["id"]) }),
|
73
65
|
params: params,
|
74
|
-
opts:
|
75
|
-
api_base: config.uploads_base,
|
76
|
-
}.merge(opts),
|
66
|
+
opts: opts,
|
77
67
|
&read_body_chunk_block
|
78
68
|
)
|
79
69
|
end
|
80
70
|
|
81
|
-
def self.
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
71
|
+
def self.accept(quote, params = {}, opts = {})
|
72
|
+
request_stripe_object(
|
73
|
+
method: :post,
|
74
|
+
path: format("/v1/quotes/%<quote>s/accept", { quote: CGI.escape(quote) }),
|
75
|
+
params: params,
|
76
|
+
opts: opts
|
77
|
+
)
|
78
|
+
end
|
86
79
|
|
87
|
-
|
88
|
-
|
89
|
-
|
80
|
+
def self.cancel(quote, params = {}, opts = {})
|
81
|
+
request_stripe_object(
|
82
|
+
method: :post,
|
83
|
+
path: format("/v1/quotes/%<quote>s/cancel", { quote: CGI.escape(quote) }),
|
84
|
+
params: params,
|
85
|
+
opts: opts
|
86
|
+
)
|
87
|
+
end
|
90
88
|
|
91
|
-
|
89
|
+
def self.finalize_quote(quote, params = {}, opts = {})
|
90
|
+
request_stripe_object(
|
91
|
+
method: :post,
|
92
|
+
path: format("/v1/quotes/%<quote>s/finalize", { quote: CGI.escape(quote) }),
|
93
|
+
params: params,
|
94
|
+
opts: opts
|
95
|
+
)
|
96
|
+
end
|
97
|
+
|
98
|
+
def self.list_computed_upfront_line_items(quote, params = {}, opts = {})
|
99
|
+
request_stripe_object(
|
100
|
+
method: :get,
|
101
|
+
path: format("/v1/quotes/%<quote>s/computed_upfront_line_items", { quote: CGI.escape(quote) }),
|
102
|
+
params: params,
|
103
|
+
opts: opts
|
104
|
+
)
|
105
|
+
end
|
92
106
|
|
93
|
-
|
107
|
+
def self.list_line_items(quote, params = {}, opts = {})
|
108
|
+
request_stripe_object(
|
109
|
+
method: :get,
|
110
|
+
path: format("/v1/quotes/%<quote>s/line_items", { quote: CGI.escape(quote) }),
|
111
|
+
params: params,
|
112
|
+
opts: opts
|
113
|
+
)
|
114
|
+
end
|
115
|
+
|
116
|
+
def self.pdf(quote, params = {}, opts = {}, &read_body_chunk_block)
|
117
|
+
config = opts[:client]&.config || Stripe.config
|
118
|
+
opts = { api_base: config.uploads_base }.merge(opts)
|
119
|
+
execute_resource_request_stream(
|
94
120
|
:get,
|
95
|
-
"
|
121
|
+
format("/v1/quotes/%<quote>s/pdf", { quote: CGI.escape(quote) }),
|
96
122
|
params,
|
97
|
-
|
98
|
-
api_base: config.uploads_base,
|
99
|
-
}.merge(opts),
|
123
|
+
opts,
|
100
124
|
&read_body_chunk_block
|
101
125
|
)
|
102
|
-
resp
|
103
126
|
end
|
104
127
|
end
|
105
128
|
end
|
@@ -3,6 +3,10 @@
|
|
3
3
|
|
4
4
|
module Stripe
|
5
5
|
module Radar
|
6
|
+
# An early fraud warning indicates that the card issuer has notified us that a
|
7
|
+
# charge may be fraudulent.
|
8
|
+
#
|
9
|
+
# Related guide: [Early fraud warnings](https://stripe.com/docs/disputes/measuring#early-fraud-warnings)
|
6
10
|
class EarlyFraudWarning < APIResource
|
7
11
|
extend Stripe::APIOperations::List
|
8
12
|
|
@@ -3,6 +3,9 @@
|
|
3
3
|
|
4
4
|
module Stripe
|
5
5
|
module Radar
|
6
|
+
# Value lists allow you to group values together which can then be referenced in rules.
|
7
|
+
#
|
8
|
+
# Related guide: [Default Stripe lists](https://stripe.com/docs/radar/lists#managing-list-items)
|
6
9
|
class ValueList < APIResource
|
7
10
|
extend Stripe::APIOperations::Create
|
8
11
|
include Stripe::APIOperations::Delete
|
@@ -3,6 +3,9 @@
|
|
3
3
|
|
4
4
|
module Stripe
|
5
5
|
module Radar
|
6
|
+
# Value list items allow you to add specific values to a given Radar value list, which can then be used in rules.
|
7
|
+
#
|
8
|
+
# Related guide: [Managing list items](https://stripe.com/docs/radar/lists#managing-list-items)
|
6
9
|
class ValueListItem < APIResource
|
7
10
|
extend Stripe::APIOperations::Create
|
8
11
|
include Stripe::APIOperations::Delete
|