stripe 15.1.0.pre.beta.1 → 15.1.0.pre.beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/Gemfile +1 -1
- data/OPENAPI_VERSION +1 -1
- data/VERSION +1 -1
- data/lib/stripe/api_operations/nested_resource.rb +35 -35
- data/lib/stripe/api_requestor.rb +1 -1
- data/lib/stripe/connection_manager.rb +1 -3
- data/lib/stripe/oauth.rb +1 -1
- data/lib/stripe/object_types.rb +2 -0
- data/lib/stripe/resources/account.rb +51 -2
- data/lib/stripe/resources/balance_settings.rb +5 -1
- data/lib/stripe/resources/capital/financing_offer.rb +4 -4
- data/lib/stripe/resources/capital/financing_summary.rb +6 -6
- data/lib/stripe/resources/charge.rb +18 -0
- data/lib/stripe/resources/checkout/session.rb +74 -3
- data/lib/stripe/resources/confirmation_token.rb +6 -1
- data/lib/stripe/resources/coupon.rb +30 -1
- data/lib/stripe/resources/funding_instructions.rb +1 -1
- data/lib/stripe/resources/fx_quote.rb +184 -0
- data/lib/stripe/resources/invoice.rb +0 -52
- data/lib/stripe/resources/payment_intent.rb +87 -3
- data/lib/stripe/resources/payment_intent_amount_details_line_item.rb +65 -0
- data/lib/stripe/resources/payment_method.rb +10 -2
- data/lib/stripe/resources/payment_method_configuration.rb +59 -0
- data/lib/stripe/resources/person.rb +25 -1
- data/lib/stripe/resources/privacy/redaction_job.rb +3 -0
- data/lib/stripe/resources/privacy/redaction_job_validation_error.rb +0 -29
- data/lib/stripe/resources/refund.rb +2 -0
- data/lib/stripe/resources/setup_intent.rb +12 -3
- data/lib/stripe/resources/source.rb +1 -1
- data/lib/stripe/resources/tax/registration.rb +160 -0
- data/lib/stripe/resources/token.rb +61 -0
- data/lib/stripe/resources/transfer.rb +6 -0
- data/lib/stripe/resources/treasury/outbound_payment.rb +4 -1
- data/lib/stripe/resources.rb +2 -0
- data/lib/stripe/services/account_person_service.rb +84 -0
- data/lib/stripe/services/account_service.rb +39 -1
- data/lib/stripe/services/application_fee_service.rb +1 -1
- data/lib/stripe/services/apps_service.rb +1 -1
- data/lib/stripe/services/billing/meter_service.rb +1 -1
- data/lib/stripe/services/billing_portal_service.rb +1 -1
- data/lib/stripe/services/billing_service.rb +1 -1
- data/lib/stripe/services/capital_service.rb +1 -1
- data/lib/stripe/services/charge_service.rb +16 -0
- data/lib/stripe/services/checkout/session_service.rb +75 -4
- data/lib/stripe/services/checkout_service.rb +1 -1
- data/lib/stripe/services/climate_service.rb +1 -1
- data/lib/stripe/services/coupon_service.rb +17 -1
- data/lib/stripe/services/credit_note_service.rb +1 -1
- data/lib/stripe/services/customer_service.rb +1 -1
- data/lib/stripe/services/entitlements_service.rb +1 -1
- data/lib/stripe/services/financial_connections/account_service.rb +1 -1
- data/lib/stripe/services/financial_connections_service.rb +1 -1
- data/lib/stripe/services/forwarding_service.rb +1 -1
- data/lib/stripe/services/fx_quote_service.rb +123 -0
- data/lib/stripe/services/gift_cards_service.rb +1 -1
- data/lib/stripe/services/identity_service.rb +1 -1
- data/lib/stripe/services/invoice_service.rb +2 -37
- data/lib/stripe/services/issuing_service.rb +1 -1
- data/lib/stripe/services/order_service.rb +1 -1
- data/lib/stripe/services/{invoice_payment_service.rb → payment_intent_amount_details_line_item_service.rb} +4 -24
- data/lib/stripe/services/payment_intent_service.rb +63 -3
- data/lib/stripe/services/payment_link_service.rb +1 -1
- data/lib/stripe/services/payment_method_configuration_service.rb +42 -0
- data/lib/stripe/services/payment_method_service.rb +8 -2
- data/lib/stripe/services/privacy/redaction_job_service.rb +1 -1
- data/lib/stripe/services/privacy_service.rb +1 -1
- data/lib/stripe/services/product_service.rb +1 -1
- data/lib/stripe/services/quote_service.rb +1 -1
- data/lib/stripe/services/radar_service.rb +1 -1
- data/lib/stripe/services/reporting_service.rb +1 -1
- data/lib/stripe/services/setup_intent_service.rb +12 -3
- data/lib/stripe/services/sigma_service.rb +1 -1
- data/lib/stripe/services/source_service.rb +1 -1
- data/lib/stripe/services/tax/calculation_service.rb +1 -1
- data/lib/stripe/services/tax/registration_service.rb +104 -0
- data/lib/stripe/services/tax/transaction_service.rb +1 -1
- data/lib/stripe/services/tax_service.rb +1 -1
- data/lib/stripe/services/terminal_service.rb +1 -1
- data/lib/stripe/services/test_helpers/confirmation_token_service.rb +4 -1
- data/lib/stripe/services/test_helpers/issuing_service.rb +1 -1
- data/lib/stripe/services/test_helpers/terminal_service.rb +1 -1
- data/lib/stripe/services/test_helpers/treasury_service.rb +1 -1
- data/lib/stripe/services/test_helpers_service.rb +1 -1
- data/lib/stripe/services/token_service.rb +61 -0
- data/lib/stripe/services/transfer_service.rb +5 -1
- data/lib/stripe/services/treasury/financial_account_service.rb +1 -1
- data/lib/stripe/services/treasury/outbound_payment_service.rb +4 -1
- data/lib/stripe/services/treasury_service.rb +1 -1
- data/lib/stripe/services/v1_services.rb +3 -2
- data/lib/stripe/services/v2/billing_service.rb +1 -1
- data/lib/stripe/services/v2/core/account_service.rb +1 -1
- data/lib/stripe/services/v2/core/vault_service.rb +1 -1
- data/lib/stripe/services/v2/core_service.rb +1 -1
- data/lib/stripe/services/v2/money_management_service.rb +1 -1
- data/lib/stripe/services/v2/test_helper_service.rb +1 -1
- data/lib/stripe/services/v2_services.rb +1 -1
- data/lib/stripe/services.rb +2 -1
- data/lib/stripe/version.rb +1 -1
- data/lib/stripe.rb +0 -2
- data/rbi/stripe.rbi +1675 -239
- metadata +6 -4
- data/lib/stripe/request_signing_authenticator.rb +0 -79
@@ -26,6 +26,15 @@ module Stripe
|
|
26
26
|
attr_reader :amount_off
|
27
27
|
end
|
28
28
|
|
29
|
+
class Script < Stripe::StripeObject
|
30
|
+
# The configuration values of the script. The keys and values are specific to the script implementation.
|
31
|
+
attr_reader :configuration
|
32
|
+
# The name of the script used to calculate the discount.
|
33
|
+
attr_reader :display_name
|
34
|
+
# The script implementation ID for this coupon.
|
35
|
+
attr_reader :id
|
36
|
+
end
|
37
|
+
|
29
38
|
class DeleteParams < Stripe::RequestParams
|
30
39
|
end
|
31
40
|
|
@@ -111,6 +120,18 @@ module Stripe
|
|
111
120
|
@amount_off = amount_off
|
112
121
|
end
|
113
122
|
end
|
123
|
+
|
124
|
+
class Script < Stripe::RequestParams
|
125
|
+
# The configuration values of the script. The keys and values are specific to the script implementation.
|
126
|
+
attr_accessor :configuration
|
127
|
+
# The script implementation ID for this coupon.
|
128
|
+
attr_accessor :id
|
129
|
+
|
130
|
+
def initialize(configuration: nil, id: nil)
|
131
|
+
@configuration = configuration
|
132
|
+
@id = id
|
133
|
+
end
|
134
|
+
end
|
114
135
|
# A positive integer representing the amount to subtract from an invoice total (required if `percent_off` is not passed).
|
115
136
|
attr_accessor :amount_off
|
116
137
|
# A hash containing directions for what this Coupon will apply discounts to.
|
@@ -137,6 +158,8 @@ module Stripe
|
|
137
158
|
attr_accessor :percent_off
|
138
159
|
# Unix timestamp specifying the last time at which the coupon can be redeemed. After the redeem_by date, the coupon can no longer be applied to new customers.
|
139
160
|
attr_accessor :redeem_by
|
161
|
+
# Configuration of the [script](https://docs.stripe.com/billing/subscriptions/script-coupons) used to calculate the discount.
|
162
|
+
attr_accessor :script
|
140
163
|
|
141
164
|
def initialize(
|
142
165
|
amount_off: nil,
|
@@ -151,7 +174,8 @@ module Stripe
|
|
151
174
|
metadata: nil,
|
152
175
|
name: nil,
|
153
176
|
percent_off: nil,
|
154
|
-
redeem_by: nil
|
177
|
+
redeem_by: nil,
|
178
|
+
script: nil
|
155
179
|
)
|
156
180
|
@amount_off = amount_off
|
157
181
|
@applies_to = applies_to
|
@@ -166,6 +190,7 @@ module Stripe
|
|
166
190
|
@name = name
|
167
191
|
@percent_off = percent_off
|
168
192
|
@redeem_by = redeem_by
|
193
|
+
@script = script
|
169
194
|
end
|
170
195
|
end
|
171
196
|
# Amount (in the `currency` specified) that will be taken off the subtotal of any invoices for this customer.
|
@@ -198,8 +223,12 @@ module Stripe
|
|
198
223
|
attr_reader :percent_off
|
199
224
|
# Date after which the coupon can no longer be redeemed.
|
200
225
|
attr_reader :redeem_by
|
226
|
+
# Configuration of the [script](https://docs.stripe.com/billing/subscriptions/script-coupons) used to calculate the discount.
|
227
|
+
attr_reader :script
|
201
228
|
# Number of times this coupon has been applied to a customer.
|
202
229
|
attr_reader :times_redeemed
|
230
|
+
# One of `amount_off`, `percent_off`, or `script`. Describes the type of coupon logic used to calculate the discount.
|
231
|
+
attr_reader :type
|
203
232
|
# Taking account of the above properties, whether this coupon can still be applied to a customer.
|
204
233
|
attr_reader :valid
|
205
234
|
# Always true for a deleted object
|
@@ -326,7 +326,7 @@ module Stripe
|
|
326
326
|
raise NotImplementedError,
|
327
327
|
"FundingInstructions cannot be accessed without a customer ID."
|
328
328
|
end
|
329
|
-
"#{Customer.resource_url}/#{CGI.escape(customer)}/funding_instructions" "/#{CGI.escape(id)}"
|
329
|
+
"#{Customer.resource_url}/#{CGI.escape(customer)}/funding_instructions" + "/#{CGI.escape(id)}"
|
330
330
|
end
|
331
331
|
end
|
332
332
|
end
|
@@ -0,0 +1,184 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
# The FX Quotes API provides three key functions:
|
6
|
+
# - View current exchange rates: The object shows Stripe's current exchange rate for any given currency pair.
|
7
|
+
# - Extended quotes: The API provides rate quotes valid for a 1-hour period or a 24-hour period, eliminating uncertainty from FX fluctuations.
|
8
|
+
# - View FX fees: The API provides information on the FX fees Stripe will charge on your FX transaction, allowing you to anticipate specific settlement amounts before payment costs.
|
9
|
+
class FxQuote < APIResource
|
10
|
+
extend Stripe::APIOperations::Create
|
11
|
+
extend Stripe::APIOperations::List
|
12
|
+
|
13
|
+
OBJECT_NAME = "fx_quote"
|
14
|
+
def self.object_name
|
15
|
+
"fx_quote"
|
16
|
+
end
|
17
|
+
|
18
|
+
class Rates < Stripe::StripeObject
|
19
|
+
class RateDetails < Stripe::StripeObject
|
20
|
+
# The rate for the currency pair.
|
21
|
+
attr_reader :base_rate
|
22
|
+
# The fee for locking the conversion rates.
|
23
|
+
attr_reader :duration_premium
|
24
|
+
# The FX fee for the currency pair.
|
25
|
+
attr_reader :fx_fee_rate
|
26
|
+
# A reference rate for the currency pair provided by the reference rate provider.
|
27
|
+
attr_reader :reference_rate
|
28
|
+
# The reference rate provider.
|
29
|
+
attr_reader :reference_rate_provider
|
30
|
+
end
|
31
|
+
# The rate that includes the FX fee rate.
|
32
|
+
attr_reader :exchange_rate
|
33
|
+
# Attribute for field rate_details
|
34
|
+
attr_reader :rate_details
|
35
|
+
end
|
36
|
+
|
37
|
+
class Usage < Stripe::StripeObject
|
38
|
+
class Payment < Stripe::StripeObject
|
39
|
+
# The Stripe account ID that the funds will be transferred to.
|
40
|
+
#
|
41
|
+
# This field should match the account ID that would be used in the PaymentIntent’s transfer_data[destination] field.
|
42
|
+
attr_reader :destination
|
43
|
+
# The Stripe account ID that these funds are intended for.
|
44
|
+
#
|
45
|
+
# This field must match the account ID that would be used in the PaymentIntent’s on_behalf_of field.
|
46
|
+
attr_reader :on_behalf_of
|
47
|
+
end
|
48
|
+
|
49
|
+
class Transfer < Stripe::StripeObject
|
50
|
+
# The Stripe account ID that the funds will be transferred to.
|
51
|
+
#
|
52
|
+
# This field should match the account ID that would be used in the Transfer’s destination field.
|
53
|
+
attr_reader :destination
|
54
|
+
end
|
55
|
+
# The details required to use an FX Quote for a payment
|
56
|
+
attr_reader :payment
|
57
|
+
# The details required to use an FX Quote for a transfer
|
58
|
+
attr_reader :transfer
|
59
|
+
# The transaction type for which the FX Quote will be used.
|
60
|
+
#
|
61
|
+
# Can be 'payment' or 'transfer'.
|
62
|
+
attr_reader :type
|
63
|
+
end
|
64
|
+
|
65
|
+
class ListParams < Stripe::RequestParams
|
66
|
+
# A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
|
67
|
+
attr_accessor :ending_before
|
68
|
+
# Specifies which fields in the response should be expanded.
|
69
|
+
attr_accessor :expand
|
70
|
+
# A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
|
71
|
+
attr_accessor :limit
|
72
|
+
# A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
|
73
|
+
attr_accessor :starting_after
|
74
|
+
|
75
|
+
def initialize(ending_before: nil, expand: nil, limit: nil, starting_after: nil)
|
76
|
+
@ending_before = ending_before
|
77
|
+
@expand = expand
|
78
|
+
@limit = limit
|
79
|
+
@starting_after = starting_after
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
class CreateParams < Stripe::RequestParams
|
84
|
+
class Usage < Stripe::RequestParams
|
85
|
+
class Payment < Stripe::RequestParams
|
86
|
+
# The Stripe account ID that the funds will be transferred to.
|
87
|
+
#
|
88
|
+
# This field should match the account ID that would be used in the PaymentIntent’s transfer_data[destination] field.
|
89
|
+
attr_accessor :destination
|
90
|
+
# The Stripe account ID that these funds are intended for.
|
91
|
+
#
|
92
|
+
# This field should match the account ID that would be used in the PaymentIntent’s on_behalf_of field.
|
93
|
+
attr_accessor :on_behalf_of
|
94
|
+
|
95
|
+
def initialize(destination: nil, on_behalf_of: nil)
|
96
|
+
@destination = destination
|
97
|
+
@on_behalf_of = on_behalf_of
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
class Transfer < Stripe::RequestParams
|
102
|
+
# The Stripe account ID that the funds will be transferred to.
|
103
|
+
#
|
104
|
+
# This field should match the account ID that would be used in the Transfer’s destination field.
|
105
|
+
attr_accessor :destination
|
106
|
+
|
107
|
+
def initialize(destination: nil)
|
108
|
+
@destination = destination
|
109
|
+
end
|
110
|
+
end
|
111
|
+
# The payment transaction details that are intended for the FX Quote.
|
112
|
+
attr_accessor :payment
|
113
|
+
# The transfer transaction details that are intended for the FX Quote.
|
114
|
+
attr_accessor :transfer
|
115
|
+
# Which transaction the FX Quote will be used for
|
116
|
+
#
|
117
|
+
# Can be “payment” | “transfer”
|
118
|
+
attr_accessor :type
|
119
|
+
|
120
|
+
def initialize(payment: nil, transfer: nil, type: nil)
|
121
|
+
@payment = payment
|
122
|
+
@transfer = transfer
|
123
|
+
@type = type
|
124
|
+
end
|
125
|
+
end
|
126
|
+
# Specifies which fields in the response should be expanded.
|
127
|
+
attr_accessor :expand
|
128
|
+
# A list of three letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be [supported currencies](https://stripe.com/docs/currencies).
|
129
|
+
attr_accessor :from_currencies
|
130
|
+
# The duration that you wish the quote to be locked for. The quote will be usable for the duration specified. The default is `none`. The maximum is 1 day.
|
131
|
+
attr_accessor :lock_duration
|
132
|
+
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
133
|
+
attr_accessor :to_currency
|
134
|
+
# The usage specific information for the quote.
|
135
|
+
attr_accessor :usage
|
136
|
+
|
137
|
+
def initialize(
|
138
|
+
expand: nil,
|
139
|
+
from_currencies: nil,
|
140
|
+
lock_duration: nil,
|
141
|
+
to_currency: nil,
|
142
|
+
usage: nil
|
143
|
+
)
|
144
|
+
@expand = expand
|
145
|
+
@from_currencies = from_currencies
|
146
|
+
@lock_duration = lock_duration
|
147
|
+
@to_currency = to_currency
|
148
|
+
@usage = usage
|
149
|
+
end
|
150
|
+
end
|
151
|
+
# Time at which the quote was created, measured in seconds since the Unix epoch.
|
152
|
+
attr_reader :created
|
153
|
+
# Unique identifier for the object.
|
154
|
+
attr_reader :id
|
155
|
+
# The duration the exchange rate quote remains valid from creation time. Allowed values are none, hour, and day. Note that for the test mode API available in alpha, you can request an extended quote, but it won't be usable for any transactions.
|
156
|
+
attr_reader :lock_duration
|
157
|
+
# Time at which the quote will expire, measured in seconds since the Unix epoch.
|
158
|
+
#
|
159
|
+
# If lock_duration is set to ‘none’ this field will be set to null.
|
160
|
+
attr_reader :lock_expires_at
|
161
|
+
# Lock status of the quote. Transitions from active to expired once past the lock_expires_at timestamp.
|
162
|
+
#
|
163
|
+
# Can return value none, active, or expired.
|
164
|
+
attr_reader :lock_status
|
165
|
+
# String representing the object's type. Objects of the same type share the same value.
|
166
|
+
attr_reader :object
|
167
|
+
# Information about the rates.
|
168
|
+
attr_reader :rates
|
169
|
+
# The currency to convert into, typically this is the currency that you want to settle to your Stripe balance. Three-letter ISO currency code, in lowercase. Must be a supported currency.
|
170
|
+
attr_reader :to_currency
|
171
|
+
# Attribute for field usage
|
172
|
+
attr_reader :usage
|
173
|
+
|
174
|
+
# Creates an FX Quote object
|
175
|
+
def self.create(params = {}, opts = {})
|
176
|
+
request_stripe_object(method: :post, path: "/v1/fx_quotes", params: params, opts: opts)
|
177
|
+
end
|
178
|
+
|
179
|
+
# Returns a list of FX quotes that have been issued. The FX quotes are returned in sorted order, with the most recent FX quotes appearing first.
|
180
|
+
def self.list(params = {}, opts = {})
|
181
|
+
request_stripe_object(method: :get, path: "/v1/fx_quotes", params: params, opts: opts)
|
182
|
+
end
|
183
|
+
end
|
184
|
+
end
|
@@ -48,7 +48,6 @@ module Stripe
|
|
48
48
|
end
|
49
49
|
|
50
50
|
nested_resource_class_methods :line, operations: %i[list]
|
51
|
-
nested_resource_class_methods :payment, operations: %i[retrieve list]
|
52
51
|
|
53
52
|
class AmountsDue < Stripe::StripeObject
|
54
53
|
# Incremental amount due for this payment in cents (or local equivalent).
|
@@ -2191,21 +2190,6 @@ module Stripe
|
|
2191
2190
|
end
|
2192
2191
|
end
|
2193
2192
|
|
2194
|
-
class AttachPaymentIntentParams < Stripe::RequestParams
|
2195
|
-
# The portion of the PaymentIntent’s `amount` that should be applied to thisinvoice. Defaults to the entire amount.
|
2196
|
-
attr_accessor :amount_requested
|
2197
|
-
# Specifies which fields in the response should be expanded.
|
2198
|
-
attr_accessor :expand
|
2199
|
-
# The ID of the PaymentIntent to attach to the invoice.
|
2200
|
-
attr_accessor :payment_intent
|
2201
|
-
|
2202
|
-
def initialize(amount_requested: nil, expand: nil, payment_intent: nil)
|
2203
|
-
@amount_requested = amount_requested
|
2204
|
-
@expand = expand
|
2205
|
-
@payment_intent = payment_intent
|
2206
|
-
end
|
2207
|
-
end
|
2208
|
-
|
2209
2193
|
class FinalizeInvoiceParams < Stripe::RequestParams
|
2210
2194
|
# Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action.
|
2211
2195
|
attr_accessor :auto_advance
|
@@ -4397,42 +4381,6 @@ module Stripe
|
|
4397
4381
|
)
|
4398
4382
|
end
|
4399
4383
|
|
4400
|
-
# Attaches a PaymentIntent to the invoice, adding it to the list of payments.
|
4401
|
-
# When the PaymentIntent's status changes to succeeded, the payment is credited
|
4402
|
-
# to the invoice, increasing its amount_paid. When the invoice is fully paid, the
|
4403
|
-
# invoice's status becomes paid.
|
4404
|
-
#
|
4405
|
-
# If the PaymentIntent's status is already succeeded when it is attached, it is
|
4406
|
-
# credited to the invoice immediately.
|
4407
|
-
#
|
4408
|
-
# Related guide: [Create an invoice payment](https://stripe.com/docs/invoicing/payments/create)
|
4409
|
-
def attach_payment_intent(params = {}, opts = {})
|
4410
|
-
request_stripe_object(
|
4411
|
-
method: :post,
|
4412
|
-
path: format("/v1/invoices/%<invoice>s/attach_payment_intent", { invoice: CGI.escape(self["id"]) }),
|
4413
|
-
params: params,
|
4414
|
-
opts: opts
|
4415
|
-
)
|
4416
|
-
end
|
4417
|
-
|
4418
|
-
# Attaches a PaymentIntent to the invoice, adding it to the list of payments.
|
4419
|
-
# When the PaymentIntent's status changes to succeeded, the payment is credited
|
4420
|
-
# to the invoice, increasing its amount_paid. When the invoice is fully paid, the
|
4421
|
-
# invoice's status becomes paid.
|
4422
|
-
#
|
4423
|
-
# If the PaymentIntent's status is already succeeded when it is attached, it is
|
4424
|
-
# credited to the invoice immediately.
|
4425
|
-
#
|
4426
|
-
# Related guide: [Create an invoice payment](https://stripe.com/docs/invoicing/payments/create)
|
4427
|
-
def self.attach_payment_intent(invoice, params = {}, opts = {})
|
4428
|
-
request_stripe_object(
|
4429
|
-
method: :post,
|
4430
|
-
path: format("/v1/invoices/%<invoice>s/attach_payment_intent", { invoice: CGI.escape(invoice) }),
|
4431
|
-
params: params,
|
4432
|
-
opts: opts
|
4433
|
-
)
|
4434
|
-
end
|
4435
|
-
|
4436
4384
|
# This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](#pay_invoice) or <a href="#send_invoice">send](https://stripe.com/docs/api#finalize_invoice) the invoice to your customers.
|
4437
4385
|
def self.create(params = {}, opts = {})
|
4438
4386
|
request_stripe_object(method: :post, path: "/v1/invoices", params: params, opts: opts)
|
@@ -16,6 +16,7 @@ module Stripe
|
|
16
16
|
class PaymentIntent < APIResource
|
17
17
|
extend Stripe::APIOperations::Create
|
18
18
|
extend Stripe::APIOperations::List
|
19
|
+
extend Stripe::APIOperations::NestedResource
|
19
20
|
extend Stripe::APIOperations::Search
|
20
21
|
include Stripe::APIOperations::Save
|
21
22
|
|
@@ -24,11 +25,35 @@ module Stripe
|
|
24
25
|
"payment_intent"
|
25
26
|
end
|
26
27
|
|
28
|
+
nested_resource_class_methods :amount_details_line_item, operations: %i[list]
|
29
|
+
|
27
30
|
class AmountDetails < Stripe::StripeObject
|
31
|
+
class Shipping < Stripe::StripeObject
|
32
|
+
# Portion of the amount that is for shipping.
|
33
|
+
attr_reader :amount
|
34
|
+
# The postal code that represents the shipping source.
|
35
|
+
attr_reader :from_postal_code
|
36
|
+
# The postal code that represents the shipping destination.
|
37
|
+
attr_reader :to_postal_code
|
38
|
+
end
|
39
|
+
|
40
|
+
class Tax < Stripe::StripeObject
|
41
|
+
# Total portion of the amount that is for tax.
|
42
|
+
attr_reader :total_tax_amount
|
43
|
+
end
|
44
|
+
|
28
45
|
class Tip < Stripe::StripeObject
|
29
46
|
# Portion of the amount that corresponds to a tip.
|
30
47
|
attr_reader :amount
|
31
48
|
end
|
49
|
+
# The amount an item was discounted for.
|
50
|
+
attr_reader :discount_amount
|
51
|
+
# A list of line items, each containing information about a product in the PaymentIntent. There is a maximum of 100 line items.
|
52
|
+
attr_reader :line_items
|
53
|
+
# Attribute for field shipping
|
54
|
+
attr_reader :shipping
|
55
|
+
# Attribute for field tax
|
56
|
+
attr_reader :tax
|
32
57
|
# Attribute for field tip
|
33
58
|
attr_reader :tip
|
34
59
|
end
|
@@ -863,8 +888,12 @@ module Stripe
|
|
863
888
|
end
|
864
889
|
# Attribute for field car_rental
|
865
890
|
attr_reader :car_rental
|
891
|
+
# Some customers might be required by their company or organization to provide this information. If so, provide this value. Otherwise you can ignore this field.
|
892
|
+
attr_reader :customer_reference
|
866
893
|
# Attribute for field event_details
|
867
894
|
attr_reader :event_details
|
895
|
+
# A unique value assigned by the business to identify the transaction.
|
896
|
+
attr_reader :order_reference
|
868
897
|
# Attribute for field subscription
|
869
898
|
attr_reader :subscription
|
870
899
|
end
|
@@ -2691,26 +2720,34 @@ module Stripe
|
|
2691
2720
|
end
|
2692
2721
|
# Car rental details for this PaymentIntent.
|
2693
2722
|
attr_accessor :car_rental
|
2723
|
+
# Some customers might be required by their company or organization to provide this information. If so, provide this value. Otherwise you can ignore this field.
|
2724
|
+
attr_accessor :customer_reference
|
2694
2725
|
# Event details for this PaymentIntent
|
2695
2726
|
attr_accessor :event_details
|
2696
2727
|
# Flight reservation details for this PaymentIntent
|
2697
2728
|
attr_accessor :flight
|
2698
2729
|
# Lodging reservation details for this PaymentIntent
|
2699
2730
|
attr_accessor :lodging
|
2731
|
+
# A unique value assigned by the business to identify the transaction.
|
2732
|
+
attr_accessor :order_reference
|
2700
2733
|
# Subscription details for this PaymentIntent
|
2701
2734
|
attr_accessor :subscription
|
2702
2735
|
|
2703
2736
|
def initialize(
|
2704
2737
|
car_rental: nil,
|
2738
|
+
customer_reference: nil,
|
2705
2739
|
event_details: nil,
|
2706
2740
|
flight: nil,
|
2707
2741
|
lodging: nil,
|
2742
|
+
order_reference: nil,
|
2708
2743
|
subscription: nil
|
2709
2744
|
)
|
2710
2745
|
@car_rental = car_rental
|
2746
|
+
@customer_reference = customer_reference
|
2711
2747
|
@event_details = event_details
|
2712
2748
|
@flight = flight
|
2713
2749
|
@lodging = lodging
|
2750
|
+
@order_reference = order_reference
|
2714
2751
|
@subscription = subscription
|
2715
2752
|
end
|
2716
2753
|
end
|
@@ -2815,12 +2852,15 @@ module Stripe
|
|
2815
2852
|
attr_accessor :name
|
2816
2853
|
# Billing phone number (including extension).
|
2817
2854
|
attr_accessor :phone
|
2855
|
+
# Taxpayer identification number. Used only for transactions between LATAM buyers and non-LATAM sellers.
|
2856
|
+
attr_accessor :tax_id
|
2818
2857
|
|
2819
|
-
def initialize(address: nil, email: nil, name: nil, phone: nil)
|
2858
|
+
def initialize(address: nil, email: nil, name: nil, phone: nil, tax_id: nil)
|
2820
2859
|
@address = address
|
2821
2860
|
@email = email
|
2822
2861
|
@name = name
|
2823
2862
|
@phone = phone
|
2863
|
+
@tax_id = tax_id
|
2824
2864
|
end
|
2825
2865
|
end
|
2826
2866
|
|
@@ -5348,6 +5388,8 @@ module Stripe
|
|
5348
5388
|
attr_accessor :error_on_requires_action
|
5349
5389
|
# Specifies which fields in the response should be expanded.
|
5350
5390
|
attr_accessor :expand
|
5391
|
+
# The FX rate in the quote is validated and used to convert the presentment amount to the settlement amount.
|
5392
|
+
attr_accessor :fx_quote
|
5351
5393
|
# ID of the mandate that's used for this payment. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
|
5352
5394
|
attr_accessor :mandate
|
5353
5395
|
# This hash contains details about the Mandate to create. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
|
@@ -5421,6 +5463,7 @@ module Stripe
|
|
5421
5463
|
description: nil,
|
5422
5464
|
error_on_requires_action: nil,
|
5423
5465
|
expand: nil,
|
5466
|
+
fx_quote: nil,
|
5424
5467
|
mandate: nil,
|
5425
5468
|
mandate_data: nil,
|
5426
5469
|
metadata: nil,
|
@@ -5458,6 +5501,7 @@ module Stripe
|
|
5458
5501
|
@description = description
|
5459
5502
|
@error_on_requires_action = error_on_requires_action
|
5460
5503
|
@expand = expand
|
5504
|
+
@fx_quote = fx_quote
|
5461
5505
|
@mandate = mandate
|
5462
5506
|
@mandate_data = mandate_data
|
5463
5507
|
@metadata = metadata
|
@@ -6179,26 +6223,34 @@ module Stripe
|
|
6179
6223
|
end
|
6180
6224
|
# Car rental details for this PaymentIntent.
|
6181
6225
|
attr_accessor :car_rental
|
6226
|
+
# Some customers might be required by their company or organization to provide this information. If so, provide this value. Otherwise you can ignore this field.
|
6227
|
+
attr_accessor :customer_reference
|
6182
6228
|
# Event details for this PaymentIntent
|
6183
6229
|
attr_accessor :event_details
|
6184
6230
|
# Flight reservation details for this PaymentIntent
|
6185
6231
|
attr_accessor :flight
|
6186
6232
|
# Lodging reservation details for this PaymentIntent
|
6187
6233
|
attr_accessor :lodging
|
6234
|
+
# A unique value assigned by the business to identify the transaction.
|
6235
|
+
attr_accessor :order_reference
|
6188
6236
|
# Subscription details for this PaymentIntent
|
6189
6237
|
attr_accessor :subscription
|
6190
6238
|
|
6191
6239
|
def initialize(
|
6192
6240
|
car_rental: nil,
|
6241
|
+
customer_reference: nil,
|
6193
6242
|
event_details: nil,
|
6194
6243
|
flight: nil,
|
6195
6244
|
lodging: nil,
|
6245
|
+
order_reference: nil,
|
6196
6246
|
subscription: nil
|
6197
6247
|
)
|
6198
6248
|
@car_rental = car_rental
|
6249
|
+
@customer_reference = customer_reference
|
6199
6250
|
@event_details = event_details
|
6200
6251
|
@flight = flight
|
6201
6252
|
@lodging = lodging
|
6253
|
+
@order_reference = order_reference
|
6202
6254
|
@subscription = subscription
|
6203
6255
|
end
|
6204
6256
|
end
|
@@ -6303,12 +6355,15 @@ module Stripe
|
|
6303
6355
|
attr_accessor :name
|
6304
6356
|
# Billing phone number (including extension).
|
6305
6357
|
attr_accessor :phone
|
6358
|
+
# Taxpayer identification number. Used only for transactions between LATAM buyers and non-LATAM sellers.
|
6359
|
+
attr_accessor :tax_id
|
6306
6360
|
|
6307
|
-
def initialize(address: nil, email: nil, name: nil, phone: nil)
|
6361
|
+
def initialize(address: nil, email: nil, name: nil, phone: nil, tax_id: nil)
|
6308
6362
|
@address = address
|
6309
6363
|
@email = email
|
6310
6364
|
@name = name
|
6311
6365
|
@phone = phone
|
6366
|
+
@tax_id = tax_id
|
6312
6367
|
end
|
6313
6368
|
end
|
6314
6369
|
|
@@ -8803,6 +8858,8 @@ module Stripe
|
|
8803
8858
|
attr_accessor :description
|
8804
8859
|
# Specifies which fields in the response should be expanded.
|
8805
8860
|
attr_accessor :expand
|
8861
|
+
# The FX rate in the quote is validated and used to convert the presentment amount to the settlement amount.
|
8862
|
+
attr_accessor :fx_quote
|
8806
8863
|
# This hash contains details about the Mandate to create.
|
8807
8864
|
attr_accessor :mandate_data
|
8808
8865
|
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
@@ -8856,6 +8913,7 @@ module Stripe
|
|
8856
8913
|
customer_account: nil,
|
8857
8914
|
description: nil,
|
8858
8915
|
expand: nil,
|
8916
|
+
fx_quote: nil,
|
8859
8917
|
mandate_data: nil,
|
8860
8918
|
metadata: nil,
|
8861
8919
|
payment_details: nil,
|
@@ -8881,6 +8939,7 @@ module Stripe
|
|
8881
8939
|
@customer_account = customer_account
|
8882
8940
|
@description = description
|
8883
8941
|
@expand = expand
|
8942
|
+
@fx_quote = fx_quote
|
8884
8943
|
@mandate_data = mandate_data
|
8885
8944
|
@metadata = metadata
|
8886
8945
|
@payment_details = payment_details
|
@@ -9613,26 +9672,34 @@ module Stripe
|
|
9613
9672
|
end
|
9614
9673
|
# Car rental details for this PaymentIntent.
|
9615
9674
|
attr_accessor :car_rental
|
9675
|
+
# Some customers might be required by their company or organization to provide this information. If so, provide this value. Otherwise you can ignore this field.
|
9676
|
+
attr_accessor :customer_reference
|
9616
9677
|
# Event details for this PaymentIntent
|
9617
9678
|
attr_accessor :event_details
|
9618
9679
|
# Flight reservation details for this PaymentIntent
|
9619
9680
|
attr_accessor :flight
|
9620
9681
|
# Lodging reservation details for this PaymentIntent
|
9621
9682
|
attr_accessor :lodging
|
9683
|
+
# A unique value assigned by the business to identify the transaction.
|
9684
|
+
attr_accessor :order_reference
|
9622
9685
|
# Subscription details for this PaymentIntent
|
9623
9686
|
attr_accessor :subscription
|
9624
9687
|
|
9625
9688
|
def initialize(
|
9626
9689
|
car_rental: nil,
|
9690
|
+
customer_reference: nil,
|
9627
9691
|
event_details: nil,
|
9628
9692
|
flight: nil,
|
9629
9693
|
lodging: nil,
|
9694
|
+
order_reference: nil,
|
9630
9695
|
subscription: nil
|
9631
9696
|
)
|
9632
9697
|
@car_rental = car_rental
|
9698
|
+
@customer_reference = customer_reference
|
9633
9699
|
@event_details = event_details
|
9634
9700
|
@flight = flight
|
9635
9701
|
@lodging = lodging
|
9702
|
+
@order_reference = order_reference
|
9636
9703
|
@subscription = subscription
|
9637
9704
|
end
|
9638
9705
|
end
|
@@ -10399,26 +10466,34 @@ module Stripe
|
|
10399
10466
|
end
|
10400
10467
|
# Car rental details for this PaymentIntent.
|
10401
10468
|
attr_accessor :car_rental
|
10469
|
+
# Some customers might be required by their company or organization to provide this information. If so, provide this value. Otherwise you can ignore this field.
|
10470
|
+
attr_accessor :customer_reference
|
10402
10471
|
# Event details for this PaymentIntent
|
10403
10472
|
attr_accessor :event_details
|
10404
10473
|
# Flight reservation details for this PaymentIntent
|
10405
10474
|
attr_accessor :flight
|
10406
10475
|
# Lodging reservation details for this PaymentIntent
|
10407
10476
|
attr_accessor :lodging
|
10477
|
+
# A unique value assigned by the business to identify the transaction.
|
10478
|
+
attr_accessor :order_reference
|
10408
10479
|
# Subscription details for this PaymentIntent
|
10409
10480
|
attr_accessor :subscription
|
10410
10481
|
|
10411
10482
|
def initialize(
|
10412
10483
|
car_rental: nil,
|
10484
|
+
customer_reference: nil,
|
10413
10485
|
event_details: nil,
|
10414
10486
|
flight: nil,
|
10415
10487
|
lodging: nil,
|
10488
|
+
order_reference: nil,
|
10416
10489
|
subscription: nil
|
10417
10490
|
)
|
10418
10491
|
@car_rental = car_rental
|
10492
|
+
@customer_reference = customer_reference
|
10419
10493
|
@event_details = event_details
|
10420
10494
|
@flight = flight
|
10421
10495
|
@lodging = lodging
|
10496
|
+
@order_reference = order_reference
|
10422
10497
|
@subscription = subscription
|
10423
10498
|
end
|
10424
10499
|
end
|
@@ -10523,12 +10598,15 @@ module Stripe
|
|
10523
10598
|
attr_accessor :name
|
10524
10599
|
# Billing phone number (including extension).
|
10525
10600
|
attr_accessor :phone
|
10601
|
+
# Taxpayer identification number. Used only for transactions between LATAM buyers and non-LATAM sellers.
|
10602
|
+
attr_accessor :tax_id
|
10526
10603
|
|
10527
|
-
def initialize(address: nil, email: nil, name: nil, phone: nil)
|
10604
|
+
def initialize(address: nil, email: nil, name: nil, phone: nil, tax_id: nil)
|
10528
10605
|
@address = address
|
10529
10606
|
@email = email
|
10530
10607
|
@name = name
|
10531
10608
|
@phone = phone
|
10609
|
+
@tax_id = tax_id
|
10532
10610
|
end
|
10533
10611
|
end
|
10534
10612
|
|
@@ -13011,6 +13089,8 @@ module Stripe
|
|
13011
13089
|
attr_accessor :error_on_requires_action
|
13012
13090
|
# Specifies which fields in the response should be expanded.
|
13013
13091
|
attr_accessor :expand
|
13092
|
+
# The FX rate in the quote is validated and used to convert the presentment amount to the settlement amount.
|
13093
|
+
attr_accessor :fx_quote
|
13014
13094
|
# ID of the mandate that's used for this payment.
|
13015
13095
|
attr_accessor :mandate
|
13016
13096
|
# Attribute for param field mandate_data
|
@@ -13059,6 +13139,7 @@ module Stripe
|
|
13059
13139
|
confirmation_token: nil,
|
13060
13140
|
error_on_requires_action: nil,
|
13061
13141
|
expand: nil,
|
13142
|
+
fx_quote: nil,
|
13062
13143
|
mandate: nil,
|
13063
13144
|
mandate_data: nil,
|
13064
13145
|
off_session: nil,
|
@@ -13080,6 +13161,7 @@ module Stripe
|
|
13080
13161
|
@confirmation_token = confirmation_token
|
13081
13162
|
@error_on_requires_action = error_on_requires_action
|
13082
13163
|
@expand = expand
|
13164
|
+
@fx_quote = fx_quote
|
13083
13165
|
@mandate = mandate
|
13084
13166
|
@mandate_data = mandate_data
|
13085
13167
|
@off_session = off_session
|
@@ -13345,6 +13427,8 @@ module Stripe
|
|
13345
13427
|
attr_reader :customer_account
|
13346
13428
|
# An arbitrary string attached to the object. Often useful for displaying to users.
|
13347
13429
|
attr_reader :description
|
13430
|
+
# The FX Quote used for the PaymentIntent.
|
13431
|
+
attr_reader :fx_quote
|
13348
13432
|
# Unique identifier for the object.
|
13349
13433
|
attr_reader :id
|
13350
13434
|
# The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason.
|