stripe 10.2.0.pre.beta.1 → 10.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +51 -239
- data/Gemfile +5 -2
- data/OPENAPI_VERSION +1 -1
- data/README.md +0 -11
- data/Rakefile +7 -5
- data/VERSION +1 -1
- data/bin/stripe-console +1 -1
- data/lib/stripe/api_operations/request.rb +3 -7
- data/lib/stripe/api_operations/save.rb +5 -7
- data/lib/stripe/api_resource_test_helpers.rb +2 -2
- data/lib/stripe/api_version.rb +0 -1
- data/lib/stripe/connection_manager.rb +4 -6
- data/lib/stripe/errors.rb +3 -11
- data/lib/stripe/instrumentation.rb +5 -21
- data/lib/stripe/multipart_encoder.rb +7 -7
- data/lib/stripe/oauth.rb +6 -6
- data/lib/stripe/object_types.rb +3 -21
- data/lib/stripe/resources/account.rb +6 -10
- data/lib/stripe/resources/alipay_account.rb +1 -1
- data/lib/stripe/resources/application_fee_refund.rb +1 -1
- data/lib/stripe/resources/bank_account.rb +2 -2
- data/lib/stripe/resources/capability.rb +1 -1
- data/lib/stripe/resources/climate/order.rb +34 -0
- data/lib/stripe/resources/climate/product.rb +14 -0
- data/lib/stripe/resources/climate/supplier.rb +13 -0
- data/lib/stripe/resources/event.rb +2 -2
- data/lib/stripe/resources/file.rb +2 -4
- data/lib/stripe/resources/financial_connections/account.rb +0 -39
- data/lib/stripe/resources/invoice.rb +0 -21
- data/lib/stripe/resources/quote.rb +0 -94
- data/lib/stripe/resources/reversal.rb +1 -1
- data/lib/stripe/resources/subscription_schedule.rb +0 -18
- data/lib/stripe/resources/tax_id.rb +1 -1
- data/lib/stripe/resources/terminal/reader.rb +0 -54
- data/lib/stripe/resources.rb +3 -20
- data/lib/stripe/stripe_client.rb +51 -102
- data/lib/stripe/stripe_configuration.rb +13 -31
- data/lib/stripe/stripe_object.rb +15 -18
- data/lib/stripe/stripe_response.rb +1 -3
- data/lib/stripe/util.rb +11 -20
- data/lib/stripe/version.rb +1 -1
- data/lib/stripe.rb +0 -46
- data/stripe.gemspec +3 -2
- metadata +8 -25
- data/lib/stripe/request_signing_authenticator.rb +0 -83
- data/lib/stripe/resources/account_notice.rb +0 -14
- data/lib/stripe/resources/capital/financing_offer.rb +0 -32
- data/lib/stripe/resources/capital/financing_summary.rb +0 -12
- data/lib/stripe/resources/capital/financing_transaction.rb +0 -13
- data/lib/stripe/resources/confirmation_token.rb +0 -11
- data/lib/stripe/resources/customer_session.rb +0 -12
- data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +0 -13
- data/lib/stripe/resources/financial_connections/transaction.rb +0 -13
- data/lib/stripe/resources/gift_cards/card.rb +0 -25
- data/lib/stripe/resources/gift_cards/transaction.rb +0 -56
- data/lib/stripe/resources/invoice_payment.rb +0 -11
- data/lib/stripe/resources/issuing/credit_underwriting_record.rb +0 -69
- data/lib/stripe/resources/issuing/personalization_design.rb +0 -77
- data/lib/stripe/resources/issuing/physical_bundle.rb +0 -13
- data/lib/stripe/resources/margin.rb +0 -14
- data/lib/stripe/resources/order.rb +0 -89
- data/lib/stripe/resources/quote_phase.rb +0 -29
- data/lib/stripe/resources/quote_preview_invoice.rb +0 -42
- data/lib/stripe/resources/quote_preview_subscription_schedule.rb +0 -10
- data/lib/stripe/resources/tax/form.rb +0 -39
data/lib/stripe/errors.rb
CHANGED
@@ -4,22 +4,14 @@ module Stripe
|
|
4
4
|
# StripeError is the base error from which all other more specific Stripe
|
5
5
|
# errors derive.
|
6
6
|
class StripeError < StandardError
|
7
|
-
attr_reader :message
|
7
|
+
attr_reader :message, :code, :error, :http_body, :http_headers, :http_status, :json_body, :request_id
|
8
8
|
|
9
9
|
# Response contains a StripeResponse object that has some basic information
|
10
10
|
# about the response that conveyed the error.
|
11
|
-
attr_accessor :response
|
12
|
-
|
13
|
-
attr_reader :code
|
14
|
-
attr_reader :error
|
15
|
-
attr_reader :http_body
|
16
|
-
attr_reader :http_headers
|
17
|
-
attr_reader :http_status
|
18
|
-
attr_reader :json_body # equivalent to #data
|
19
|
-
attr_reader :request_id
|
11
|
+
attr_accessor :response # equivalent to #data
|
20
12
|
|
21
13
|
# Initializes a StripeError.
|
22
|
-
def initialize(message = nil, http_status: nil, http_body: nil,
|
14
|
+
def initialize(message = nil, http_status: nil, http_body: nil, # rubocop:todo Lint/MissingSuper
|
23
15
|
json_body: nil, http_headers: nil, code: nil)
|
24
16
|
@message = message
|
25
17
|
@http_status = http_status
|
@@ -4,8 +4,7 @@ module Stripe
|
|
4
4
|
class Instrumentation
|
5
5
|
# Event emitted on `request_begin` callback.
|
6
6
|
class RequestBeginEvent
|
7
|
-
attr_reader :method
|
8
|
-
attr_reader :path
|
7
|
+
attr_reader :method, :path
|
9
8
|
|
10
9
|
# Arbitrary user-provided data in the form of a Ruby hash that's passed
|
11
10
|
# from subscribers on `request_begin` to subscribers on `request_end`.
|
@@ -27,16 +26,8 @@ module Stripe
|
|
27
26
|
|
28
27
|
# Event emitted on `request_end` callback.
|
29
28
|
class RequestEndEvent
|
30
|
-
attr_reader :duration
|
31
|
-
|
32
|
-
attr_reader :method
|
33
|
-
attr_reader :num_retries
|
34
|
-
attr_reader :path
|
35
|
-
attr_reader :request_id
|
36
|
-
attr_reader :response_header
|
37
|
-
attr_reader :response_body
|
38
|
-
attr_reader :request_header
|
39
|
-
attr_reader :request_body
|
29
|
+
attr_reader :duration, :http_status, :method, :num_retries, :path, :request_id, :response_header, :response_body,
|
30
|
+
:request_header, :request_body
|
40
31
|
|
41
32
|
# Arbitrary user-provided data in the form of a Ruby hash that's passed
|
42
33
|
# from subscribers on `request_begin` to subscribers on `request_end`.
|
@@ -62,12 +53,7 @@ module Stripe
|
|
62
53
|
end
|
63
54
|
|
64
55
|
class RequestContext
|
65
|
-
attr_reader :duration
|
66
|
-
attr_reader :method
|
67
|
-
attr_reader :path
|
68
|
-
attr_reader :request_id
|
69
|
-
attr_reader :body
|
70
|
-
attr_reader :header
|
56
|
+
attr_reader :duration, :method, :path, :request_id, :body, :header
|
71
57
|
|
72
58
|
def initialize(duration:, context:, header:)
|
73
59
|
@duration = duration
|
@@ -80,9 +66,7 @@ module Stripe
|
|
80
66
|
end
|
81
67
|
|
82
68
|
class ResponseContext
|
83
|
-
attr_reader :http_status
|
84
|
-
attr_reader :body
|
85
|
-
attr_reader :header
|
69
|
+
attr_reader :http_status, :body, :header
|
86
70
|
|
87
71
|
def initialize(http_status:, response:)
|
88
72
|
@http_status = http_status
|
@@ -106,22 +106,22 @@ module Stripe
|
|
106
106
|
end
|
107
107
|
|
108
108
|
private def write_field(name, data, filename:)
|
109
|
-
if
|
110
|
-
@body << "\r\n"
|
111
|
-
else
|
109
|
+
if @first_field
|
112
110
|
@first_field = false
|
111
|
+
else
|
112
|
+
@body << "\r\n"
|
113
113
|
end
|
114
114
|
|
115
115
|
@body << "--#{@boundary}\r\n"
|
116
116
|
|
117
117
|
if filename
|
118
|
-
@body << %(Content-Disposition: form-data) +
|
118
|
+
@body << (%(Content-Disposition: form-data) +
|
119
119
|
%(; name="#{escape(name.to_s)}") +
|
120
|
-
%(; filename="#{escape(filename)}"\r\n)
|
120
|
+
%(; filename="#{escape(filename)}"\r\n))
|
121
121
|
@body << %(Content-Type: application/octet-stream\r\n)
|
122
122
|
else
|
123
|
-
@body << %(Content-Disposition: form-data) +
|
124
|
-
%(; name="#{escape(name.to_s)}"\r\n)
|
123
|
+
@body << (%(Content-Disposition: form-data) +
|
124
|
+
%(; name="#{escape(name.to_s)}"\r\n))
|
125
125
|
end
|
126
126
|
|
127
127
|
@body << "\r\n"
|
data/lib/stripe/oauth.rb
CHANGED
@@ -18,12 +18,12 @@ module Stripe
|
|
18
18
|
client_id = params[:client_id] || Stripe.client_id
|
19
19
|
unless client_id
|
20
20
|
raise AuthenticationError, "No client_id provided. " \
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
21
|
+
'Set your client_id using "Stripe.client_id = <CLIENT-ID>". ' \
|
22
|
+
"You can find your client_ids in your Stripe dashboard at " \
|
23
|
+
"https://dashboard.stripe.com/account/applications/settings, " \
|
24
|
+
"after registering your account as a platform. See " \
|
25
|
+
"https://stripe.com/docs/connect/standalone-accounts for details, " \
|
26
|
+
"or email support@stripe.com if you have any questions."
|
27
27
|
end
|
28
28
|
client_id
|
29
29
|
end
|
data/lib/stripe/object_types.rb
CHANGED
@@ -14,7 +14,6 @@ module Stripe
|
|
14
14
|
# business objects
|
15
15
|
Account::OBJECT_NAME => Account,
|
16
16
|
AccountLink::OBJECT_NAME => AccountLink,
|
17
|
-
AccountNotice::OBJECT_NAME => AccountNotice,
|
18
17
|
AccountSession::OBJECT_NAME => AccountSession,
|
19
18
|
ApplePayDomain::OBJECT_NAME => ApplePayDomain,
|
20
19
|
ApplicationFee::OBJECT_NAME => ApplicationFee,
|
@@ -26,14 +25,13 @@ module Stripe
|
|
26
25
|
BillingPortal::Configuration::OBJECT_NAME => BillingPortal::Configuration,
|
27
26
|
BillingPortal::Session::OBJECT_NAME => BillingPortal::Session,
|
28
27
|
Capability::OBJECT_NAME => Capability,
|
29
|
-
Capital::FinancingOffer::OBJECT_NAME => Capital::FinancingOffer,
|
30
|
-
Capital::FinancingSummary::OBJECT_NAME => Capital::FinancingSummary,
|
31
|
-
Capital::FinancingTransaction::OBJECT_NAME => Capital::FinancingTransaction,
|
32
28
|
Card::OBJECT_NAME => Card,
|
33
29
|
CashBalance::OBJECT_NAME => CashBalance,
|
34
30
|
Charge::OBJECT_NAME => Charge,
|
35
31
|
Checkout::Session::OBJECT_NAME => Checkout::Session,
|
36
|
-
|
32
|
+
Climate::Order::OBJECT_NAME => Climate::Order,
|
33
|
+
Climate::Product::OBJECT_NAME => Climate::Product,
|
34
|
+
Climate::Supplier::OBJECT_NAME => Climate::Supplier,
|
37
35
|
CountrySpec::OBJECT_NAME => CountrySpec,
|
38
36
|
Coupon::OBJECT_NAME => Coupon,
|
39
37
|
CreditNote::OBJECT_NAME => CreditNote,
|
@@ -41,7 +39,6 @@ module Stripe
|
|
41
39
|
Customer::OBJECT_NAME => Customer,
|
42
40
|
CustomerBalanceTransaction::OBJECT_NAME => CustomerBalanceTransaction,
|
43
41
|
CustomerCashBalanceTransaction::OBJECT_NAME => CustomerCashBalanceTransaction,
|
44
|
-
CustomerSession::OBJECT_NAME => CustomerSession,
|
45
42
|
Discount::OBJECT_NAME => Discount,
|
46
43
|
Dispute::OBJECT_NAME => Dispute,
|
47
44
|
EphemeralKey::OBJECT_NAME => EphemeralKey,
|
@@ -51,36 +48,25 @@ module Stripe
|
|
51
48
|
File::OBJECT_NAME_ALT => File,
|
52
49
|
FileLink::OBJECT_NAME => FileLink,
|
53
50
|
FinancialConnections::Account::OBJECT_NAME => FinancialConnections::Account,
|
54
|
-
FinancialConnections::AccountInferredBalance::OBJECT_NAME =>
|
55
|
-
FinancialConnections::AccountInferredBalance,
|
56
51
|
FinancialConnections::AccountOwner::OBJECT_NAME => FinancialConnections::AccountOwner,
|
57
52
|
FinancialConnections::AccountOwnership::OBJECT_NAME =>
|
58
53
|
FinancialConnections::AccountOwnership,
|
59
54
|
FinancialConnections::Session::OBJECT_NAME => FinancialConnections::Session,
|
60
|
-
FinancialConnections::Transaction::OBJECT_NAME => FinancialConnections::Transaction,
|
61
55
|
FundingInstructions::OBJECT_NAME => FundingInstructions,
|
62
|
-
GiftCards::Card::OBJECT_NAME => GiftCards::Card,
|
63
|
-
GiftCards::Transaction::OBJECT_NAME => GiftCards::Transaction,
|
64
56
|
Identity::VerificationReport::OBJECT_NAME => Identity::VerificationReport,
|
65
57
|
Identity::VerificationSession::OBJECT_NAME => Identity::VerificationSession,
|
66
58
|
Invoice::OBJECT_NAME => Invoice,
|
67
59
|
InvoiceItem::OBJECT_NAME => InvoiceItem,
|
68
60
|
InvoiceLineItem::OBJECT_NAME => InvoiceLineItem,
|
69
|
-
InvoicePayment::OBJECT_NAME => InvoicePayment,
|
70
61
|
Issuing::Authorization::OBJECT_NAME => Issuing::Authorization,
|
71
62
|
Issuing::Card::OBJECT_NAME => Issuing::Card,
|
72
63
|
Issuing::Cardholder::OBJECT_NAME => Issuing::Cardholder,
|
73
|
-
Issuing::CreditUnderwritingRecord::OBJECT_NAME => Issuing::CreditUnderwritingRecord,
|
74
64
|
Issuing::Dispute::OBJECT_NAME => Issuing::Dispute,
|
75
|
-
Issuing::PersonalizationDesign::OBJECT_NAME => Issuing::PersonalizationDesign,
|
76
|
-
Issuing::PhysicalBundle::OBJECT_NAME => Issuing::PhysicalBundle,
|
77
65
|
Issuing::Token::OBJECT_NAME => Issuing::Token,
|
78
66
|
Issuing::Transaction::OBJECT_NAME => Issuing::Transaction,
|
79
67
|
LineItem::OBJECT_NAME => LineItem,
|
80
68
|
LoginLink::OBJECT_NAME => LoginLink,
|
81
69
|
Mandate::OBJECT_NAME => Mandate,
|
82
|
-
Margin::OBJECT_NAME => Margin,
|
83
|
-
Order::OBJECT_NAME => Order,
|
84
70
|
PaymentIntent::OBJECT_NAME => PaymentIntent,
|
85
71
|
PaymentLink::OBJECT_NAME => PaymentLink,
|
86
72
|
PaymentMethod::OBJECT_NAME => PaymentMethod,
|
@@ -93,9 +79,6 @@ module Stripe
|
|
93
79
|
Product::OBJECT_NAME => Product,
|
94
80
|
PromotionCode::OBJECT_NAME => PromotionCode,
|
95
81
|
Quote::OBJECT_NAME => Quote,
|
96
|
-
QuotePhase::OBJECT_NAME => QuotePhase,
|
97
|
-
QuotePreviewInvoice::OBJECT_NAME => QuotePreviewInvoice,
|
98
|
-
QuotePreviewSubscriptionSchedule::OBJECT_NAME => QuotePreviewSubscriptionSchedule,
|
99
82
|
Radar::EarlyFraudWarning::OBJECT_NAME => Radar::EarlyFraudWarning,
|
100
83
|
Radar::ValueList::OBJECT_NAME => Radar::ValueList,
|
101
84
|
Radar::ValueListItem::OBJECT_NAME => Radar::ValueListItem,
|
@@ -115,7 +98,6 @@ module Stripe
|
|
115
98
|
SubscriptionSchedule::OBJECT_NAME => SubscriptionSchedule,
|
116
99
|
Tax::Calculation::OBJECT_NAME => Tax::Calculation,
|
117
100
|
Tax::CalculationLineItem::OBJECT_NAME => Tax::CalculationLineItem,
|
118
|
-
Tax::Form::OBJECT_NAME => Tax::Form,
|
119
101
|
Tax::Registration::OBJECT_NAME => Tax::Registration,
|
120
102
|
Tax::Settings::OBJECT_NAME => Tax::Settings,
|
121
103
|
Tax::Transaction::OBJECT_NAME => Tax::Transaction,
|
@@ -123,17 +123,13 @@ module Stripe
|
|
123
123
|
end
|
124
124
|
|
125
125
|
def serialize_params_account(_obj, update_hash, options = {})
|
126
|
-
if (entity = @values[:legal_entity])
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
serialize_additional_owners(entity, owners)
|
131
|
-
end
|
126
|
+
if (entity = @values[:legal_entity]) && (owners = entity[:additional_owners])
|
127
|
+
entity_update = update_hash[:legal_entity] ||= {}
|
128
|
+
entity_update[:additional_owners] =
|
129
|
+
serialize_additional_owners(entity, owners)
|
132
130
|
end
|
133
|
-
if (individual = @values[:individual])
|
134
|
-
|
135
|
-
update_hash[:individual] = individual.serialize_params(options)
|
136
|
-
end
|
131
|
+
if (individual = @values[:individual]) && (individual.is_a?(Person) && !update_hash.key?(:individual))
|
132
|
+
update_hash[:individual] = individual.serialize_params(options)
|
137
133
|
end
|
138
134
|
update_hash
|
139
135
|
end
|
@@ -31,8 +31,8 @@ module Stripe
|
|
31
31
|
|
32
32
|
def self.update(_id, _params = nil, _opts = nil)
|
33
33
|
raise NotImplementedError,
|
34
|
-
"Bank accounts cannot be updated without a customer ID or an
|
35
|
-
"
|
34
|
+
"Bank accounts cannot be updated without a customer ID or an " \
|
35
|
+
"account ID. Update a bank account using " \
|
36
36
|
"`Customer.update_source('customer_id', 'bank_account_id', " \
|
37
37
|
"update_params)` or `Account.update_external_account(" \
|
38
38
|
"'account_id', 'bank_account_id', update_params)`"
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Climate
|
6
|
+
# Orders represent your intent to purchase a particular Climate product. When you create an order, the
|
7
|
+
# payment is deducted from your merchant balance.
|
8
|
+
class Order < APIResource
|
9
|
+
extend Stripe::APIOperations::Create
|
10
|
+
extend Stripe::APIOperations::List
|
11
|
+
include Stripe::APIOperations::Save
|
12
|
+
|
13
|
+
OBJECT_NAME = "climate.order"
|
14
|
+
|
15
|
+
def cancel(params = {}, opts = {})
|
16
|
+
request_stripe_object(
|
17
|
+
method: :post,
|
18
|
+
path: format("/v1/climate/orders/%<order>s/cancel", { order: CGI.escape(self["id"]) }),
|
19
|
+
params: params,
|
20
|
+
opts: opts
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.cancel(order, params = {}, opts = {})
|
25
|
+
request_stripe_object(
|
26
|
+
method: :post,
|
27
|
+
path: format("/v1/climate/orders/%<order>s/cancel", { order: CGI.escape(order) }),
|
28
|
+
params: params,
|
29
|
+
opts: opts
|
30
|
+
)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Climate
|
6
|
+
# A Climate product represents a type of carbon removal unit available for reservation.
|
7
|
+
# You can retrieve it to see the current price and availability.
|
8
|
+
class Product < APIResource
|
9
|
+
extend Stripe::APIOperations::List
|
10
|
+
|
11
|
+
OBJECT_NAME = "climate.product"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Climate
|
6
|
+
# A supplier of carbon removal.
|
7
|
+
class Supplier < APIResource
|
8
|
+
extend Stripe::APIOperations::List
|
9
|
+
|
10
|
+
OBJECT_NAME = "climate.supplier"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -23,8 +23,8 @@ module Stripe
|
|
23
23
|
# `Event` objects directly to an endpoint on your server. You can manage
|
24
24
|
# webhooks in your
|
25
25
|
# [account settings](https://dashboard.stripe.com/account/webhooks). Learn how
|
26
|
-
# to [listen for events]
|
27
|
-
#
|
26
|
+
# to [listen for events](https://stripe.com/docs/webhooks)
|
27
|
+
# so that your integration can automatically trigger reactions.
|
28
28
|
#
|
29
29
|
# When using [Connect](https://stripe.com/docs/connect), you can also receive event notifications
|
30
30
|
# that occur in connected accounts. For these events, there's an
|
@@ -26,10 +26,8 @@ module Stripe
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def self.create(params = {}, opts = {})
|
29
|
-
if params[:file] && !params[:file].is_a?(String)
|
30
|
-
|
31
|
-
raise ArgumentError, "file must respond to `#read`"
|
32
|
-
end
|
29
|
+
if params[:file] && !params[:file].is_a?(String) && !params[:file].respond_to?(:read)
|
30
|
+
raise ArgumentError, "file must respond to `#read`"
|
33
31
|
end
|
34
32
|
|
35
33
|
config = opts[:client]&.config || Stripe.config
|
@@ -6,12 +6,9 @@ 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
|
10
9
|
|
11
10
|
OBJECT_NAME = "financial_connections.account"
|
12
11
|
|
13
|
-
nested_resource_class_methods :inferred_balance, operations: %i[list]
|
14
|
-
|
15
12
|
def disconnect(params = {}, opts = {})
|
16
13
|
request_stripe_object(
|
17
14
|
method: :post,
|
@@ -39,24 +36,6 @@ module Stripe
|
|
39
36
|
)
|
40
37
|
end
|
41
38
|
|
42
|
-
def subscribe(params = {}, opts = {})
|
43
|
-
request_stripe_object(
|
44
|
-
method: :post,
|
45
|
-
path: format("/v1/financial_connections/accounts/%<account>s/subscribe", { account: CGI.escape(self["id"]) }),
|
46
|
-
params: params,
|
47
|
-
opts: opts
|
48
|
-
)
|
49
|
-
end
|
50
|
-
|
51
|
-
def unsubscribe(params = {}, opts = {})
|
52
|
-
request_stripe_object(
|
53
|
-
method: :post,
|
54
|
-
path: format("/v1/financial_connections/accounts/%<account>s/unsubscribe", { account: CGI.escape(self["id"]) }),
|
55
|
-
params: params,
|
56
|
-
opts: opts
|
57
|
-
)
|
58
|
-
end
|
59
|
-
|
60
39
|
def self.disconnect(account, params = {}, opts = {})
|
61
40
|
request_stripe_object(
|
62
41
|
method: :post,
|
@@ -83,24 +62,6 @@ module Stripe
|
|
83
62
|
opts: opts
|
84
63
|
)
|
85
64
|
end
|
86
|
-
|
87
|
-
def self.subscribe(account, params = {}, opts = {})
|
88
|
-
request_stripe_object(
|
89
|
-
method: :post,
|
90
|
-
path: format("/v1/financial_connections/accounts/%<account>s/subscribe", { account: CGI.escape(account) }),
|
91
|
-
params: params,
|
92
|
-
opts: opts
|
93
|
-
)
|
94
|
-
end
|
95
|
-
|
96
|
-
def self.unsubscribe(account, params = {}, opts = {})
|
97
|
-
request_stripe_object(
|
98
|
-
method: :post,
|
99
|
-
path: format("/v1/financial_connections/accounts/%<account>s/unsubscribe", { account: CGI.escape(account) }),
|
100
|
-
params: params,
|
101
|
-
opts: opts
|
102
|
-
)
|
103
|
-
end
|
104
65
|
end
|
105
66
|
end
|
106
67
|
end
|
@@ -40,21 +40,9 @@ module Stripe
|
|
40
40
|
extend Stripe::APIOperations::List
|
41
41
|
extend Stripe::APIOperations::Search
|
42
42
|
include Stripe::APIOperations::Save
|
43
|
-
extend Stripe::APIOperations::NestedResource
|
44
43
|
|
45
44
|
OBJECT_NAME = "invoice"
|
46
45
|
|
47
|
-
nested_resource_class_methods :payment, operations: %i[retrieve list]
|
48
|
-
|
49
|
-
def attach_payment_intent(params = {}, opts = {})
|
50
|
-
request_stripe_object(
|
51
|
-
method: :post,
|
52
|
-
path: format("/v1/invoices/%<invoice>s/attach_payment_intent", { invoice: CGI.escape(self["id"]) }),
|
53
|
-
params: params,
|
54
|
-
opts: opts
|
55
|
-
)
|
56
|
-
end
|
57
|
-
|
58
46
|
def finalize_invoice(params = {}, opts = {})
|
59
47
|
request_stripe_object(
|
60
48
|
method: :post,
|
@@ -100,15 +88,6 @@ module Stripe
|
|
100
88
|
)
|
101
89
|
end
|
102
90
|
|
103
|
-
def self.attach_payment_intent(invoice, params = {}, opts = {})
|
104
|
-
request_stripe_object(
|
105
|
-
method: :post,
|
106
|
-
path: format("/v1/invoices/%<invoice>s/attach_payment_intent", { invoice: CGI.escape(invoice) }),
|
107
|
-
params: params,
|
108
|
-
opts: opts
|
109
|
-
)
|
110
|
-
end
|
111
|
-
|
112
91
|
def self.finalize_invoice(invoice, params = {}, opts = {})
|
113
92
|
request_stripe_object(
|
114
93
|
method: :post,
|
@@ -8,13 +8,9 @@ module Stripe
|
|
8
8
|
extend Stripe::APIOperations::Create
|
9
9
|
extend Stripe::APIOperations::List
|
10
10
|
include Stripe::APIOperations::Save
|
11
|
-
extend Stripe::APIOperations::NestedResource
|
12
11
|
|
13
12
|
OBJECT_NAME = "quote"
|
14
13
|
|
15
|
-
nested_resource_class_methods :preview_invoice, operations: %i[list]
|
16
|
-
nested_resource_class_methods :preview_subscription_schedule, operations: %i[list]
|
17
|
-
|
18
14
|
def accept(params = {}, opts = {})
|
19
15
|
request_stripe_object(
|
20
16
|
method: :post,
|
@@ -60,42 +56,6 @@ module Stripe
|
|
60
56
|
)
|
61
57
|
end
|
62
58
|
|
63
|
-
def list_lines(params = {}, opts = {})
|
64
|
-
request_stripe_object(
|
65
|
-
method: :get,
|
66
|
-
path: format("/v1/quotes/%<quote>s/lines", { quote: CGI.escape(self["id"]) }),
|
67
|
-
params: params,
|
68
|
-
opts: opts
|
69
|
-
)
|
70
|
-
end
|
71
|
-
|
72
|
-
def list_preview_invoice_lines(preview_invoice, params = {}, opts = {})
|
73
|
-
request_stripe_object(
|
74
|
-
method: :get,
|
75
|
-
path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(self["id"]), preview_invoice: CGI.escape(preview_invoice) }),
|
76
|
-
params: params,
|
77
|
-
opts: opts
|
78
|
-
)
|
79
|
-
end
|
80
|
-
|
81
|
-
def mark_draft(params = {}, opts = {})
|
82
|
-
request_stripe_object(
|
83
|
-
method: :post,
|
84
|
-
path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(self["id"]) }),
|
85
|
-
params: params,
|
86
|
-
opts: opts
|
87
|
-
)
|
88
|
-
end
|
89
|
-
|
90
|
-
def mark_stale(params = {}, opts = {})
|
91
|
-
request_stripe_object(
|
92
|
-
method: :post,
|
93
|
-
path: format("/v1/quotes/%<quote>s/mark_stale", { quote: CGI.escape(self["id"]) }),
|
94
|
-
params: params,
|
95
|
-
opts: opts
|
96
|
-
)
|
97
|
-
end
|
98
|
-
|
99
59
|
def pdf(params = {}, opts = {}, &read_body_chunk_block)
|
100
60
|
config = opts[:client]&.config || Stripe.config
|
101
61
|
opts = { api_base: config.uploads_base }.merge(opts)
|
@@ -108,15 +68,6 @@ module Stripe
|
|
108
68
|
)
|
109
69
|
end
|
110
70
|
|
111
|
-
def reestimate(params = {}, opts = {})
|
112
|
-
request_stripe_object(
|
113
|
-
method: :post,
|
114
|
-
path: format("/v1/quotes/%<quote>s/reestimate", { quote: CGI.escape(self["id"]) }),
|
115
|
-
params: params,
|
116
|
-
opts: opts
|
117
|
-
)
|
118
|
-
end
|
119
|
-
|
120
71
|
def self.accept(quote, params = {}, opts = {})
|
121
72
|
request_stripe_object(
|
122
73
|
method: :post,
|
@@ -162,42 +113,6 @@ module Stripe
|
|
162
113
|
)
|
163
114
|
end
|
164
115
|
|
165
|
-
def self.list_lines(quote, params = {}, opts = {})
|
166
|
-
request_stripe_object(
|
167
|
-
method: :get,
|
168
|
-
path: format("/v1/quotes/%<quote>s/lines", { quote: CGI.escape(quote) }),
|
169
|
-
params: params,
|
170
|
-
opts: opts
|
171
|
-
)
|
172
|
-
end
|
173
|
-
|
174
|
-
def self.list_preview_invoice_lines(quote, preview_invoice, params = {}, opts = {})
|
175
|
-
request_stripe_object(
|
176
|
-
method: :get,
|
177
|
-
path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(quote), preview_invoice: CGI.escape(preview_invoice) }),
|
178
|
-
params: params,
|
179
|
-
opts: opts
|
180
|
-
)
|
181
|
-
end
|
182
|
-
|
183
|
-
def self.mark_draft(quote, params = {}, opts = {})
|
184
|
-
request_stripe_object(
|
185
|
-
method: :post,
|
186
|
-
path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(quote) }),
|
187
|
-
params: params,
|
188
|
-
opts: opts
|
189
|
-
)
|
190
|
-
end
|
191
|
-
|
192
|
-
def self.mark_stale(quote, params = {}, opts = {})
|
193
|
-
request_stripe_object(
|
194
|
-
method: :post,
|
195
|
-
path: format("/v1/quotes/%<quote>s/mark_stale", { quote: CGI.escape(quote) }),
|
196
|
-
params: params,
|
197
|
-
opts: opts
|
198
|
-
)
|
199
|
-
end
|
200
|
-
|
201
116
|
def self.pdf(quote, params = {}, opts = {}, &read_body_chunk_block)
|
202
117
|
config = opts[:client]&.config || Stripe.config
|
203
118
|
opts = { api_base: config.uploads_base }.merge(opts)
|
@@ -209,14 +124,5 @@ module Stripe
|
|
209
124
|
&read_body_chunk_block
|
210
125
|
)
|
211
126
|
end
|
212
|
-
|
213
|
-
def self.reestimate(quote, params = {}, opts = {})
|
214
|
-
request_stripe_object(
|
215
|
-
method: :post,
|
216
|
-
path: format("/v1/quotes/%<quote>s/reestimate", { quote: CGI.escape(quote) }),
|
217
|
-
params: params,
|
218
|
-
opts: opts
|
219
|
-
)
|
220
|
-
end
|
221
127
|
end
|
222
128
|
end
|
@@ -12,15 +12,6 @@ module Stripe
|
|
12
12
|
|
13
13
|
OBJECT_NAME = "subscription_schedule"
|
14
14
|
|
15
|
-
def amend(params = {}, opts = {})
|
16
|
-
request_stripe_object(
|
17
|
-
method: :post,
|
18
|
-
path: format("/v1/subscription_schedules/%<schedule>s/amend", { schedule: CGI.escape(self["id"]) }),
|
19
|
-
params: params,
|
20
|
-
opts: opts
|
21
|
-
)
|
22
|
-
end
|
23
|
-
|
24
15
|
def cancel(params = {}, opts = {})
|
25
16
|
request_stripe_object(
|
26
17
|
method: :post,
|
@@ -39,15 +30,6 @@ module Stripe
|
|
39
30
|
)
|
40
31
|
end
|
41
32
|
|
42
|
-
def self.amend(schedule, params = {}, opts = {})
|
43
|
-
request_stripe_object(
|
44
|
-
method: :post,
|
45
|
-
path: format("/v1/subscription_schedules/%<schedule>s/amend", { schedule: CGI.escape(schedule) }),
|
46
|
-
params: params,
|
47
|
-
opts: opts
|
48
|
-
)
|
49
|
-
end
|
50
|
-
|
51
33
|
def self.cancel(schedule, params = {}, opts = {})
|
52
34
|
request_stripe_object(
|
53
35
|
method: :post,
|