stripe 10.8.0.pre.beta.1 → 10.9.0.pre.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/Gemfile +1 -1
- data/OPENAPI_VERSION +1 -1
- data/VERSION +1 -1
- data/lib/stripe/resources/account.rb +61 -1
- data/lib/stripe/resources/account_link.rb +5 -0
- data/lib/stripe/resources/account_notice.rb +15 -0
- data/lib/stripe/resources/account_session.rb +5 -0
- data/lib/stripe/resources/apple_pay_domain.rb +40 -0
- data/lib/stripe/resources/application_fee.rb +5 -0
- data/lib/stripe/resources/apps/secret.rb +10 -0
- data/lib/stripe/resources/balance_transaction.rb +12 -0
- data/lib/stripe/resources/bank_account.rb +27 -0
- data/lib/stripe/resources/billing_portal/configuration.rb +30 -0
- data/lib/stripe/resources/billing_portal/session.rb +10 -0
- data/lib/stripe/resources/capital/financing_offer.rb +10 -0
- data/lib/stripe/resources/capital/financing_transaction.rb +11 -0
- data/lib/stripe/resources/card.rb +27 -0
- data/lib/stripe/resources/charge.rb +22 -0
- data/lib/stripe/resources/checkout/session.rb +20 -0
- data/lib/stripe/resources/climate/order.rb +22 -0
- data/lib/stripe/resources/climate/product.rb +10 -0
- data/lib/stripe/resources/climate/supplier.rb +10 -0
- data/lib/stripe/resources/country_spec.rb +5 -0
- data/lib/stripe/resources/coupon.rb +42 -0
- data/lib/stripe/resources/credit_note.rb +33 -0
- data/lib/stripe/resources/customer.rb +42 -0
- data/lib/stripe/resources/customer_session.rb +10 -0
- data/lib/stripe/resources/dispute.rb +17 -0
- data/lib/stripe/resources/entitlements/event.rb +10 -0
- data/lib/stripe/resources/entitlements/feature.rb +20 -0
- data/lib/stripe/resources/ephemeral_key.rb +20 -0
- data/lib/stripe/resources/event.rb +5 -0
- data/lib/stripe/resources/exchange_rate.rb +5 -0
- data/lib/stripe/resources/file.rb +5 -0
- data/lib/stripe/resources/file_link.rb +20 -0
- data/lib/stripe/resources/financial_connections/account.rb +10 -0
- data/lib/stripe/resources/financial_connections/session.rb +10 -0
- data/lib/stripe/resources/financial_connections/transaction.rb +10 -0
- data/lib/stripe/resources/gift_cards/card.rb +30 -0
- data/lib/stripe/resources/gift_cards/transaction.rb +30 -0
- data/lib/stripe/resources/identity/verification_report.rb +10 -0
- data/lib/stripe/resources/identity/verification_session.rb +39 -0
- data/lib/stripe/resources/invoice.rb +45 -0
- data/lib/stripe/resources/invoice_item.rb +40 -0
- data/lib/stripe/resources/issuing/authorization.rb +20 -0
- data/lib/stripe/resources/issuing/card.rb +20 -0
- data/lib/stripe/resources/issuing/cardholder.rb +30 -0
- data/lib/stripe/resources/issuing/credit_underwriting_record.rb +10 -0
- data/lib/stripe/resources/issuing/dispute.rb +30 -0
- data/lib/stripe/resources/issuing/personalization_design.rb +30 -0
- data/lib/stripe/resources/issuing/physical_bundle.rb +10 -0
- data/lib/stripe/resources/issuing/token.rb +15 -0
- data/lib/stripe/resources/issuing/transaction.rb +20 -0
- data/lib/stripe/resources/margin.rb +20 -0
- data/lib/stripe/resources/order.rb +20 -0
- data/lib/stripe/resources/payment_intent.rb +35 -0
- data/lib/stripe/resources/payment_link.rb +20 -0
- data/lib/stripe/resources/payment_method.rb +22 -0
- data/lib/stripe/resources/payment_method_configuration.rb +30 -0
- data/lib/stripe/resources/payment_method_domain.rb +30 -0
- data/lib/stripe/resources/payout.rb +24 -0
- data/lib/stripe/resources/plan.rb +40 -0
- data/lib/stripe/resources/price.rb +20 -0
- data/lib/stripe/resources/product.rb +40 -0
- data/lib/stripe/resources/promotion_code.rb +20 -0
- data/lib/stripe/resources/quote.rb +20 -0
- data/lib/stripe/resources/quote_phase.rb +5 -0
- data/lib/stripe/resources/radar/early_fraud_warning.rb +10 -0
- data/lib/stripe/resources/radar/value_list.rb +50 -0
- data/lib/stripe/resources/radar/value_list_item.rb +40 -0
- data/lib/stripe/resources/refund.rb +36 -0
- data/lib/stripe/resources/reporting/report_run.rb +20 -0
- data/lib/stripe/resources/reporting/report_type.rb +10 -0
- data/lib/stripe/resources/review.rb +5 -0
- data/lib/stripe/resources/setup_attempt.rb +5 -0
- data/lib/stripe/resources/setup_intent.rb +23 -0
- data/lib/stripe/resources/shipping_rate.rb +20 -0
- data/lib/stripe/resources/sigma/scheduled_query_run.rb +10 -0
- data/lib/stripe/resources/source.rb +17 -0
- data/lib/stripe/resources/subscription.rb +46 -0
- data/lib/stripe/resources/subscription_item.rb +50 -0
- data/lib/stripe/resources/subscription_schedule.rb +30 -0
- data/lib/stripe/resources/tax/calculation.rb +10 -0
- data/lib/stripe/resources/tax/form.rb +5 -0
- data/lib/stripe/resources/tax/registration.rb +32 -0
- data/lib/stripe/resources/tax_code.rb +5 -0
- data/lib/stripe/resources/tax_id.rb +20 -0
- data/lib/stripe/resources/tax_rate.rb +20 -0
- data/lib/stripe/resources/terminal/configuration.rb +50 -0
- data/lib/stripe/resources/terminal/connection_token.rb +10 -0
- data/lib/stripe/resources/terminal/location.rb +51 -0
- data/lib/stripe/resources/terminal/reader.rb +50 -0
- data/lib/stripe/resources/test_helpers/test_clock.rb +40 -0
- data/lib/stripe/resources/token.rb +6 -0
- data/lib/stripe/resources/topup.rb +20 -0
- data/lib/stripe/resources/transfer.rb +22 -0
- data/lib/stripe/resources/treasury/credit_reversal.rb +20 -0
- data/lib/stripe/resources/treasury/debit_reversal.rb +20 -0
- data/lib/stripe/resources/treasury/financial_account.rb +30 -0
- data/lib/stripe/resources/treasury/inbound_transfer.rb +20 -0
- data/lib/stripe/resources/treasury/outbound_payment.rb +20 -0
- data/lib/stripe/resources/treasury/outbound_transfer.rb +20 -0
- data/lib/stripe/resources/treasury/received_credit.rb +10 -0
- data/lib/stripe/resources/treasury/received_debit.rb +10 -0
- data/lib/stripe/resources/treasury/transaction.rb +10 -0
- data/lib/stripe/resources/treasury/transaction_entry.rb +10 -0
- data/lib/stripe/resources/webhook_endpoint.rb +50 -0
- data/lib/stripe/search_result_object.rb +1 -1
- data/lib/stripe/version.rb +1 -1
- metadata +2 -2
@@ -12,6 +12,46 @@ module Stripe
|
|
12
12
|
extend Stripe::APIOperations::List
|
13
13
|
|
14
14
|
OBJECT_NAME = "radar.value_list_item"
|
15
|
+
|
16
|
+
# Creates a new ValueListItem object, which is added to the specified parent value list.
|
17
|
+
def self.create(params = {}, opts = {})
|
18
|
+
request_stripe_object(
|
19
|
+
method: :post,
|
20
|
+
path: "/v1/radar/value_list_items",
|
21
|
+
params: params,
|
22
|
+
opts: opts
|
23
|
+
)
|
24
|
+
end
|
25
|
+
|
26
|
+
# Deletes a ValueListItem object, removing it from its parent value list.
|
27
|
+
def self.delete(id, params = {}, opts = {})
|
28
|
+
request_stripe_object(
|
29
|
+
method: :delete,
|
30
|
+
path: format("/v1/radar/value_list_items/%<id>s", { id: CGI.escape(id) }),
|
31
|
+
params: params,
|
32
|
+
opts: opts
|
33
|
+
)
|
34
|
+
end
|
35
|
+
|
36
|
+
# Deletes a ValueListItem object, removing it from its parent value list.
|
37
|
+
def delete(params = {}, opts = {})
|
38
|
+
request_stripe_object(
|
39
|
+
method: :delete,
|
40
|
+
path: format("/v1/radar/value_list_items/%<item>s", { item: CGI.escape(self["id"]) }),
|
41
|
+
params: params,
|
42
|
+
opts: opts
|
43
|
+
)
|
44
|
+
end
|
45
|
+
|
46
|
+
# Returns a list of ValueListItem objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
|
47
|
+
def self.list(filters = {}, opts = {})
|
48
|
+
request_stripe_object(
|
49
|
+
method: :get,
|
50
|
+
path: "/v1/radar/value_list_items",
|
51
|
+
params: filters,
|
52
|
+
opts: opts
|
53
|
+
)
|
54
|
+
end
|
15
55
|
end
|
16
56
|
end
|
17
57
|
end
|
@@ -38,6 +38,42 @@ module Stripe
|
|
38
38
|
)
|
39
39
|
end
|
40
40
|
|
41
|
+
def self.list(filters = {}, opts = {})
|
42
|
+
request_stripe_object(
|
43
|
+
method: :get,
|
44
|
+
path: format("/v1/refunds"),
|
45
|
+
params: filters,
|
46
|
+
opts: opts
|
47
|
+
)
|
48
|
+
end
|
49
|
+
|
50
|
+
# When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it.
|
51
|
+
#
|
52
|
+
# Creating a new refund will refund a charge that has previously been created but not yet refunded.
|
53
|
+
# Funds will be refunded to the credit or debit card that was originally charged.
|
54
|
+
#
|
55
|
+
# You can optionally refund only part of a charge.
|
56
|
+
# You can do so multiple times, until the entire charge has been refunded.
|
57
|
+
#
|
58
|
+
# Once entirely refunded, a charge can't be refunded again.
|
59
|
+
# This method will raise an error when called on an already-refunded charge,
|
60
|
+
# or when trying to refund more money than is left on a charge.
|
61
|
+
def self.create(params = {}, opts = {})
|
62
|
+
request_stripe_object(method: :post, path: "/v1/refunds", params: params, opts: opts)
|
63
|
+
end
|
64
|
+
|
65
|
+
# Updates the refund that you specify by setting the values of the passed parameters. Any parameters that you don't provide remain unchanged.
|
66
|
+
#
|
67
|
+
# This request only accepts metadata as an argument.
|
68
|
+
def self.update(id, params = {}, opts = {})
|
69
|
+
request_stripe_object(
|
70
|
+
method: :post,
|
71
|
+
path: format("/v1/refunds/%<id>s", { id: CGI.escape(id) }),
|
72
|
+
params: params,
|
73
|
+
opts: opts
|
74
|
+
)
|
75
|
+
end
|
76
|
+
|
41
77
|
def test_helpers
|
42
78
|
TestHelpers.new(self)
|
43
79
|
end
|
@@ -16,6 +16,26 @@ module Stripe
|
|
16
16
|
extend Stripe::APIOperations::List
|
17
17
|
|
18
18
|
OBJECT_NAME = "reporting.report_run"
|
19
|
+
|
20
|
+
# Creates a new object and begin running the report. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).)
|
21
|
+
def self.create(params = {}, opts = {})
|
22
|
+
request_stripe_object(
|
23
|
+
method: :post,
|
24
|
+
path: "/v1/reporting/report_runs",
|
25
|
+
params: params,
|
26
|
+
opts: opts
|
27
|
+
)
|
28
|
+
end
|
29
|
+
|
30
|
+
# Returns a list of Report Runs, with the most recent appearing first.
|
31
|
+
def self.list(filters = {}, opts = {})
|
32
|
+
request_stripe_object(
|
33
|
+
method: :get,
|
34
|
+
path: "/v1/reporting/report_runs",
|
35
|
+
params: filters,
|
36
|
+
opts: opts
|
37
|
+
)
|
38
|
+
end
|
19
39
|
end
|
20
40
|
end
|
21
41
|
end
|
@@ -15,6 +15,16 @@ module Stripe
|
|
15
15
|
extend Stripe::APIOperations::List
|
16
16
|
|
17
17
|
OBJECT_NAME = "reporting.report_type"
|
18
|
+
|
19
|
+
# Returns a full list of Report Types.
|
20
|
+
def self.list(filters = {}, opts = {})
|
21
|
+
request_stripe_object(
|
22
|
+
method: :get,
|
23
|
+
path: "/v1/reporting/report_types",
|
24
|
+
params: filters,
|
25
|
+
opts: opts
|
26
|
+
)
|
27
|
+
end
|
18
28
|
end
|
19
29
|
end
|
20
30
|
end
|
@@ -30,5 +30,10 @@ module Stripe
|
|
30
30
|
opts: opts
|
31
31
|
)
|
32
32
|
end
|
33
|
+
|
34
|
+
# Returns a list of Review objects that have open set to true. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
|
35
|
+
def self.list(filters = {}, opts = {})
|
36
|
+
request_stripe_object(method: :get, path: "/v1/reviews", params: filters, opts: opts)
|
37
|
+
end
|
33
38
|
end
|
34
39
|
end
|
@@ -10,5 +10,10 @@ module Stripe
|
|
10
10
|
extend Stripe::APIOperations::List
|
11
11
|
|
12
12
|
OBJECT_NAME = "setup_attempt"
|
13
|
+
|
14
|
+
# Returns a list of SetupAttempts that associate with a provided SetupIntent.
|
15
|
+
def self.list(filters = {}, opts = {})
|
16
|
+
request_stripe_object(method: :get, path: "/v1/setup_attempts", params: filters, opts: opts)
|
17
|
+
end
|
13
18
|
end
|
14
19
|
end
|
@@ -119,5 +119,28 @@ module Stripe
|
|
119
119
|
opts: opts
|
120
120
|
)
|
121
121
|
end
|
122
|
+
|
123
|
+
# Creates a SetupIntent object.
|
124
|
+
#
|
125
|
+
# After you create the SetupIntent, attach a payment method and [confirm](https://stripe.com/docs/api/setup_intents/confirm)
|
126
|
+
# it to collect any required permissions to charge the payment method later.
|
127
|
+
def self.create(params = {}, opts = {})
|
128
|
+
request_stripe_object(method: :post, path: "/v1/setup_intents", params: params, opts: opts)
|
129
|
+
end
|
130
|
+
|
131
|
+
# Returns a list of SetupIntents.
|
132
|
+
def self.list(filters = {}, opts = {})
|
133
|
+
request_stripe_object(method: :get, path: "/v1/setup_intents", params: filters, opts: opts)
|
134
|
+
end
|
135
|
+
|
136
|
+
# Updates a SetupIntent object.
|
137
|
+
def self.update(id, params = {}, opts = {})
|
138
|
+
request_stripe_object(
|
139
|
+
method: :post,
|
140
|
+
path: format("/v1/setup_intents/%<id>s", { id: CGI.escape(id) }),
|
141
|
+
params: params,
|
142
|
+
opts: opts
|
143
|
+
)
|
144
|
+
end
|
122
145
|
end
|
123
146
|
end
|
@@ -10,5 +10,25 @@ module Stripe
|
|
10
10
|
include Stripe::APIOperations::Save
|
11
11
|
|
12
12
|
OBJECT_NAME = "shipping_rate"
|
13
|
+
|
14
|
+
# Creates a new shipping rate object.
|
15
|
+
def self.create(params = {}, opts = {})
|
16
|
+
request_stripe_object(method: :post, path: "/v1/shipping_rates", params: params, opts: opts)
|
17
|
+
end
|
18
|
+
|
19
|
+
# Returns a list of your shipping rates.
|
20
|
+
def self.list(filters = {}, opts = {})
|
21
|
+
request_stripe_object(method: :get, path: "/v1/shipping_rates", params: filters, opts: opts)
|
22
|
+
end
|
23
|
+
|
24
|
+
# Updates an existing shipping rate object.
|
25
|
+
def self.update(id, params = {}, opts = {})
|
26
|
+
request_stripe_object(
|
27
|
+
method: :post,
|
28
|
+
path: format("/v1/shipping_rates/%<id>s", { id: CGI.escape(id) }),
|
29
|
+
params: params,
|
30
|
+
opts: opts
|
31
|
+
)
|
32
|
+
end
|
13
33
|
end
|
14
34
|
end
|
@@ -15,6 +15,16 @@ module Stripe
|
|
15
15
|
def self.resource_url
|
16
16
|
"/v1/sigma/scheduled_query_runs"
|
17
17
|
end
|
18
|
+
|
19
|
+
# Returns a list of scheduled query runs.
|
20
|
+
def self.list(filters = {}, opts = {})
|
21
|
+
request_stripe_object(
|
22
|
+
method: :get,
|
23
|
+
path: "/v1/sigma/scheduled_query_runs",
|
24
|
+
params: filters,
|
25
|
+
opts: opts
|
26
|
+
)
|
27
|
+
end
|
18
28
|
end
|
19
29
|
end
|
20
30
|
end
|
@@ -64,5 +64,22 @@ module Stripe
|
|
64
64
|
end
|
65
65
|
extend Gem::Deprecate
|
66
66
|
deprecate :source_transactions, :"Source.list_source_transactions", 2020, 1
|
67
|
+
|
68
|
+
# Creates a new source object.
|
69
|
+
def self.create(params = {}, opts = {})
|
70
|
+
request_stripe_object(method: :post, path: "/v1/sources", params: params, opts: opts)
|
71
|
+
end
|
72
|
+
|
73
|
+
# Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
74
|
+
#
|
75
|
+
# This request accepts the metadata and owner as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our [payment method guides](https://stripe.com/docs/sources) for more detail.
|
76
|
+
def self.update(id, params = {}, opts = {})
|
77
|
+
request_stripe_object(
|
78
|
+
method: :post,
|
79
|
+
path: format("/v1/sources/%<id>s", { id: CGI.escape(id) }),
|
80
|
+
params: params,
|
81
|
+
opts: opts
|
82
|
+
)
|
83
|
+
end
|
67
84
|
end
|
68
85
|
end
|
@@ -83,6 +83,22 @@ module Stripe
|
|
83
83
|
|
84
84
|
save_nested_resource :source
|
85
85
|
|
86
|
+
# Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions.
|
87
|
+
#
|
88
|
+
# When you create a subscription with collection_method=charge_automatically, the first invoice is finalized as part of the request.
|
89
|
+
# The payment_behavior parameter determines the exact behavior of the initial payment.
|
90
|
+
#
|
91
|
+
# To start subscriptions where the first invoice always begins in a draft status, use [subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules#managing) instead.
|
92
|
+
# Schedules provide the flexibility to model more complex billing configurations that change over time.
|
93
|
+
def self.create(params = {}, opts = {})
|
94
|
+
request_stripe_object(method: :post, path: "/v1/subscriptions", params: params, opts: opts)
|
95
|
+
end
|
96
|
+
|
97
|
+
# By default, returns a list of subscriptions that have not been canceled. In order to list canceled subscriptions, specify status=canceled.
|
98
|
+
def self.list(filters = {}, opts = {})
|
99
|
+
request_stripe_object(method: :get, path: "/v1/subscriptions", params: filters, opts: opts)
|
100
|
+
end
|
101
|
+
|
86
102
|
def self.search(params = {}, opts = {})
|
87
103
|
request_stripe_object(
|
88
104
|
method: :get,
|
@@ -95,5 +111,35 @@ module Stripe
|
|
95
111
|
def self.search_auto_paging_each(params = {}, opts = {}, &blk)
|
96
112
|
search(params, opts).auto_paging_each(&blk)
|
97
113
|
end
|
114
|
+
|
115
|
+
# Updates an existing subscription to match the specified parameters.
|
116
|
+
# When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes.
|
117
|
+
# To preview how the proration is calculated, use the [upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) endpoint.
|
118
|
+
#
|
119
|
+
# By default, we prorate subscription changes. For example, if a customer signs up on May 1 for a 100 price, they'll be billed 100 immediately. If on May 15 they switch to a 200 price, then on June 1 they'll be billed 250 (200 for a renewal of her subscription, plus a 50 prorating adjustment for half of the previous month's 100 difference). Similarly, a downgrade generates a credit that is applied to the next invoice. We also prorate when you make quantity changes.
|
120
|
+
#
|
121
|
+
# Switching prices does not normally change the billing date or generate an immediate charge unless:
|
122
|
+
#
|
123
|
+
#
|
124
|
+
# The billing interval is changed (for example, from monthly to yearly).
|
125
|
+
# The subscription moves from free to paid, or paid to free.
|
126
|
+
# A trial starts or ends.
|
127
|
+
#
|
128
|
+
#
|
129
|
+
# In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date.
|
130
|
+
#
|
131
|
+
# If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create).
|
132
|
+
#
|
133
|
+
# If you don't want to prorate, set the proration_behavior option to none. With this option, the customer is billed 100 on May 1 and 200 on June 1. Similarly, if you set proration_behavior to none when switching between different billing intervals (for example, from monthly to yearly), we don't generate any credits for the old subscription's unused time. We still reset the billing date and bill immediately for the new subscription.
|
134
|
+
#
|
135
|
+
# Updating the quantity on a subscription many times in an hour may result in [rate limiting. If you need to bill for a frequently changing quantity, consider integrating <a href="/docs/billing/subscriptions/usage-based">usage-based billing](https://stripe.com/docs/rate-limits) instead.
|
136
|
+
def self.update(id, params = {}, opts = {})
|
137
|
+
request_stripe_object(
|
138
|
+
method: :post,
|
139
|
+
path: format("/v1/subscriptions/%<id>s", { id: CGI.escape(id) }),
|
140
|
+
params: params,
|
141
|
+
opts: opts
|
142
|
+
)
|
143
|
+
end
|
98
144
|
end
|
99
145
|
end
|
@@ -17,5 +17,55 @@ module Stripe
|
|
17
17
|
nested_resource_class_methods :usage_record_summary,
|
18
18
|
operations: %i[list],
|
19
19
|
resource_plural: "usage_record_summaries"
|
20
|
+
|
21
|
+
# Adds a new item to an existing subscription. No existing items will be changed or replaced.
|
22
|
+
def self.create(params = {}, opts = {})
|
23
|
+
request_stripe_object(
|
24
|
+
method: :post,
|
25
|
+
path: "/v1/subscription_items",
|
26
|
+
params: params,
|
27
|
+
opts: opts
|
28
|
+
)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription.
|
32
|
+
def self.delete(id, params = {}, opts = {})
|
33
|
+
request_stripe_object(
|
34
|
+
method: :delete,
|
35
|
+
path: format("/v1/subscription_items/%<id>s", { id: CGI.escape(id) }),
|
36
|
+
params: params,
|
37
|
+
opts: opts
|
38
|
+
)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription.
|
42
|
+
def delete(params = {}, opts = {})
|
43
|
+
request_stripe_object(
|
44
|
+
method: :delete,
|
45
|
+
path: format("/v1/subscription_items/%<item>s", { item: CGI.escape(self["id"]) }),
|
46
|
+
params: params,
|
47
|
+
opts: opts
|
48
|
+
)
|
49
|
+
end
|
50
|
+
|
51
|
+
# Returns a list of your subscription items for a given subscription.
|
52
|
+
def self.list(filters = {}, opts = {})
|
53
|
+
request_stripe_object(
|
54
|
+
method: :get,
|
55
|
+
path: "/v1/subscription_items",
|
56
|
+
params: filters,
|
57
|
+
opts: opts
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
# Updates the plan or quantity of an item on a current subscription.
|
62
|
+
def self.update(id, params = {}, opts = {})
|
63
|
+
request_stripe_object(
|
64
|
+
method: :post,
|
65
|
+
path: format("/v1/subscription_items/%<id>s", { id: CGI.escape(id) }),
|
66
|
+
params: params,
|
67
|
+
opts: opts
|
68
|
+
)
|
69
|
+
end
|
20
70
|
end
|
21
71
|
end
|
@@ -71,5 +71,35 @@ module Stripe
|
|
71
71
|
opts: opts
|
72
72
|
)
|
73
73
|
end
|
74
|
+
|
75
|
+
# Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions.
|
76
|
+
def self.create(params = {}, opts = {})
|
77
|
+
request_stripe_object(
|
78
|
+
method: :post,
|
79
|
+
path: "/v1/subscription_schedules",
|
80
|
+
params: params,
|
81
|
+
opts: opts
|
82
|
+
)
|
83
|
+
end
|
84
|
+
|
85
|
+
# Retrieves the list of your subscription schedules.
|
86
|
+
def self.list(filters = {}, opts = {})
|
87
|
+
request_stripe_object(
|
88
|
+
method: :get,
|
89
|
+
path: "/v1/subscription_schedules",
|
90
|
+
params: filters,
|
91
|
+
opts: opts
|
92
|
+
)
|
93
|
+
end
|
94
|
+
|
95
|
+
# Updates an existing subscription schedule.
|
96
|
+
def self.update(id, params = {}, opts = {})
|
97
|
+
request_stripe_object(
|
98
|
+
method: :post,
|
99
|
+
path: format("/v1/subscription_schedules/%<id>s", { id: CGI.escape(id) }),
|
100
|
+
params: params,
|
101
|
+
opts: opts
|
102
|
+
)
|
103
|
+
end
|
74
104
|
end
|
75
105
|
end
|
@@ -30,6 +30,16 @@ module Stripe
|
|
30
30
|
opts: opts
|
31
31
|
)
|
32
32
|
end
|
33
|
+
|
34
|
+
# Calculates tax based on input and returns a Tax Calculation object.
|
35
|
+
def self.create(params = {}, opts = {})
|
36
|
+
request_stripe_object(
|
37
|
+
method: :post,
|
38
|
+
path: "/v1/tax/calculations",
|
39
|
+
params: params,
|
40
|
+
opts: opts
|
41
|
+
)
|
42
|
+
end
|
33
43
|
end
|
34
44
|
end
|
35
45
|
end
|
@@ -36,6 +36,11 @@ module Stripe
|
|
36
36
|
&read_body_chunk_block
|
37
37
|
)
|
38
38
|
end
|
39
|
+
|
40
|
+
# Returns a list of tax forms which were previously created. The tax forms are returned in sorted order, with the oldest tax forms appearing first.
|
41
|
+
def self.list(filters = {}, opts = {})
|
42
|
+
request_stripe_object(method: :get, path: "/v1/tax/forms", params: filters, opts: opts)
|
43
|
+
end
|
39
44
|
end
|
40
45
|
end
|
41
46
|
end
|
@@ -14,6 +14,38 @@ module Stripe
|
|
14
14
|
include Stripe::APIOperations::Save
|
15
15
|
|
16
16
|
OBJECT_NAME = "tax.registration"
|
17
|
+
|
18
|
+
# Creates a new Tax Registration object.
|
19
|
+
def self.create(params = {}, opts = {})
|
20
|
+
request_stripe_object(
|
21
|
+
method: :post,
|
22
|
+
path: "/v1/tax/registrations",
|
23
|
+
params: params,
|
24
|
+
opts: opts
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
# Returns a list of Tax Registration objects.
|
29
|
+
def self.list(filters = {}, opts = {})
|
30
|
+
request_stripe_object(
|
31
|
+
method: :get,
|
32
|
+
path: "/v1/tax/registrations",
|
33
|
+
params: filters,
|
34
|
+
opts: opts
|
35
|
+
)
|
36
|
+
end
|
37
|
+
|
38
|
+
# Updates an existing Tax Registration object.
|
39
|
+
#
|
40
|
+
# A registration cannot be deleted after it has been created. If you wish to end a registration you may do so by setting expires_at.
|
41
|
+
def self.update(id, params = {}, opts = {})
|
42
|
+
request_stripe_object(
|
43
|
+
method: :post,
|
44
|
+
path: format("/v1/tax/registrations/%<id>s", { id: CGI.escape(id) }),
|
45
|
+
params: params,
|
46
|
+
opts: opts
|
47
|
+
)
|
48
|
+
end
|
17
49
|
end
|
18
50
|
end
|
19
51
|
end
|
@@ -7,5 +7,10 @@ module Stripe
|
|
7
7
|
extend Stripe::APIOperations::List
|
8
8
|
|
9
9
|
OBJECT_NAME = "tax_code"
|
10
|
+
|
11
|
+
# A list of [all tax codes available](https://stripe.com/docs/tax/tax-categories) to add to Products in order to allow specific tax calculations.
|
12
|
+
def self.list(filters = {}, opts = {})
|
13
|
+
request_stripe_object(method: :get, path: "/v1/tax_codes", params: filters, opts: opts)
|
14
|
+
end
|
10
15
|
end
|
11
16
|
end
|
@@ -26,5 +26,25 @@ module Stripe
|
|
26
26
|
"tax ID using `Customer.retrieve_tax_id('customer_id', " \
|
27
27
|
"'tax_id_id')`"
|
28
28
|
end
|
29
|
+
|
30
|
+
# Deletes an existing tax_id object.
|
31
|
+
def self.delete(id, params = {}, opts = {})
|
32
|
+
request_stripe_object(
|
33
|
+
method: :delete,
|
34
|
+
path: format("/v1/customers/%<customer>s/tax_ids/%<id>s", { customer: CGI.escape(customer), id: CGI.escape(id) }),
|
35
|
+
params: params,
|
36
|
+
opts: opts
|
37
|
+
)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Deletes an existing tax_id object.
|
41
|
+
def delete(params = {}, opts = {})
|
42
|
+
request_stripe_object(
|
43
|
+
method: :delete,
|
44
|
+
path: format("/v1/customers/%<customer>s/tax_ids/%<id>s", { customer: CGI.escape(self["id"]), id: CGI.escape(id) }),
|
45
|
+
params: params,
|
46
|
+
opts: opts
|
47
|
+
)
|
48
|
+
end
|
29
49
|
end
|
30
50
|
end
|
@@ -11,5 +11,25 @@ module Stripe
|
|
11
11
|
include Stripe::APIOperations::Save
|
12
12
|
|
13
13
|
OBJECT_NAME = "tax_rate"
|
14
|
+
|
15
|
+
# Creates a new tax rate.
|
16
|
+
def self.create(params = {}, opts = {})
|
17
|
+
request_stripe_object(method: :post, path: "/v1/tax_rates", params: params, opts: opts)
|
18
|
+
end
|
19
|
+
|
20
|
+
# Returns a list of your tax rates. Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first.
|
21
|
+
def self.list(filters = {}, opts = {})
|
22
|
+
request_stripe_object(method: :get, path: "/v1/tax_rates", params: filters, opts: opts)
|
23
|
+
end
|
24
|
+
|
25
|
+
# Updates an existing tax rate.
|
26
|
+
def self.update(id, params = {}, opts = {})
|
27
|
+
request_stripe_object(
|
28
|
+
method: :post,
|
29
|
+
path: format("/v1/tax_rates/%<id>s", { id: CGI.escape(id) }),
|
30
|
+
params: params,
|
31
|
+
opts: opts
|
32
|
+
)
|
33
|
+
end
|
14
34
|
end
|
15
35
|
end
|
@@ -11,6 +11,56 @@ module Stripe
|
|
11
11
|
include Stripe::APIOperations::Save
|
12
12
|
|
13
13
|
OBJECT_NAME = "terminal.configuration"
|
14
|
+
|
15
|
+
# Creates a new Configuration object.
|
16
|
+
def self.create(params = {}, opts = {})
|
17
|
+
request_stripe_object(
|
18
|
+
method: :post,
|
19
|
+
path: "/v1/terminal/configurations",
|
20
|
+
params: params,
|
21
|
+
opts: opts
|
22
|
+
)
|
23
|
+
end
|
24
|
+
|
25
|
+
# Deletes a Configuration object.
|
26
|
+
def self.delete(id, params = {}, opts = {})
|
27
|
+
request_stripe_object(
|
28
|
+
method: :delete,
|
29
|
+
path: format("/v1/terminal/configurations/%<id>s", { id: CGI.escape(id) }),
|
30
|
+
params: params,
|
31
|
+
opts: opts
|
32
|
+
)
|
33
|
+
end
|
34
|
+
|
35
|
+
# Deletes a Configuration object.
|
36
|
+
def delete(params = {}, opts = {})
|
37
|
+
request_stripe_object(
|
38
|
+
method: :delete,
|
39
|
+
path: format("/v1/terminal/configurations/%<configuration>s", { configuration: CGI.escape(self["id"]) }),
|
40
|
+
params: params,
|
41
|
+
opts: opts
|
42
|
+
)
|
43
|
+
end
|
44
|
+
|
45
|
+
# Returns a list of Configuration objects.
|
46
|
+
def self.list(filters = {}, opts = {})
|
47
|
+
request_stripe_object(
|
48
|
+
method: :get,
|
49
|
+
path: "/v1/terminal/configurations",
|
50
|
+
params: filters,
|
51
|
+
opts: opts
|
52
|
+
)
|
53
|
+
end
|
54
|
+
|
55
|
+
# Updates a new Configuration object.
|
56
|
+
def self.update(id, params = {}, opts = {})
|
57
|
+
request_stripe_object(
|
58
|
+
method: :post,
|
59
|
+
path: format("/v1/terminal/configurations/%<id>s", { id: CGI.escape(id) }),
|
60
|
+
params: params,
|
61
|
+
opts: opts
|
62
|
+
)
|
63
|
+
end
|
14
64
|
end
|
15
65
|
end
|
16
66
|
end
|
@@ -10,6 +10,16 @@ module Stripe
|
|
10
10
|
extend Stripe::APIOperations::Create
|
11
11
|
|
12
12
|
OBJECT_NAME = "terminal.connection_token"
|
13
|
+
|
14
|
+
# To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server. On your backend, add an endpoint that creates and returns a connection token.
|
15
|
+
def self.create(params = {}, opts = {})
|
16
|
+
request_stripe_object(
|
17
|
+
method: :post,
|
18
|
+
path: "/v1/terminal/connection_tokens",
|
19
|
+
params: params,
|
20
|
+
opts: opts
|
21
|
+
)
|
22
|
+
end
|
13
23
|
end
|
14
24
|
end
|
15
25
|
end
|
@@ -13,6 +13,57 @@ module Stripe
|
|
13
13
|
include Stripe::APIOperations::Save
|
14
14
|
|
15
15
|
OBJECT_NAME = "terminal.location"
|
16
|
+
|
17
|
+
# Creates a new Location object.
|
18
|
+
# For further details, including which address fields are required in each country, see the [Manage locations](https://stripe.com/docs/terminal/fleet/locations) guide.
|
19
|
+
def self.create(params = {}, opts = {})
|
20
|
+
request_stripe_object(
|
21
|
+
method: :post,
|
22
|
+
path: "/v1/terminal/locations",
|
23
|
+
params: params,
|
24
|
+
opts: opts
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
# Deletes a Location object.
|
29
|
+
def self.delete(id, params = {}, opts = {})
|
30
|
+
request_stripe_object(
|
31
|
+
method: :delete,
|
32
|
+
path: format("/v1/terminal/locations/%<id>s", { id: CGI.escape(id) }),
|
33
|
+
params: params,
|
34
|
+
opts: opts
|
35
|
+
)
|
36
|
+
end
|
37
|
+
|
38
|
+
# Deletes a Location object.
|
39
|
+
def delete(params = {}, opts = {})
|
40
|
+
request_stripe_object(
|
41
|
+
method: :delete,
|
42
|
+
path: format("/v1/terminal/locations/%<location>s", { location: CGI.escape(self["id"]) }),
|
43
|
+
params: params,
|
44
|
+
opts: opts
|
45
|
+
)
|
46
|
+
end
|
47
|
+
|
48
|
+
# Returns a list of Location objects.
|
49
|
+
def self.list(filters = {}, opts = {})
|
50
|
+
request_stripe_object(
|
51
|
+
method: :get,
|
52
|
+
path: "/v1/terminal/locations",
|
53
|
+
params: filters,
|
54
|
+
opts: opts
|
55
|
+
)
|
56
|
+
end
|
57
|
+
|
58
|
+
# Updates a Location object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
59
|
+
def self.update(id, params = {}, opts = {})
|
60
|
+
request_stripe_object(
|
61
|
+
method: :post,
|
62
|
+
path: format("/v1/terminal/locations/%<id>s", { id: CGI.escape(id) }),
|
63
|
+
params: params,
|
64
|
+
opts: opts
|
65
|
+
)
|
66
|
+
end
|
16
67
|
end
|
17
68
|
end
|
18
69
|
end
|