stripe 10.11.0 → 10.12.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 +292 -48
- data/OPENAPI_VERSION +1 -1
- data/README.md +11 -0
- data/VERSION +1 -1
- data/lib/stripe/api_operations/request.rb +2 -1
- data/lib/stripe/api_version.rb +1 -0
- data/lib/stripe/object_types.rb +22 -0
- data/lib/stripe/request_signing_authenticator.rb +79 -0
- data/lib/stripe/resources/account.rb +69 -69
- data/lib/stripe/resources/account_notice.rb +32 -0
- data/lib/stripe/resources/apple_pay_domain.rb +4 -4
- data/lib/stripe/resources/apps/secret.rb +5 -5
- data/lib/stripe/resources/capital/financing_offer.rb +49 -0
- data/lib/stripe/resources/capital/financing_summary.rb +15 -0
- data/lib/stripe/resources/capital/financing_transaction.rb +27 -0
- data/lib/stripe/resources/checkout/session.rb +21 -21
- data/lib/stripe/resources/confirmation_token.rb +16 -0
- data/lib/stripe/resources/credit_note.rb +35 -35
- data/lib/stripe/resources/customer.rb +66 -55
- data/lib/stripe/resources/customer_entitlement.rb +12 -0
- data/lib/stripe/resources/customer_entitlement_summary.rb +12 -0
- data/lib/stripe/resources/entitlements/feature.rb +38 -0
- data/lib/stripe/resources/ephemeral_key.rb +9 -9
- data/lib/stripe/resources/file.rb +5 -5
- data/lib/stripe/resources/financial_connections/account.rb +37 -34
- data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +14 -0
- data/lib/stripe/resources/gift_cards/card.rb +59 -0
- data/lib/stripe/resources/gift_cards/transaction.rb +93 -0
- data/lib/stripe/resources/identity/verification_session.rb +38 -38
- data/lib/stripe/resources/invoice.rb +113 -60
- data/lib/stripe/resources/invoice_payment.rb +12 -0
- data/lib/stripe/resources/issuing/authorization.rb +8 -8
- data/lib/stripe/resources/issuing/credit_underwriting_record.rb +88 -0
- data/lib/stripe/resources/issuing/dispute.rb +16 -16
- data/lib/stripe/resources/issuing/personalization_design.rb +119 -0
- data/lib/stripe/resources/issuing/physical_bundle.rb +26 -0
- data/lib/stripe/resources/margin.rb +37 -0
- data/lib/stripe/resources/order.rb +120 -0
- data/lib/stripe/resources/payment_intent.rb +150 -100
- data/lib/stripe/resources/payment_link.rb +10 -10
- data/lib/stripe/resources/payment_method.rb +17 -17
- data/lib/stripe/resources/payment_method_domain.rb +29 -29
- data/lib/stripe/resources/payout.rb +22 -22
- data/lib/stripe/resources/quote.rb +136 -32
- data/lib/stripe/resources/quote_phase.rb +39 -0
- data/lib/stripe/resources/quote_preview_invoice.rb +43 -0
- data/lib/stripe/resources/quote_preview_subscription_schedule.rb +11 -0
- data/lib/stripe/resources/setup_intent.rb +32 -32
- data/lib/stripe/resources/sigma/scheduled_query_run.rb +4 -4
- data/lib/stripe/resources/source.rb +17 -17
- data/lib/stripe/resources/subscription.rb +36 -36
- data/lib/stripe/resources/subscription_schedule.rb +31 -11
- data/lib/stripe/resources/tax/calculation.rb +10 -10
- data/lib/stripe/resources/tax/form.rb +49 -0
- data/lib/stripe/resources/tax/transaction.rb +10 -10
- data/lib/stripe/resources/terminal/reader.rb +101 -41
- data/lib/stripe/resources/treasury/financial_account.rb +25 -25
- data/lib/stripe/resources/treasury/transaction_entry.rb +4 -4
- data/lib/stripe/resources.rb +21 -0
- data/lib/stripe/stripe_client.rb +62 -28
- data/lib/stripe/stripe_configuration.rb +2 -1
- data/lib/stripe/util.rb +8 -1
- data/lib/stripe/version.rb +1 -1
- data/lib/stripe.rb +54 -0
- metadata +25 -3
@@ -15,14 +15,27 @@ module Stripe
|
|
15
15
|
"credit_note"
|
16
16
|
end
|
17
17
|
|
18
|
-
#
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
18
|
+
# Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces
|
19
|
+
# its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result
|
20
|
+
# in any combination of the following:
|
21
|
+
#
|
22
|
+
#
|
23
|
+
# Refund: create a new refund (using refund_amount) or link an existing refund (using refund).
|
24
|
+
# Customer balance credit: credit the customer's balance (using credit_amount) which will be automatically applied to their next invoice when it's finalized.
|
25
|
+
# Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using out_of_band_amount).
|
26
|
+
#
|
27
|
+
#
|
28
|
+
# For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total.
|
29
|
+
#
|
30
|
+
# You may issue multiple credit notes for an invoice. Each credit note will increment the invoice's pre_payment_credit_notes_amount
|
31
|
+
# or post_payment_credit_notes_amount depending on its status at the time of credit note creation.
|
32
|
+
def self.create(params = {}, opts = {})
|
33
|
+
request_stripe_object(method: :post, path: "/v1/credit_notes", params: params, opts: opts)
|
34
|
+
end
|
35
|
+
|
36
|
+
# Returns a list of credit notes.
|
37
|
+
def self.list(filters = {}, opts = {})
|
38
|
+
request_stripe_object(method: :get, path: "/v1/credit_notes", params: filters, opts: opts)
|
26
39
|
end
|
27
40
|
|
28
41
|
# When retrieving a credit note preview, you'll get a lines property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items.
|
@@ -45,44 +58,31 @@ module Stripe
|
|
45
58
|
)
|
46
59
|
end
|
47
60
|
|
48
|
-
#
|
49
|
-
def self.
|
61
|
+
# Updates an existing credit note.
|
62
|
+
def self.update(id, params = {}, opts = {})
|
50
63
|
request_stripe_object(
|
51
64
|
method: :post,
|
52
|
-
path: format("/v1/credit_notes/%<id>s
|
65
|
+
path: format("/v1/credit_notes/%<id>s", { id: CGI.escape(id) }),
|
53
66
|
params: params,
|
54
67
|
opts: opts
|
55
68
|
)
|
56
69
|
end
|
57
70
|
|
58
|
-
#
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
#
|
67
|
-
#
|
68
|
-
# For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total.
|
69
|
-
#
|
70
|
-
# You may issue multiple credit notes for an invoice. Each credit note will increment the invoice's pre_payment_credit_notes_amount
|
71
|
-
# or post_payment_credit_notes_amount depending on its status at the time of credit note creation.
|
72
|
-
def self.create(params = {}, opts = {})
|
73
|
-
request_stripe_object(method: :post, path: "/v1/credit_notes", params: params, opts: opts)
|
74
|
-
end
|
75
|
-
|
76
|
-
# Returns a list of credit notes.
|
77
|
-
def self.list(filters = {}, opts = {})
|
78
|
-
request_stripe_object(method: :get, path: "/v1/credit_notes", params: filters, opts: opts)
|
71
|
+
# Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding).
|
72
|
+
def void_credit_note(params = {}, opts = {})
|
73
|
+
request_stripe_object(
|
74
|
+
method: :post,
|
75
|
+
path: format("/v1/credit_notes/%<id>s/void", { id: CGI.escape(self["id"]) }),
|
76
|
+
params: params,
|
77
|
+
opts: opts
|
78
|
+
)
|
79
79
|
end
|
80
80
|
|
81
|
-
#
|
82
|
-
def self.
|
81
|
+
# Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding).
|
82
|
+
def self.void_credit_note(id, params = {}, opts = {})
|
83
83
|
request_stripe_object(
|
84
84
|
method: :post,
|
85
|
-
path: format("/v1/credit_notes/%<id>s", { id: CGI.escape(id) }),
|
85
|
+
path: format("/v1/credit_notes/%<id>s/void", { id: CGI.escape(id) }),
|
86
86
|
params: params,
|
87
87
|
opts: opts
|
88
88
|
)
|
@@ -22,6 +22,12 @@ module Stripe
|
|
22
22
|
nested_resource_class_methods :cash_balance_transaction, operations: %i[retrieve list]
|
23
23
|
nested_resource_class_methods :source, operations: %i[create retrieve update delete list]
|
24
24
|
nested_resource_class_methods :tax_id, operations: %i[create retrieve delete list]
|
25
|
+
nested_resource_class_methods :entitlement, operations: %i[list]
|
26
|
+
|
27
|
+
# Creates a new customer object.
|
28
|
+
def self.create(params = {}, opts = {})
|
29
|
+
request_stripe_object(method: :post, path: "/v1/customers", params: params, opts: opts)
|
30
|
+
end
|
25
31
|
|
26
32
|
# Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new
|
27
33
|
# funding instructions will be created. If funding instructions have already been created for a given customer, the same
|
@@ -35,43 +41,43 @@ module Stripe
|
|
35
41
|
)
|
36
42
|
end
|
37
43
|
|
38
|
-
#
|
39
|
-
|
44
|
+
# Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new
|
45
|
+
# funding instructions will be created. If funding instructions have already been created for a given customer, the same
|
46
|
+
# funding instructions will be retrieved. In other words, we will return the same funding instructions each time.
|
47
|
+
def self.create_funding_instructions(customer, params = {}, opts = {})
|
40
48
|
request_stripe_object(
|
41
|
-
method: :
|
42
|
-
path: format("/v1/customers/%<customer>s/
|
49
|
+
method: :post,
|
50
|
+
path: format("/v1/customers/%<customer>s/funding_instructions", { customer: CGI.escape(customer) }),
|
43
51
|
params: params,
|
44
52
|
opts: opts
|
45
53
|
)
|
46
54
|
end
|
47
55
|
|
48
|
-
#
|
49
|
-
def
|
56
|
+
# Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer.
|
57
|
+
def self.delete(id, params = {}, opts = {})
|
50
58
|
request_stripe_object(
|
51
|
-
method: :
|
52
|
-
path: format("/v1/customers/%<
|
59
|
+
method: :delete,
|
60
|
+
path: format("/v1/customers/%<id>s", { id: CGI.escape(id) }),
|
53
61
|
params: params,
|
54
62
|
opts: opts
|
55
63
|
)
|
56
64
|
end
|
57
65
|
|
58
|
-
#
|
59
|
-
def
|
66
|
+
# Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer.
|
67
|
+
def delete(params = {}, opts = {})
|
60
68
|
request_stripe_object(
|
61
|
-
method: :
|
62
|
-
path: format("/v1/customers/%<customer>s
|
69
|
+
method: :delete,
|
70
|
+
path: format("/v1/customers/%<customer>s", { customer: CGI.escape(self["id"]) }),
|
63
71
|
params: params,
|
64
72
|
opts: opts
|
65
73
|
)
|
66
74
|
end
|
67
75
|
|
68
|
-
#
|
69
|
-
|
70
|
-
# funding instructions will be retrieved. In other words, we will return the same funding instructions each time.
|
71
|
-
def self.create_funding_instructions(customer, params = {}, opts = {})
|
76
|
+
# Removes the currently applied discount on a customer.
|
77
|
+
def delete_discount(params = {}, opts = {})
|
72
78
|
request_stripe_object(
|
73
|
-
method: :
|
74
|
-
path: format("/v1/customers/%<customer>s/
|
79
|
+
method: :delete,
|
80
|
+
path: format("/v1/customers/%<customer>s/discount", { customer: CGI.escape(self["id"]) }),
|
75
81
|
params: params,
|
76
82
|
opts: opts
|
77
83
|
)
|
@@ -87,62 +93,69 @@ module Stripe
|
|
87
93
|
)
|
88
94
|
end
|
89
95
|
|
96
|
+
# Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first.
|
97
|
+
def self.list(filters = {}, opts = {})
|
98
|
+
request_stripe_object(method: :get, path: "/v1/customers", params: filters, opts: opts)
|
99
|
+
end
|
100
|
+
|
90
101
|
# Returns a list of PaymentMethods for a given Customer
|
91
|
-
def
|
102
|
+
def list_payment_methods(params = {}, opts = {})
|
92
103
|
request_stripe_object(
|
93
104
|
method: :get,
|
94
|
-
path: format("/v1/customers/%<customer>s/payment_methods", { customer: CGI.escape(
|
105
|
+
path: format("/v1/customers/%<customer>s/payment_methods", { customer: CGI.escape(self["id"]) }),
|
95
106
|
params: params,
|
96
107
|
opts: opts
|
97
108
|
)
|
98
109
|
end
|
99
110
|
|
100
|
-
#
|
101
|
-
def self.
|
111
|
+
# Returns a list of PaymentMethods for a given Customer
|
112
|
+
def self.list_payment_methods(customer, params = {}, opts = {})
|
102
113
|
request_stripe_object(
|
103
114
|
method: :get,
|
104
|
-
path: format("/v1/customers/%<customer>s/payment_methods
|
115
|
+
path: format("/v1/customers/%<customer>s/payment_methods", { customer: CGI.escape(customer) }),
|
105
116
|
params: params,
|
106
117
|
opts: opts
|
107
118
|
)
|
108
119
|
end
|
109
120
|
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
# Creates a new customer object.
|
119
|
-
def self.create(params = {}, opts = {})
|
120
|
-
request_stripe_object(method: :post, path: "/v1/customers", params: params, opts: opts)
|
121
|
+
# Retrieves a customer's cash balance.
|
122
|
+
def self.retrieve_cash_balance(customer, params = {}, opts = {})
|
123
|
+
request_stripe_object(
|
124
|
+
method: :get,
|
125
|
+
path: format("/v1/customers/%<customer>s/cash_balance", { customer: CGI.escape(customer) }),
|
126
|
+
params: params,
|
127
|
+
opts: opts
|
128
|
+
)
|
121
129
|
end
|
122
130
|
|
123
|
-
#
|
124
|
-
def self.
|
131
|
+
# Retrieve the entitlement summary for a customer
|
132
|
+
def self.retrieve_entitlement_summary(customer, params = {}, opts = {})
|
125
133
|
request_stripe_object(
|
126
|
-
method: :
|
127
|
-
path: format("/v1/customers/%<
|
134
|
+
method: :get,
|
135
|
+
path: format("/v1/customers/%<customer>s/entitlement_summary", { customer: CGI.escape(customer) }),
|
128
136
|
params: params,
|
129
137
|
opts: opts
|
130
138
|
)
|
131
139
|
end
|
132
140
|
|
133
|
-
#
|
134
|
-
def
|
141
|
+
# Retrieves a PaymentMethod object for a given Customer.
|
142
|
+
def retrieve_payment_method(payment_method, params = {}, opts = {})
|
135
143
|
request_stripe_object(
|
136
|
-
method: :
|
137
|
-
path: format("/v1/customers/%<customer>s", { customer: CGI.escape(self["id"]) }),
|
144
|
+
method: :get,
|
145
|
+
path: format("/v1/customers/%<customer>s/payment_methods/%<payment_method>s", { customer: CGI.escape(self["id"]), payment_method: CGI.escape(payment_method) }),
|
138
146
|
params: params,
|
139
147
|
opts: opts
|
140
148
|
)
|
141
149
|
end
|
142
150
|
|
143
|
-
#
|
144
|
-
def self.
|
145
|
-
request_stripe_object(
|
151
|
+
# Retrieves a PaymentMethod object for a given Customer.
|
152
|
+
def self.retrieve_payment_method(customer, payment_method, params = {}, opts = {})
|
153
|
+
request_stripe_object(
|
154
|
+
method: :get,
|
155
|
+
path: format("/v1/customers/%<customer>s/payment_methods/%<payment_method>s", { customer: CGI.escape(customer), payment_method: CGI.escape(payment_method) }),
|
156
|
+
params: params,
|
157
|
+
opts: opts
|
158
|
+
)
|
146
159
|
end
|
147
160
|
|
148
161
|
def self.search(params = {}, opts = {})
|
@@ -165,16 +178,6 @@ module Stripe
|
|
165
178
|
)
|
166
179
|
end
|
167
180
|
|
168
|
-
# Retrieves a customer's cash balance.
|
169
|
-
def self.retrieve_cash_balance(customer, params = {}, opts = {})
|
170
|
-
request_stripe_object(
|
171
|
-
method: :get,
|
172
|
-
path: format("/v1/customers/%<customer>s/cash_balance", { customer: CGI.escape(customer) }),
|
173
|
-
params: params,
|
174
|
-
opts: opts
|
175
|
-
)
|
176
|
-
end
|
177
|
-
|
178
181
|
# Changes the settings on a customer's cash balance.
|
179
182
|
def self.update_cash_balance(customer, params = {}, opts = {})
|
180
183
|
request_stripe_object(
|
@@ -185,6 +188,14 @@ module Stripe
|
|
185
188
|
)
|
186
189
|
end
|
187
190
|
|
191
|
+
save_nested_resource :source
|
192
|
+
|
193
|
+
# The API request for deleting a card or bank account and for detaching a
|
194
|
+
# source object are the same.
|
195
|
+
class << self
|
196
|
+
alias detach_source delete_source
|
197
|
+
end
|
198
|
+
|
188
199
|
def test_helpers
|
189
200
|
TestHelpers.new(self)
|
190
201
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
# A entitlement for a customer describes access to a feature.
|
6
|
+
class CustomerEntitlement < APIResource
|
7
|
+
OBJECT_NAME = "customer_entitlement"
|
8
|
+
def self.object_name
|
9
|
+
"customer_entitlement"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
# A summary of a customer's entitlements.
|
6
|
+
class CustomerEntitlementSummary < APIResource
|
7
|
+
OBJECT_NAME = "customer_entitlement_summary"
|
8
|
+
def self.object_name
|
9
|
+
"customer_entitlement_summary"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Entitlements
|
6
|
+
# A feature represents a monetizable ability or functionality in your system.
|
7
|
+
# Features can be assigned to products, and when those products are purchased, Stripe will create an entitlement to the feature for the purchasing customer.
|
8
|
+
class Feature < APIResource
|
9
|
+
extend Stripe::APIOperations::Create
|
10
|
+
extend Stripe::APIOperations::List
|
11
|
+
|
12
|
+
OBJECT_NAME = "entitlements.feature"
|
13
|
+
def self.object_name
|
14
|
+
"entitlements.feature"
|
15
|
+
end
|
16
|
+
|
17
|
+
# Creates a feature
|
18
|
+
def self.create(params = {}, opts = {})
|
19
|
+
request_stripe_object(
|
20
|
+
method: :post,
|
21
|
+
path: "/v1/entitlements/features",
|
22
|
+
params: params,
|
23
|
+
opts: opts
|
24
|
+
)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Retrieve a list of features
|
28
|
+
def self.list(filters = {}, opts = {})
|
29
|
+
request_stripe_object(
|
30
|
+
method: :get,
|
31
|
+
path: "/v1/entitlements/features",
|
32
|
+
params: filters,
|
33
|
+
opts: opts
|
34
|
+
)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -11,15 +11,6 @@ module Stripe
|
|
11
11
|
"ephemeral_key"
|
12
12
|
end
|
13
13
|
|
14
|
-
def self.create(params = {}, opts = {})
|
15
|
-
opts = Util.normalize_opts(opts)
|
16
|
-
unless opts[:stripe_version]
|
17
|
-
raise ArgumentError,
|
18
|
-
"stripe_version must be specified to create an ephemeral key"
|
19
|
-
end
|
20
|
-
super
|
21
|
-
end
|
22
|
-
|
23
14
|
# Invalidates a short-lived API key for a given resource.
|
24
15
|
def self.delete(id, params = {}, opts = {})
|
25
16
|
request_stripe_object(
|
@@ -39,5 +30,14 @@ module Stripe
|
|
39
30
|
opts: opts
|
40
31
|
)
|
41
32
|
end
|
33
|
+
|
34
|
+
def self.create(params = {}, opts = {})
|
35
|
+
opts = Util.normalize_opts(opts)
|
36
|
+
unless opts[:stripe_version]
|
37
|
+
raise ArgumentError,
|
38
|
+
"stripe_version must be specified to create an ephemeral key"
|
39
|
+
end
|
40
|
+
super
|
41
|
+
end
|
42
42
|
end
|
43
43
|
end
|
@@ -18,6 +18,11 @@ module Stripe
|
|
18
18
|
"file"
|
19
19
|
end
|
20
20
|
|
21
|
+
# Returns a list of the files that your account has access to. Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top.
|
22
|
+
def self.list(filters = {}, opts = {})
|
23
|
+
request_stripe_object(method: :get, path: "/v1/files", params: filters, opts: opts)
|
24
|
+
end
|
25
|
+
|
21
26
|
# This resource can have two different object names. In latter API
|
22
27
|
# versions, only `file` is used, but since stripe-ruby may be used with
|
23
28
|
# any API version, we need to support deserializing the older
|
@@ -43,10 +48,5 @@ module Stripe
|
|
43
48
|
}.merge(Util.normalize_opts(opts))
|
44
49
|
super
|
45
50
|
end
|
46
|
-
|
47
|
-
# Returns a list of the files that your account has access to. Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top.
|
48
|
-
def self.list(filters = {}, opts = {})
|
49
|
-
request_stripe_object(method: :get, path: "/v1/files", params: filters, opts: opts)
|
50
|
-
end
|
51
51
|
end
|
52
52
|
end
|
@@ -6,12 +6,15 @@ module Stripe
|
|
6
6
|
# A Financial Connections Account represents an account that exists outside of Stripe, to which you have been granted some degree of access.
|
7
7
|
class Account < APIResource
|
8
8
|
extend Stripe::APIOperations::List
|
9
|
+
extend Stripe::APIOperations::NestedResource
|
9
10
|
|
10
11
|
OBJECT_NAME = "financial_connections.account"
|
11
12
|
def self.object_name
|
12
13
|
"financial_connections.account"
|
13
14
|
end
|
14
15
|
|
16
|
+
nested_resource_class_methods :inferred_balance, operations: %i[list]
|
17
|
+
|
15
18
|
# Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions).
|
16
19
|
def disconnect(params = {}, opts = {})
|
17
20
|
request_stripe_object(
|
@@ -22,71 +25,71 @@ module Stripe
|
|
22
25
|
)
|
23
26
|
end
|
24
27
|
|
25
|
-
#
|
26
|
-
def
|
28
|
+
# Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions).
|
29
|
+
def self.disconnect(account, params = {}, opts = {})
|
27
30
|
request_stripe_object(
|
28
|
-
method: :
|
29
|
-
path: format("/v1/financial_connections/accounts/%<account>s/
|
31
|
+
method: :post,
|
32
|
+
path: format("/v1/financial_connections/accounts/%<account>s/disconnect", { account: CGI.escape(account) }),
|
30
33
|
params: params,
|
31
34
|
opts: opts
|
32
35
|
)
|
33
36
|
end
|
34
37
|
|
35
|
-
#
|
36
|
-
def
|
38
|
+
# Returns a list of Financial Connections Account objects.
|
39
|
+
def self.list(filters = {}, opts = {})
|
37
40
|
request_stripe_object(
|
38
|
-
method: :
|
39
|
-
path:
|
40
|
-
params:
|
41
|
+
method: :get,
|
42
|
+
path: "/v1/financial_connections/accounts",
|
43
|
+
params: filters,
|
41
44
|
opts: opts
|
42
45
|
)
|
43
46
|
end
|
44
47
|
|
45
|
-
#
|
46
|
-
def
|
48
|
+
# Lists all owners for a given Account
|
49
|
+
def list_owners(params = {}, opts = {})
|
47
50
|
request_stripe_object(
|
48
|
-
method: :
|
49
|
-
path: format("/v1/financial_connections/accounts/%<account>s/
|
51
|
+
method: :get,
|
52
|
+
path: format("/v1/financial_connections/accounts/%<account>s/owners", { account: CGI.escape(self["id"]) }),
|
50
53
|
params: params,
|
51
54
|
opts: opts
|
52
55
|
)
|
53
56
|
end
|
54
57
|
|
55
|
-
#
|
56
|
-
def
|
58
|
+
# Lists all owners for a given Account
|
59
|
+
def self.list_owners(account, params = {}, opts = {})
|
57
60
|
request_stripe_object(
|
58
|
-
method: :
|
59
|
-
path: format("/v1/financial_connections/accounts/%<account>s/
|
61
|
+
method: :get,
|
62
|
+
path: format("/v1/financial_connections/accounts/%<account>s/owners", { account: CGI.escape(account) }),
|
60
63
|
params: params,
|
61
64
|
opts: opts
|
62
65
|
)
|
63
66
|
end
|
64
67
|
|
65
|
-
#
|
66
|
-
def
|
68
|
+
# Refreshes the data associated with a Financial Connections Account.
|
69
|
+
def refresh_account(params = {}, opts = {})
|
67
70
|
request_stripe_object(
|
68
71
|
method: :post,
|
69
|
-
path: format("/v1/financial_connections/accounts/%<account>s/
|
72
|
+
path: format("/v1/financial_connections/accounts/%<account>s/refresh", { account: CGI.escape(self["id"]) }),
|
70
73
|
params: params,
|
71
74
|
opts: opts
|
72
75
|
)
|
73
76
|
end
|
74
77
|
|
75
|
-
#
|
76
|
-
def self.
|
78
|
+
# Refreshes the data associated with a Financial Connections Account.
|
79
|
+
def self.refresh_account(account, params = {}, opts = {})
|
77
80
|
request_stripe_object(
|
78
|
-
method: :
|
79
|
-
path: format("/v1/financial_connections/accounts/%<account>s/
|
81
|
+
method: :post,
|
82
|
+
path: format("/v1/financial_connections/accounts/%<account>s/refresh", { account: CGI.escape(account) }),
|
80
83
|
params: params,
|
81
84
|
opts: opts
|
82
85
|
)
|
83
86
|
end
|
84
87
|
|
85
|
-
#
|
86
|
-
def
|
88
|
+
# Subscribes to periodic refreshes of data associated with a Financial Connections Account.
|
89
|
+
def subscribe(params = {}, opts = {})
|
87
90
|
request_stripe_object(
|
88
91
|
method: :post,
|
89
|
-
path: format("/v1/financial_connections/accounts/%<account>s/
|
92
|
+
path: format("/v1/financial_connections/accounts/%<account>s/subscribe", { account: CGI.escape(self["id"]) }),
|
90
93
|
params: params,
|
91
94
|
opts: opts
|
92
95
|
)
|
@@ -103,21 +106,21 @@ module Stripe
|
|
103
106
|
end
|
104
107
|
|
105
108
|
# Unsubscribes from periodic refreshes of data associated with a Financial Connections Account.
|
106
|
-
def
|
109
|
+
def unsubscribe(params = {}, opts = {})
|
107
110
|
request_stripe_object(
|
108
111
|
method: :post,
|
109
|
-
path: format("/v1/financial_connections/accounts/%<account>s/unsubscribe", { account: CGI.escape(
|
112
|
+
path: format("/v1/financial_connections/accounts/%<account>s/unsubscribe", { account: CGI.escape(self["id"]) }),
|
110
113
|
params: params,
|
111
114
|
opts: opts
|
112
115
|
)
|
113
116
|
end
|
114
117
|
|
115
|
-
#
|
116
|
-
def self.
|
118
|
+
# Unsubscribes from periodic refreshes of data associated with a Financial Connections Account.
|
119
|
+
def self.unsubscribe(account, params = {}, opts = {})
|
117
120
|
request_stripe_object(
|
118
|
-
method: :
|
119
|
-
path: "/v1/financial_connections/accounts",
|
120
|
-
params:
|
121
|
+
method: :post,
|
122
|
+
path: format("/v1/financial_connections/accounts/%<account>s/unsubscribe", { account: CGI.escape(account) }),
|
123
|
+
params: params,
|
121
124
|
opts: opts
|
122
125
|
)
|
123
126
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module FinancialConnections
|
6
|
+
# A historical balance for the account on a particular day. It may be sourced from a balance snapshot provided by a financial institution, or inferred using transactions data.
|
7
|
+
class AccountInferredBalance < APIResource
|
8
|
+
OBJECT_NAME = "financial_connections.account_inferred_balance"
|
9
|
+
def self.object_name
|
10
|
+
"financial_connections.account_inferred_balance"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module GiftCards
|
6
|
+
# A gift card represents a single gift card owned by a customer, including the
|
7
|
+
# remaining balance, gift card code, and whether or not it is active.
|
8
|
+
class Card < APIResource
|
9
|
+
extend Stripe::APIOperations::Create
|
10
|
+
extend Stripe::APIOperations::List
|
11
|
+
include Stripe::APIOperations::Save
|
12
|
+
|
13
|
+
OBJECT_NAME = "gift_cards.card"
|
14
|
+
def self.object_name
|
15
|
+
"gift_cards.card"
|
16
|
+
end
|
17
|
+
|
18
|
+
# Creates a new gift card object.
|
19
|
+
def self.create(params = {}, opts = {})
|
20
|
+
request_stripe_object(
|
21
|
+
method: :post,
|
22
|
+
path: "/v1/gift_cards/cards",
|
23
|
+
params: params,
|
24
|
+
opts: opts
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
# List gift cards for an account
|
29
|
+
def self.list(filters = {}, opts = {})
|
30
|
+
request_stripe_object(
|
31
|
+
method: :get,
|
32
|
+
path: "/v1/gift_cards/cards",
|
33
|
+
params: filters,
|
34
|
+
opts: opts
|
35
|
+
)
|
36
|
+
end
|
37
|
+
|
38
|
+
# Update a gift card
|
39
|
+
def self.update(id, params = {}, opts = {})
|
40
|
+
request_stripe_object(
|
41
|
+
method: :post,
|
42
|
+
path: format("/v1/gift_cards/cards/%<id>s", { id: CGI.escape(id) }),
|
43
|
+
params: params,
|
44
|
+
opts: opts
|
45
|
+
)
|
46
|
+
end
|
47
|
+
|
48
|
+
# Validates a gift card code, returning the matching gift card object if it exists.
|
49
|
+
def self.validate(params = {}, opts = {})
|
50
|
+
request_stripe_object(
|
51
|
+
method: :post,
|
52
|
+
path: "/v1/gift_cards/cards/validate",
|
53
|
+
params: params,
|
54
|
+
opts: opts
|
55
|
+
)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|