stripe 13.3.0.pre.beta.2 → 13.3.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 +650 -1394
- data/OPENAPI_VERSION +1 -1
- data/VERSION +1 -1
- data/lib/stripe/api_version.rb +1 -1
- data/lib/stripe/object_types.rb +0 -32
- data/lib/stripe/resources/account.rb +2 -232
- data/lib/stripe/resources/account_link.rb +0 -9
- data/lib/stripe/resources/account_session.rb +0 -103
- data/lib/stripe/resources/apple_pay_domain.rb +2 -20
- data/lib/stripe/resources/application_fee.rb +2 -36
- data/lib/stripe/resources/application_fee_refund.rb +0 -17
- data/lib/stripe/resources/apps/secret.rb +2 -24
- data/lib/stripe/resources/balance.rb +0 -59
- data/lib/stripe/resources/balance_transaction.rb +2 -36
- data/lib/stripe/resources/bank_account.rb +3 -61
- data/lib/stripe/resources/billing/alert.rb +2 -23
- data/lib/stripe/resources/billing/credit_balance_summary.rb +0 -25
- data/lib/stripe/resources/billing/credit_balance_transaction.rb +2 -46
- data/lib/stripe/resources/billing/credit_grant.rb +2 -46
- data/lib/stripe/resources/billing/meter.rb +2 -44
- data/lib/stripe/resources/billing/meter_event.rb +0 -15
- data/lib/stripe/resources/billing/meter_event_adjustment.rb +0 -16
- data/lib/stripe/resources/billing/meter_event_summary.rb +0 -15
- data/lib/stripe/resources/billing_portal/configuration.rb +2 -72
- data/lib/stripe/resources/billing_portal/session.rb +0 -61
- data/lib/stripe/resources/capability.rb +0 -38
- data/lib/stripe/resources/card.rb +1 -73
- data/lib/stripe/resources/cash_balance.rb +0 -14
- data/lib/stripe/resources/charge.rb +2 -471
- data/lib/stripe/resources/checkout/session.rb +2 -498
- data/lib/stripe/resources/climate/order.rb +2 -57
- data/lib/stripe/resources/climate/product.rb +2 -26
- data/lib/stripe/resources/climate/supplier.rb +2 -20
- data/lib/stripe/resources/confirmation_token.rb +0 -297
- data/lib/stripe/resources/country_spec.rb +2 -29
- data/lib/stripe/resources/coupon.rb +2 -46
- data/lib/stripe/resources/credit_note.rb +2 -93
- data/lib/stripe/resources/credit_note_line_item.rb +0 -46
- data/lib/stripe/resources/customer.rb +2 -95
- data/lib/stripe/resources/customer_balance_transaction.rb +0 -27
- data/lib/stripe/resources/customer_cash_balance_transaction.rb +0 -72
- data/lib/stripe/resources/customer_session.rb +0 -34
- data/lib/stripe/resources/discount.rb +0 -29
- data/lib/stripe/resources/dispute.rb +2 -90
- data/lib/stripe/resources/entitlements/active_entitlement.rb +2 -13
- data/lib/stripe/resources/entitlements/feature.rb +2 -17
- data/lib/stripe/resources/ephemeral_key.rb +0 -13
- data/lib/stripe/resources/event.rb +2 -46
- data/lib/stripe/resources/exchange_rate.rb +2 -9
- data/lib/stripe/resources/file.rb +2 -25
- data/lib/stripe/resources/file_link.rb +2 -21
- data/lib/stripe/resources/financial_connections/account.rb +2 -89
- data/lib/stripe/resources/financial_connections/account_owner.rb +0 -17
- data/lib/stripe/resources/financial_connections/account_ownership.rb +0 -9
- data/lib/stripe/resources/financial_connections/session.rb +0 -49
- data/lib/stripe/resources/financial_connections/transaction.rb +2 -30
- data/lib/stripe/resources/forwarding/request.rb +2 -42
- data/lib/stripe/resources/funding_instructions.rb +0 -82
- data/lib/stripe/resources/identity/verification_report.rb +2 -94
- data/lib/stripe/resources/identity/verification_session.rb +2 -78
- data/lib/stripe/resources/invoice.rb +2 -420
- data/lib/stripe/resources/invoice_item.rb +2 -56
- data/lib/stripe/resources/invoice_line_item.rb +0 -83
- data/lib/stripe/resources/invoice_rendering_template.rb +2 -19
- data/lib/stripe/resources/issuing/authorization.rb +2 -131
- data/lib/stripe/resources/issuing/card.rb +2 -88
- data/lib/stripe/resources/issuing/cardholder.rb +2 -78
- data/lib/stripe/resources/issuing/dispute.rb +2 -67
- data/lib/stripe/resources/issuing/personalization_design.rb +2 -40
- data/lib/stripe/resources/issuing/physical_bundle.rb +2 -20
- data/lib/stripe/resources/issuing/token.rb +2 -48
- data/lib/stripe/resources/issuing/transaction.rb +2 -108
- data/lib/stripe/resources/line_item.rb +0 -50
- data/lib/stripe/resources/login_link.rb +0 -7
- data/lib/stripe/resources/mandate.rb +0 -78
- data/lib/stripe/resources/payment_intent.rb +2 -714
- data/lib/stripe/resources/payment_link.rb +2 -200
- data/lib/stripe/resources/payment_method.rb +2 -370
- data/lib/stripe/resources/payment_method_configuration.rb +2 -432
- data/lib/stripe/resources/payment_method_domain.rb +2 -59
- data/lib/stripe/resources/payout.rb +2 -58
- data/lib/stripe/resources/person.rb +0 -128
- data/lib/stripe/resources/plan.rb +2 -54
- data/lib/stripe/resources/price.rb +2 -79
- data/lib/stripe/resources/product.rb +2 -62
- data/lib/stripe/resources/product_feature.rb +0 -12
- data/lib/stripe/resources/promotion_code.rb +2 -37
- data/lib/stripe/resources/quote.rb +2 -358
- data/lib/stripe/resources/radar/early_fraud_warning.rb +2 -19
- data/lib/stripe/resources/radar/value_list.rb +2 -25
- data/lib/stripe/resources/radar/value_list_item.rb +2 -19
- data/lib/stripe/resources/refund.rb +2 -132
- data/lib/stripe/resources/reporting/report_run.rb +2 -31
- data/lib/stripe/resources/reporting/report_type.rb +2 -21
- data/lib/stripe/resources/reversal.rb +0 -21
- data/lib/stripe/resources/review.rb +2 -38
- data/lib/stripe/resources/setup_attempt.rb +2 -103
- data/lib/stripe/resources/setup_intent.rb +2 -160
- data/lib/stripe/resources/shipping_rate.rb +2 -44
- data/lib/stripe/resources/sigma/scheduled_query_run.rb +2 -28
- data/lib/stripe/resources/source.rb +0 -195
- data/lib/stripe/resources/source_transaction.rb +0 -48
- data/lib/stripe/resources/subscription.rb +2 -216
- data/lib/stripe/resources/subscription_item.rb +2 -48
- data/lib/stripe/resources/subscription_schedule.rb +2 -175
- data/lib/stripe/resources/tax/calculation.rb +0 -72
- data/lib/stripe/resources/tax/calculation_line_item.rb +0 -33
- data/lib/stripe/resources/tax/registration.rb +2 -381
- data/lib/stripe/resources/tax/settings.rb +0 -33
- data/lib/stripe/resources/tax/transaction.rb +0 -68
- data/lib/stripe/resources/tax/transaction_line_item.rb +0 -30
- data/lib/stripe/resources/tax_code.rb +2 -11
- data/lib/stripe/resources/tax_id.rb +2 -32
- data/lib/stripe/resources/tax_rate.rb +2 -44
- data/lib/stripe/resources/terminal/configuration.rb +2 -109
- data/lib/stripe/resources/terminal/connection_token.rb +0 -7
- data/lib/stripe/resources/terminal/location.rb +2 -22
- data/lib/stripe/resources/terminal/reader.rb +2 -180
- data/lib/stripe/resources/test_helpers/test_clock.rb +2 -29
- data/lib/stripe/resources/token.rb +0 -29
- data/lib/stripe/resources/topup.rb +2 -35
- data/lib/stripe/resources/transfer.rb +2 -37
- data/lib/stripe/resources/treasury/credit_reversal.rb +2 -34
- data/lib/stripe/resources/treasury/debit_reversal.rb +2 -40
- data/lib/stripe/resources/treasury/financial_account.rb +2 -59
- data/lib/stripe/resources/treasury/financial_account_features.rb +0 -91
- data/lib/stripe/resources/treasury/inbound_transfer.rb +2 -68
- data/lib/stripe/resources/treasury/outbound_payment.rb +2 -87
- data/lib/stripe/resources/treasury/outbound_transfer.rb +2 -84
- data/lib/stripe/resources/treasury/received_credit.rb +2 -72
- data/lib/stripe/resources/treasury/received_debit.rb +2 -69
- data/lib/stripe/resources/treasury/transaction.rb +2 -44
- data/lib/stripe/resources/treasury/transaction_entry.rb +2 -36
- data/lib/stripe/resources/usage_record.rb +0 -13
- data/lib/stripe/resources/usage_record_summary.rb +0 -18
- data/lib/stripe/resources/v2/billing/meter_event.rb +0 -18
- data/lib/stripe/resources/v2/billing/meter_event_adjustment.rb +0 -20
- data/lib/stripe/resources/v2/billing/meter_event_session.rb +0 -14
- data/lib/stripe/resources/v2/event.rb +0 -21
- data/lib/stripe/resources/v2/event_destination.rb +0 -49
- data/lib/stripe/resources/webhook_endpoint.rb +2 -34
- data/lib/stripe/resources.rb +0 -31
- data/lib/stripe/services/financial_connections/account_service.rb +1 -3
- data/lib/stripe/services/financial_connections_service.rb +1 -2
- data/lib/stripe/services/invoice_service.rb +1 -44
- data/lib/stripe/services/issuing_service.rb +1 -5
- data/lib/stripe/services/payment_intent_service.rb +0 -37
- data/lib/stripe/services/quote_service.rb +1 -49
- data/lib/stripe/services/subscription_schedule_service.rb +0 -11
- data/lib/stripe/services/tax_service.rb +1 -3
- data/lib/stripe/services/terminal/reader_service.rb +0 -33
- data/lib/stripe/services/terminal_service.rb +1 -2
- data/lib/stripe/services/v1_services.rb +1 -8
- data/lib/stripe/services.rb +0 -25
- data/lib/stripe/stripe_client.rb +1 -1
- data/lib/stripe/stripe_configuration.rb +1 -3
- data/lib/stripe/stripe_object.rb +3 -8
- data/lib/stripe/util.rb +2 -8
- data/lib/stripe/version.rb +1 -1
- data/lib/stripe.rb +0 -45
- data/stripe.gemspec +1 -2
- metadata +4 -62
- data/lib/stripe/request_signing_authenticator.rb +0 -79
- data/lib/stripe/resources/account_notice.rb +0 -60
- data/lib/stripe/resources/application.rb +0 -20
- data/lib/stripe/resources/billing/alert_triggered.rb +0 -26
- data/lib/stripe/resources/billing/meter_error_report.rb +0 -44
- data/lib/stripe/resources/capital/financing_offer.rb +0 -94
- data/lib/stripe/resources/capital/financing_summary.rb +0 -32
- data/lib/stripe/resources/capital/financing_transaction.rb +0 -56
- data/lib/stripe/resources/connect_collection_transfer.rb +0 -24
- data/lib/stripe/resources/entitlements/active_entitlement_summary.rb +0 -23
- data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +0 -27
- data/lib/stripe/resources/financial_connections/institution.rb +0 -61
- data/lib/stripe/resources/gift_cards/card.rb +0 -96
- data/lib/stripe/resources/gift_cards/transaction.rb +0 -132
- data/lib/stripe/resources/invoice_payment.rb +0 -46
- data/lib/stripe/resources/issuing/credit_underwriting_record.rb +0 -145
- data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +0 -49
- data/lib/stripe/resources/issuing/fraud_liability_debit.rb +0 -43
- data/lib/stripe/resources/issuing/settlement.rb +0 -49
- data/lib/stripe/resources/margin.rb +0 -56
- data/lib/stripe/resources/order.rb +0 -322
- data/lib/stripe/resources/payment_attempt_record.rb +0 -100
- data/lib/stripe/resources/payment_record.rb +0 -194
- data/lib/stripe/resources/quote_line.rb +0 -136
- data/lib/stripe/resources/quote_preview_invoice.rb +0 -374
- data/lib/stripe/resources/quote_preview_subscription_schedule.rb +0 -170
- data/lib/stripe/resources/reserve_transaction.rb +0 -22
- data/lib/stripe/resources/source_mandate_notification.rb +0 -59
- data/lib/stripe/resources/tax/association.rb +0 -60
- data/lib/stripe/resources/tax/form.rb +0 -124
- data/lib/stripe/resources/tax_deducted_at_source.rb +0 -22
- data/lib/stripe/resources/terminal/reader_collected_data.rb +0 -30
- data/lib/stripe/resources/v2/amount.rb +0 -9
- data/lib/stripe/services/account_notice_service.rb +0 -39
- data/lib/stripe/services/capital/financing_offer_service.rb +0 -42
- data/lib/stripe/services/capital/financing_summary_service.rb +0 -19
- data/lib/stripe/services/capital/financing_transaction_service.rb +0 -31
- data/lib/stripe/services/capital_service.rb +0 -15
- data/lib/stripe/services/financial_connections/account_inferred_balance_service.rb +0 -19
- data/lib/stripe/services/financial_connections/institution_service.rb +0 -30
- data/lib/stripe/services/gift_cards/card_service.rb +0 -63
- data/lib/stripe/services/gift_cards/transaction_service.rb +0 -74
- data/lib/stripe/services/gift_cards_service.rb +0 -14
- data/lib/stripe/services/invoice_payment_service.rb +0 -28
- data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +0 -74
- data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +0 -30
- data/lib/stripe/services/issuing/fraud_liability_debit_service.rb +0 -30
- data/lib/stripe/services/margin_service.rb +0 -50
- data/lib/stripe/services/order_line_item_service.rb +0 -17
- data/lib/stripe/services/order_service.rb +0 -78
- data/lib/stripe/services/payment_attempt_record_service.rb +0 -28
- data/lib/stripe/services/payment_record_service.rb +0 -78
- data/lib/stripe/services/quote_line_service.rb +0 -17
- data/lib/stripe/services/quote_preview_invoice_service.rb +0 -17
- data/lib/stripe/services/quote_preview_subscription_schedule_service.rb +0 -17
- data/lib/stripe/services/tax/association_service.rb +0 -19
- data/lib/stripe/services/tax/form_service.rb +0 -37
- data/lib/stripe/services/terminal/reader_collected_data_service.rb +0 -19
@@ -3,11 +3,10 @@
|
|
3
3
|
|
4
4
|
module Stripe
|
5
5
|
class InvoiceService < StripeService
|
6
|
-
attr_reader :
|
6
|
+
attr_reader :line_items, :upcoming_lines
|
7
7
|
|
8
8
|
def initialize(requestor)
|
9
9
|
super(requestor)
|
10
|
-
@payments = Stripe::InvoicePaymentService.new(@requestor)
|
11
10
|
@line_items = Stripe::InvoiceLineItemService.new(@requestor)
|
12
11
|
@upcoming_lines = Stripe::InvoiceUpcomingLinesService.new(@requestor)
|
13
12
|
end
|
@@ -23,48 +22,6 @@ module Stripe
|
|
23
22
|
)
|
24
23
|
end
|
25
24
|
|
26
|
-
# Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of payments.
|
27
|
-
#
|
28
|
-
# For Out of Band Payment, the payment is credited to the invoice immediately, increasing the amount_paid
|
29
|
-
# of the invoice and subsequently transitioning the status of the invoice to paid if necessary.
|
30
|
-
#
|
31
|
-
# For the PaymentIntent, when the PaymentIntent's status changes to succeeded, the payment is credited
|
32
|
-
# to the invoice, increasing its amount_paid. When the invoice is fully paid, the
|
33
|
-
# invoice's status becomes paid.
|
34
|
-
#
|
35
|
-
# If the PaymentIntent's status is already succeeded when it's attached, it's
|
36
|
-
# credited to the invoice immediately.
|
37
|
-
#
|
38
|
-
# See: [Create an invoice payment](https://stripe.com/docs/invoicing/payments/create) to learn more.
|
39
|
-
def attach_payment(invoice, params = {}, opts = {})
|
40
|
-
request(
|
41
|
-
method: :post,
|
42
|
-
path: format("/v1/invoices/%<invoice>s/attach_payment", { invoice: CGI.escape(invoice) }),
|
43
|
-
params: params,
|
44
|
-
opts: opts,
|
45
|
-
base_address: :api
|
46
|
-
)
|
47
|
-
end
|
48
|
-
|
49
|
-
# Attaches a PaymentIntent to the invoice, adding it to the list of payments.
|
50
|
-
# When the PaymentIntent's status changes to succeeded, the payment is credited
|
51
|
-
# to the invoice, increasing its amount_paid. When the invoice is fully paid, the
|
52
|
-
# invoice's status becomes paid.
|
53
|
-
#
|
54
|
-
# If the PaymentIntent's status is already succeeded when it is attached, it is
|
55
|
-
# credited to the invoice immediately.
|
56
|
-
#
|
57
|
-
# Related guide: [Create an invoice payment](https://stripe.com/docs/invoicing/payments/create)
|
58
|
-
def attach_payment_intent(invoice, params = {}, opts = {})
|
59
|
-
request(
|
60
|
-
method: :post,
|
61
|
-
path: format("/v1/invoices/%<invoice>s/attach_payment_intent", { invoice: CGI.escape(invoice) }),
|
62
|
-
params: params,
|
63
|
-
opts: opts,
|
64
|
-
base_address: :api
|
65
|
-
)
|
66
|
-
end
|
67
|
-
|
68
25
|
# 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.
|
69
26
|
def create(params = {}, opts = {})
|
70
27
|
request(method: :post, path: "/v1/invoices", params: params, opts: opts, base_address: :api)
|
@@ -3,18 +3,14 @@
|
|
3
3
|
|
4
4
|
module Stripe
|
5
5
|
class IssuingService < StripeService
|
6
|
-
attr_reader :authorizations, :cards, :cardholders, :
|
6
|
+
attr_reader :authorizations, :cards, :cardholders, :disputes, :personalization_designs, :physical_bundles, :tokens, :transactions
|
7
7
|
|
8
8
|
def initialize(requestor)
|
9
9
|
super(requestor)
|
10
10
|
@authorizations = Stripe::Issuing::AuthorizationService.new(@requestor)
|
11
11
|
@cards = Stripe::Issuing::CardService.new(@requestor)
|
12
12
|
@cardholders = Stripe::Issuing::CardholderService.new(@requestor)
|
13
|
-
@credit_underwriting_records = Stripe::Issuing::CreditUnderwritingRecordService
|
14
|
-
.new(@requestor)
|
15
13
|
@disputes = Stripe::Issuing::DisputeService.new(@requestor)
|
16
|
-
@dispute_settlement_details = Stripe::Issuing::DisputeSettlementDetailService.new(@requestor)
|
17
|
-
@fraud_liability_debits = Stripe::Issuing::FraudLiabilityDebitService.new(@requestor)
|
18
14
|
@personalization_designs = Stripe::Issuing::PersonalizationDesignService.new(@requestor)
|
19
15
|
@physical_bundles = Stripe::Issuing::PhysicalBundleService.new(@requestor)
|
20
16
|
@tokens = Stripe::Issuing::TokenService.new(@requestor)
|
@@ -99,32 +99,6 @@ module Stripe
|
|
99
99
|
)
|
100
100
|
end
|
101
101
|
|
102
|
-
# Perform a decremental authorization on an eligible
|
103
|
-
# [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the
|
104
|
-
# PaymentIntent's status must be requires_capture and
|
105
|
-
# [decremental_authorization.status](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card-decremental_authorization)
|
106
|
-
# must be available.
|
107
|
-
#
|
108
|
-
# Decremental authorizations decrease the authorized amount on your customer's card
|
109
|
-
# to the new, lower amount provided. A single PaymentIntent can call this endpoint multiple times to further decrease the authorized amount.
|
110
|
-
#
|
111
|
-
# After decrement, the PaymentIntent object
|
112
|
-
# returns with the updated
|
113
|
-
# [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount).
|
114
|
-
# The PaymentIntent will now be capturable up to the new authorized amount.
|
115
|
-
#
|
116
|
-
# Each PaymentIntent can have a maximum of 10 decremental or incremental authorization attempts, including declines.
|
117
|
-
# After it's fully captured, a PaymentIntent can no longer be decremented.
|
118
|
-
def decrement_authorization(intent, params = {}, opts = {})
|
119
|
-
request(
|
120
|
-
method: :post,
|
121
|
-
path: format("/v1/payment_intents/%<intent>s/decrement_authorization", { intent: CGI.escape(intent) }),
|
122
|
-
params: params,
|
123
|
-
opts: opts,
|
124
|
-
base_address: :api
|
125
|
-
)
|
126
|
-
end
|
127
|
-
|
128
102
|
# Perform an incremental authorization on an eligible
|
129
103
|
# [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the
|
130
104
|
# PaymentIntent's status must be requires_capture and
|
@@ -199,17 +173,6 @@ module Stripe
|
|
199
173
|
)
|
200
174
|
end
|
201
175
|
|
202
|
-
# Trigger an external action on a PaymentIntent.
|
203
|
-
def trigger_action(intent, params = {}, opts = {})
|
204
|
-
request(
|
205
|
-
method: :post,
|
206
|
-
path: format("/v1/test/payment_intents/%<intent>s/trigger_action", { intent: CGI.escape(intent) }),
|
207
|
-
params: params,
|
208
|
-
opts: opts,
|
209
|
-
base_address: :api
|
210
|
-
)
|
211
|
-
end
|
212
|
-
|
213
176
|
# Updates properties on a PaymentIntent object without confirming.
|
214
177
|
#
|
215
178
|
# Depending on which properties you update, you might need to confirm the
|
@@ -3,14 +3,10 @@
|
|
3
3
|
|
4
4
|
module Stripe
|
5
5
|
class QuoteService < StripeService
|
6
|
-
attr_reader :
|
6
|
+
attr_reader :line_items, :computed_upfront_line_items
|
7
7
|
|
8
8
|
def initialize(requestor)
|
9
9
|
super(requestor)
|
10
|
-
@preview_invoices = Stripe::QuotePreviewInvoiceService.new(@requestor)
|
11
|
-
@preview_subscription_schedules = Stripe::QuotePreviewSubscriptionScheduleService
|
12
|
-
.new(@requestor)
|
13
|
-
@lines = Stripe::QuoteLineService.new(@requestor)
|
14
10
|
@line_items = Stripe::QuoteLineItemService.new(@requestor)
|
15
11
|
@computed_upfront_line_items = Stripe::QuoteComputedUpfrontLineItemsService.new(@requestor)
|
16
12
|
end
|
@@ -58,39 +54,6 @@ module Stripe
|
|
58
54
|
request(method: :get, path: "/v1/quotes", params: params, opts: opts, base_address: :api)
|
59
55
|
end
|
60
56
|
|
61
|
-
# Preview the invoice line items that would be generated by accepting the quote.
|
62
|
-
def list_preview_invoice_lines(quote, preview_invoice, params = {}, opts = {})
|
63
|
-
request(
|
64
|
-
method: :get,
|
65
|
-
path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(quote), preview_invoice: CGI.escape(preview_invoice) }),
|
66
|
-
params: params,
|
67
|
-
opts: opts,
|
68
|
-
base_address: :api
|
69
|
-
)
|
70
|
-
end
|
71
|
-
|
72
|
-
# Converts a stale quote to draft.
|
73
|
-
def mark_draft(quote, params = {}, opts = {})
|
74
|
-
request(
|
75
|
-
method: :post,
|
76
|
-
path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(quote) }),
|
77
|
-
params: params,
|
78
|
-
opts: opts,
|
79
|
-
base_address: :api
|
80
|
-
)
|
81
|
-
end
|
82
|
-
|
83
|
-
# Converts a draft or open quote to stale.
|
84
|
-
def mark_stale(quote, params = {}, opts = {})
|
85
|
-
request(
|
86
|
-
method: :post,
|
87
|
-
path: format("/v1/quotes/%<quote>s/mark_stale", { quote: CGI.escape(quote) }),
|
88
|
-
params: params,
|
89
|
-
opts: opts,
|
90
|
-
base_address: :api
|
91
|
-
)
|
92
|
-
end
|
93
|
-
|
94
57
|
# Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf)
|
95
58
|
def pdf(quote, params = {}, opts = {}, &read_body_chunk_block)
|
96
59
|
opts = { api_base: APIRequestor.active_requestor.config.uploads_base }.merge(opts)
|
@@ -104,17 +67,6 @@ module Stripe
|
|
104
67
|
)
|
105
68
|
end
|
106
69
|
|
107
|
-
# Recompute the upcoming invoice estimate for the quote.
|
108
|
-
def reestimate(quote, params = {}, opts = {})
|
109
|
-
request(
|
110
|
-
method: :post,
|
111
|
-
path: format("/v1/quotes/%<quote>s/reestimate", { quote: CGI.escape(quote) }),
|
112
|
-
params: params,
|
113
|
-
opts: opts,
|
114
|
-
base_address: :api
|
115
|
-
)
|
116
|
-
end
|
117
|
-
|
118
70
|
# Retrieves the quote with the given ID.
|
119
71
|
def retrieve(quote, params = {}, opts = {})
|
120
72
|
request(
|
@@ -3,17 +3,6 @@
|
|
3
3
|
|
4
4
|
module Stripe
|
5
5
|
class SubscriptionScheduleService < StripeService
|
6
|
-
# Amends an existing subscription schedule.
|
7
|
-
def amend(schedule, params = {}, opts = {})
|
8
|
-
request(
|
9
|
-
method: :post,
|
10
|
-
path: format("/v1/subscription_schedules/%<schedule>s/amend", { schedule: CGI.escape(schedule) }),
|
11
|
-
params: params,
|
12
|
-
opts: opts,
|
13
|
-
base_address: :api
|
14
|
-
)
|
15
|
-
end
|
16
|
-
|
17
6
|
# Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active.
|
18
7
|
def cancel(schedule, params = {}, opts = {})
|
19
8
|
request(
|
@@ -3,13 +3,11 @@
|
|
3
3
|
|
4
4
|
module Stripe
|
5
5
|
class TaxService < StripeService
|
6
|
-
attr_reader :
|
6
|
+
attr_reader :calculations, :registrations, :settings, :transactions
|
7
7
|
|
8
8
|
def initialize(requestor)
|
9
9
|
super(requestor)
|
10
|
-
@associations = Stripe::Tax::AssociationService.new(@requestor)
|
11
10
|
@calculations = Stripe::Tax::CalculationService.new(@requestor)
|
12
|
-
@forms = Stripe::Tax::FormService.new(@requestor)
|
13
11
|
@registrations = Stripe::Tax::RegistrationService.new(@requestor)
|
14
12
|
@settings = Stripe::Tax::SettingsService.new(@requestor)
|
15
13
|
@transactions = Stripe::Tax::TransactionService.new(@requestor)
|
@@ -15,39 +15,6 @@ module Stripe
|
|
15
15
|
)
|
16
16
|
end
|
17
17
|
|
18
|
-
# Initiates an input collection flow on a Reader.
|
19
|
-
def collect_inputs(reader, params = {}, opts = {})
|
20
|
-
request(
|
21
|
-
method: :post,
|
22
|
-
path: format("/v1/terminal/readers/%<reader>s/collect_inputs", { reader: CGI.escape(reader) }),
|
23
|
-
params: params,
|
24
|
-
opts: opts,
|
25
|
-
base_address: :api
|
26
|
-
)
|
27
|
-
end
|
28
|
-
|
29
|
-
# Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation.
|
30
|
-
def collect_payment_method(reader, params = {}, opts = {})
|
31
|
-
request(
|
32
|
-
method: :post,
|
33
|
-
path: format("/v1/terminal/readers/%<reader>s/collect_payment_method", { reader: CGI.escape(reader) }),
|
34
|
-
params: params,
|
35
|
-
opts: opts,
|
36
|
-
base_address: :api
|
37
|
-
)
|
38
|
-
end
|
39
|
-
|
40
|
-
# Finalizes a payment on a Reader.
|
41
|
-
def confirm_payment_intent(reader, params = {}, opts = {})
|
42
|
-
request(
|
43
|
-
method: :post,
|
44
|
-
path: format("/v1/terminal/readers/%<reader>s/confirm_payment_intent", { reader: CGI.escape(reader) }),
|
45
|
-
params: params,
|
46
|
-
opts: opts,
|
47
|
-
base_address: :api
|
48
|
-
)
|
49
|
-
end
|
50
|
-
|
51
18
|
# Creates a new Reader object.
|
52
19
|
def create(params = {}, opts = {})
|
53
20
|
request(
|
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
module Stripe
|
5
5
|
class TerminalService < StripeService
|
6
|
-
attr_reader :configurations, :connection_tokens, :locations, :readers
|
6
|
+
attr_reader :configurations, :connection_tokens, :locations, :readers
|
7
7
|
|
8
8
|
def initialize(requestor)
|
9
9
|
super(requestor)
|
@@ -11,7 +11,6 @@ module Stripe
|
|
11
11
|
@connection_tokens = Stripe::Terminal::ConnectionTokenService.new(@requestor)
|
12
12
|
@locations = Stripe::Terminal::LocationService.new(@requestor)
|
13
13
|
@readers = Stripe::Terminal::ReaderService.new(@requestor)
|
14
|
-
@reader_collected_data = Stripe::Terminal::ReaderCollectedDataService.new(@requestor)
|
15
14
|
end
|
16
15
|
end
|
17
16
|
end
|
@@ -4,7 +4,7 @@ module Stripe
|
|
4
4
|
class V1Services < StripeService
|
5
5
|
# v1 accessors: The beginning of the section generated from our OpenAPI spec
|
6
6
|
attr_reader :accounts
|
7
|
-
attr_reader :account_links, :
|
7
|
+
attr_reader :account_links, :account_sessions, :apple_pay_domains, :application_fees, :apps, :balance, :balance_transactions, :billing, :billing_portal, :charges, :checkout, :climate, :confirmation_tokens, :test_helpers, :country_specs, :coupons, :credit_notes, :customers, :customer_sessions, :disputes, :entitlements, :ephemeral_keys, :events, :exchange_rates, :files, :file_links, :financial_connections, :forwarding, :identity, :invoices, :invoice_rendering_templates, :invoice_items, :issuing, :mandates, :payment_intents, :payment_links, :payment_methods, :payment_method_configurations, :payment_method_domains, :payouts, :plans, :prices, :products, :promotion_codes, :quotes, :radar, :refunds, :reporting, :reviews, :sigma, :setup_attempts, :setup_intents, :shipping_rates, :sources, :subscriptions, :subscription_items, :subscription_schedules, :tax, :tax_codes, :tax_ids, :tax_rates, :terminal, :tokens, :topups, :transfers, :treasury, :webhook_endpoints
|
8
8
|
# v1 accessors: The end of the section generated from our OpenAPI spec
|
9
9
|
|
10
10
|
# OAuthService is manually maintained, as it has special behaviors
|
@@ -15,7 +15,6 @@ module Stripe
|
|
15
15
|
# v1 services: The beginning of the section generated from our OpenAPI spec
|
16
16
|
@accounts = Stripe::AccountService.new(@requestor)
|
17
17
|
@account_links = Stripe::AccountLinkService.new(@requestor)
|
18
|
-
@account_notices = Stripe::AccountNoticeService.new(@requestor)
|
19
18
|
@account_sessions = Stripe::AccountSessionService.new(@requestor)
|
20
19
|
@apple_pay_domains = Stripe::ApplePayDomainService.new(@requestor)
|
21
20
|
@application_fees = Stripe::ApplicationFeeService.new(@requestor)
|
@@ -24,7 +23,6 @@ module Stripe
|
|
24
23
|
@balance_transactions = Stripe::BalanceTransactionService.new(@requestor)
|
25
24
|
@billing = Stripe::BillingService.new(@requestor)
|
26
25
|
@billing_portal = Stripe::BillingPortalService.new(@requestor)
|
27
|
-
@capital = Stripe::CapitalService.new(@requestor)
|
28
26
|
@charges = Stripe::ChargeService.new(@requestor)
|
29
27
|
@checkout = Stripe::CheckoutService.new(@requestor)
|
30
28
|
@climate = Stripe::ClimateService.new(@requestor)
|
@@ -44,22 +42,17 @@ module Stripe
|
|
44
42
|
@file_links = Stripe::FileLinkService.new(@requestor)
|
45
43
|
@financial_connections = Stripe::FinancialConnectionsService.new(@requestor)
|
46
44
|
@forwarding = Stripe::ForwardingService.new(@requestor)
|
47
|
-
@gift_cards = Stripe::GiftCardsService.new(@requestor)
|
48
45
|
@identity = Stripe::IdentityService.new(@requestor)
|
49
46
|
@invoices = Stripe::InvoiceService.new(@requestor)
|
50
47
|
@invoice_rendering_templates = Stripe::InvoiceRenderingTemplateService.new(@requestor)
|
51
48
|
@invoice_items = Stripe::InvoiceItemService.new(@requestor)
|
52
49
|
@issuing = Stripe::IssuingService.new(@requestor)
|
53
50
|
@mandates = Stripe::MandateService.new(@requestor)
|
54
|
-
@margins = Stripe::MarginService.new(@requestor)
|
55
|
-
@orders = Stripe::OrderService.new(@requestor)
|
56
|
-
@payment_attempt_records = Stripe::PaymentAttemptRecordService.new(@requestor)
|
57
51
|
@payment_intents = Stripe::PaymentIntentService.new(@requestor)
|
58
52
|
@payment_links = Stripe::PaymentLinkService.new(@requestor)
|
59
53
|
@payment_methods = Stripe::PaymentMethodService.new(@requestor)
|
60
54
|
@payment_method_configurations = Stripe::PaymentMethodConfigurationService.new(@requestor)
|
61
55
|
@payment_method_domains = Stripe::PaymentMethodDomainService.new(@requestor)
|
62
|
-
@payment_records = Stripe::PaymentRecordService.new(@requestor)
|
63
56
|
@payouts = Stripe::PayoutService.new(@requestor)
|
64
57
|
@plans = Stripe::PlanService.new(@requestor)
|
65
58
|
@prices = Stripe::PriceService.new(@requestor)
|
data/lib/stripe/services.rb
CHANGED
@@ -5,7 +5,6 @@ require "stripe/services/account_capability_service"
|
|
5
5
|
require "stripe/services/account_external_account_service"
|
6
6
|
require "stripe/services/account_link_service"
|
7
7
|
require "stripe/services/account_login_link_service"
|
8
|
-
require "stripe/services/account_notice_service"
|
9
8
|
require "stripe/services/account_person_service"
|
10
9
|
require "stripe/services/account_service"
|
11
10
|
require "stripe/services/account_session_service"
|
@@ -28,10 +27,6 @@ require "stripe/services/billing_portal/configuration_service"
|
|
28
27
|
require "stripe/services/billing_portal/session_service"
|
29
28
|
require "stripe/services/billing_portal_service"
|
30
29
|
require "stripe/services/billing_service"
|
31
|
-
require "stripe/services/capital/financing_offer_service"
|
32
|
-
require "stripe/services/capital/financing_summary_service"
|
33
|
-
require "stripe/services/capital/financing_transaction_service"
|
34
|
-
require "stripe/services/capital_service"
|
35
30
|
require "stripe/services/charge_service"
|
36
31
|
require "stripe/services/checkout/session_line_item_service"
|
37
32
|
require "stripe/services/checkout/session_service"
|
@@ -64,51 +59,37 @@ require "stripe/services/event_service"
|
|
64
59
|
require "stripe/services/exchange_rate_service"
|
65
60
|
require "stripe/services/file_link_service"
|
66
61
|
require "stripe/services/file_service"
|
67
|
-
require "stripe/services/financial_connections/account_inferred_balance_service"
|
68
62
|
require "stripe/services/financial_connections/account_owner_service"
|
69
63
|
require "stripe/services/financial_connections/account_service"
|
70
|
-
require "stripe/services/financial_connections/institution_service"
|
71
64
|
require "stripe/services/financial_connections/session_service"
|
72
65
|
require "stripe/services/financial_connections/transaction_service"
|
73
66
|
require "stripe/services/financial_connections_service"
|
74
67
|
require "stripe/services/forwarding/request_service"
|
75
68
|
require "stripe/services/forwarding_service"
|
76
|
-
require "stripe/services/gift_cards/card_service"
|
77
|
-
require "stripe/services/gift_cards/transaction_service"
|
78
|
-
require "stripe/services/gift_cards_service"
|
79
69
|
require "stripe/services/identity/verification_report_service"
|
80
70
|
require "stripe/services/identity/verification_session_service"
|
81
71
|
require "stripe/services/identity_service"
|
82
72
|
require "stripe/services/invoice_item_service"
|
83
73
|
require "stripe/services/invoice_line_item_service"
|
84
|
-
require "stripe/services/invoice_payment_service"
|
85
74
|
require "stripe/services/invoice_rendering_template_service"
|
86
75
|
require "stripe/services/invoice_service"
|
87
76
|
require "stripe/services/invoice_upcoming_lines_service"
|
88
77
|
require "stripe/services/issuing/authorization_service"
|
89
78
|
require "stripe/services/issuing/card_service"
|
90
79
|
require "stripe/services/issuing/cardholder_service"
|
91
|
-
require "stripe/services/issuing/credit_underwriting_record_service"
|
92
80
|
require "stripe/services/issuing/dispute_service"
|
93
|
-
require "stripe/services/issuing/dispute_settlement_detail_service"
|
94
|
-
require "stripe/services/issuing/fraud_liability_debit_service"
|
95
81
|
require "stripe/services/issuing/personalization_design_service"
|
96
82
|
require "stripe/services/issuing/physical_bundle_service"
|
97
83
|
require "stripe/services/issuing/token_service"
|
98
84
|
require "stripe/services/issuing/transaction_service"
|
99
85
|
require "stripe/services/issuing_service"
|
100
86
|
require "stripe/services/mandate_service"
|
101
|
-
require "stripe/services/margin_service"
|
102
|
-
require "stripe/services/order_line_item_service"
|
103
|
-
require "stripe/services/order_service"
|
104
|
-
require "stripe/services/payment_attempt_record_service"
|
105
87
|
require "stripe/services/payment_intent_service"
|
106
88
|
require "stripe/services/payment_link_line_item_service"
|
107
89
|
require "stripe/services/payment_link_service"
|
108
90
|
require "stripe/services/payment_method_configuration_service"
|
109
91
|
require "stripe/services/payment_method_domain_service"
|
110
92
|
require "stripe/services/payment_method_service"
|
111
|
-
require "stripe/services/payment_record_service"
|
112
93
|
require "stripe/services/payout_service"
|
113
94
|
require "stripe/services/plan_service"
|
114
95
|
require "stripe/services/price_service"
|
@@ -117,9 +98,6 @@ require "stripe/services/product_service"
|
|
117
98
|
require "stripe/services/promotion_code_service"
|
118
99
|
require "stripe/services/quote_computed_upfront_line_items_service"
|
119
100
|
require "stripe/services/quote_line_item_service"
|
120
|
-
require "stripe/services/quote_line_service"
|
121
|
-
require "stripe/services/quote_preview_invoice_service"
|
122
|
-
require "stripe/services/quote_preview_subscription_schedule_service"
|
123
101
|
require "stripe/services/quote_service"
|
124
102
|
require "stripe/services/radar/early_fraud_warning_service"
|
125
103
|
require "stripe/services/radar/value_list_item_service"
|
@@ -142,10 +120,8 @@ require "stripe/services/subscription_item_usage_record_service"
|
|
142
120
|
require "stripe/services/subscription_item_usage_record_summary_service"
|
143
121
|
require "stripe/services/subscription_schedule_service"
|
144
122
|
require "stripe/services/subscription_service"
|
145
|
-
require "stripe/services/tax/association_service"
|
146
123
|
require "stripe/services/tax/calculation_line_item_service"
|
147
124
|
require "stripe/services/tax/calculation_service"
|
148
|
-
require "stripe/services/tax/form_service"
|
149
125
|
require "stripe/services/tax/registration_service"
|
150
126
|
require "stripe/services/tax/settings_service"
|
151
127
|
require "stripe/services/tax/transaction_line_item_service"
|
@@ -157,7 +133,6 @@ require "stripe/services/tax_service"
|
|
157
133
|
require "stripe/services/terminal/configuration_service"
|
158
134
|
require "stripe/services/terminal/connection_token_service"
|
159
135
|
require "stripe/services/terminal/location_service"
|
160
|
-
require "stripe/services/terminal/reader_collected_data_service"
|
161
136
|
require "stripe/services/terminal/reader_service"
|
162
137
|
require "stripe/services/terminal_service"
|
163
138
|
require "stripe/services/test_helpers/confirmation_token_service"
|
data/lib/stripe/stripe_client.rb
CHANGED
@@ -76,7 +76,7 @@ module Stripe
|
|
76
76
|
|
77
77
|
def deserialize(data, api_mode: :v1)
|
78
78
|
data = JSON.parse(data) if data.is_a?(String)
|
79
|
-
Util.convert_to_stripe_object(data, {}, api_mode: api_mode)
|
79
|
+
Util.convert_to_stripe_object(data, {}, api_mode: api_mode, requestor: @requestor)
|
80
80
|
end
|
81
81
|
end
|
82
82
|
end
|
@@ -25,8 +25,7 @@ module Stripe
|
|
25
25
|
# If `.logger` is set, the value of `.log_level` is ignored. The decision on
|
26
26
|
# what levels to print is entirely deferred to the logger.
|
27
27
|
class StripeConfiguration
|
28
|
-
attr_accessor :api_key, :api_version, :
|
29
|
-
:stripe_account, :stripe_context
|
28
|
+
attr_accessor :api_key, :api_version, :client_id, :enable_telemetry, :logger, :stripe_account, :stripe_context
|
30
29
|
|
31
30
|
attr_reader :api_base, :uploads_base, :connect_base, :meter_events_base, :base_addresses, :ca_bundle_path,
|
32
31
|
:log_level, :initial_network_retry_delay, :max_network_retries, :max_network_retry_delay,
|
@@ -53,7 +52,6 @@ module Stripe
|
|
53
52
|
|
54
53
|
def initialize
|
55
54
|
@api_version = ApiVersion::CURRENT
|
56
|
-
|
57
55
|
@ca_bundle_path = Stripe::DEFAULT_CA_BUNDLE_PATH
|
58
56
|
@enable_telemetry = true
|
59
57
|
@verify_ssl_certs = true
|
data/lib/stripe/stripe_object.rb
CHANGED
@@ -83,7 +83,6 @@ module Stripe
|
|
83
83
|
@unsaved_values = Set.new
|
84
84
|
@transient_values = Set.new
|
85
85
|
@values[:id] = id if id
|
86
|
-
@id = id
|
87
86
|
@last_response = nil
|
88
87
|
@requestor = requestor || APIRequestor.active_requestor
|
89
88
|
end
|
@@ -154,7 +153,7 @@ module Stripe
|
|
154
153
|
def update_attributes(values, opts = {}, dirty: true)
|
155
154
|
values.each do |k, v|
|
156
155
|
add_accessors([k], values) unless metaclass.method_defined?(k.to_sym)
|
157
|
-
@values[k] = Util.convert_to_stripe_object(v, opts, api_mode: @api_mode)
|
156
|
+
@values[k] = Util.convert_to_stripe_object(v, opts, api_mode: @api_mode, requestor: @requestor)
|
158
157
|
dirty_value!(@values[k]) if dirty
|
159
158
|
@unsaved_values.add(k)
|
160
159
|
end
|
@@ -362,7 +361,7 @@ module Stripe
|
|
362
361
|
"We interpret empty strings as nil in requests. " \
|
363
362
|
"You may set (object).#{k} = nil to delete the property."
|
364
363
|
end
|
365
|
-
@values[k] = Util.convert_to_stripe_object(v, @opts, api_mode: @api_mode)
|
364
|
+
@values[k] = Util.convert_to_stripe_object(v, @opts, api_mode: @api_mode, requestor: @requestor)
|
366
365
|
dirty_value!(@values[k])
|
367
366
|
@unsaved_values.add(k)
|
368
367
|
end
|
@@ -370,10 +369,6 @@ module Stripe
|
|
370
369
|
define_method(:"#{k}?") { @values[k] } if [FalseClass, TrueClass].include?(values[k].class)
|
371
370
|
end
|
372
371
|
end
|
373
|
-
|
374
|
-
keys.each do |k|
|
375
|
-
instance_variable_set(:"@#{k}", values[k])
|
376
|
-
end
|
377
372
|
end
|
378
373
|
|
379
374
|
# Disabling the cop because it's confused by the fact that the methods are
|
@@ -539,7 +534,7 @@ module Stripe
|
|
539
534
|
# example by appending a new hash onto `additional_owners` for an
|
540
535
|
# account.
|
541
536
|
elsif value.is_a?(Hash)
|
542
|
-
Util.convert_to_stripe_object(value, @opts).serialize_params
|
537
|
+
Util.convert_to_stripe_object(value, @opts, api_mode: @api_mode, requestor: @requestor).serialize_params
|
543
538
|
|
544
539
|
elsif value.is_a?(StripeObject)
|
545
540
|
update = value.serialize_params(force: force)
|
data/lib/stripe/util.rb
CHANGED
@@ -127,7 +127,7 @@ module Stripe
|
|
127
127
|
|
128
128
|
case data
|
129
129
|
when Array
|
130
|
-
data.map { |i| convert_to_stripe_object(i, opts, api_mode: api_mode) }
|
130
|
+
data.map { |i| convert_to_stripe_object(i, opts, api_mode: api_mode, requestor: requestor) }
|
131
131
|
when Hash
|
132
132
|
# TODO: This is a terrible hack.
|
133
133
|
# Waiting on https://jira.corp.stripe.com/browse/API_SERVICES-3167 to add
|
@@ -300,13 +300,7 @@ module Stripe
|
|
300
300
|
when String
|
301
301
|
{ api_key: opts }
|
302
302
|
when Hash
|
303
|
-
|
304
|
-
# no need to check the api_key per request.
|
305
|
-
if !(opts.key?(:client) &&
|
306
|
-
opts.fetch(:client).config.authenticator) &&
|
307
|
-
opts.key?(:api_key)
|
308
|
-
check_api_key!(opts.fetch(:api_key))
|
309
|
-
end
|
303
|
+
check_api_key!(opts.fetch(:api_key)) if opts.key?(:api_key)
|
310
304
|
# Explicitly use dup here instead of clone to avoid preserving freeze
|
311
305
|
# state on input params.
|
312
306
|
opts.dup
|
data/lib/stripe/version.rb
CHANGED
data/lib/stripe.rb
CHANGED
@@ -13,7 +13,6 @@ require "set"
|
|
13
13
|
require "socket"
|
14
14
|
require "uri"
|
15
15
|
require "forwardable"
|
16
|
-
require "base64"
|
17
16
|
|
18
17
|
# Version
|
19
18
|
require "stripe/api_version"
|
@@ -51,7 +50,6 @@ require "stripe/api_resource_test_helpers"
|
|
51
50
|
require "stripe/singleton_api_resource"
|
52
51
|
require "stripe/webhook"
|
53
52
|
require "stripe/stripe_configuration"
|
54
|
-
require "stripe/request_signing_authenticator"
|
55
53
|
require "stripe/thin_event"
|
56
54
|
|
57
55
|
# Named API resources
|
@@ -87,7 +85,6 @@ module Stripe
|
|
87
85
|
|
88
86
|
# User configurable options
|
89
87
|
def_delegators :@config, :api_key, :api_key=
|
90
|
-
def_delegators :@config, :authenticator, :authenticator=
|
91
88
|
def_delegators :@config, :api_version, :api_version=
|
92
89
|
def_delegators :@config, :stripe_account, :stripe_account=
|
93
90
|
def_delegators :@config, :api_base, :api_base=
|
@@ -135,48 +132,6 @@ module Stripe
|
|
135
132
|
version: version,
|
136
133
|
}
|
137
134
|
end
|
138
|
-
|
139
|
-
def self.add_beta_version(beta_name, version)
|
140
|
-
if api_version.include?("; #{beta_name}=")
|
141
|
-
raise "Stripe version header #{api_version} already contains entry for beta #{beta_name}"
|
142
|
-
end
|
143
|
-
|
144
|
-
self.api_version = "#{api_version}; #{beta_name}=#{version}"
|
145
|
-
end
|
146
|
-
|
147
|
-
class RawRequest
|
148
|
-
def initialize
|
149
|
-
@opts = {}
|
150
|
-
end
|
151
|
-
|
152
|
-
def execute(method, url, base_address: :api, params: {}, opts: {}, usage: [])
|
153
|
-
opts = Util.normalize_opts(opts)
|
154
|
-
req_opts = RequestOptions.extract_opts_from_hash(opts)
|
155
|
-
|
156
|
-
requestor = APIRequestor.active_requestor
|
157
|
-
resp, = requestor.send(:execute_request_internal, method, url, base_address, params, req_opts,
|
158
|
-
usage)
|
159
|
-
|
160
|
-
requestor.interpret_response(resp)
|
161
|
-
end
|
162
|
-
end
|
163
|
-
|
164
|
-
# Sends a request to Stripe REST API
|
165
|
-
def self.raw_request(method, url, params = {}, opts = {}, base_address: :api)
|
166
|
-
req = RawRequest.new
|
167
|
-
req.execute(method, url, base_address: base_address, params: params, opts: opts,
|
168
|
-
usage: ["raw_request"])
|
169
|
-
end
|
170
|
-
|
171
|
-
def self.deserialize(data, api_mode: :v1)
|
172
|
-
data = JSON.parse(data) if data.is_a?(String)
|
173
|
-
Util.convert_to_stripe_object(data, {}, api_mode: api_mode)
|
174
|
-
end
|
175
|
-
class << self
|
176
|
-
extend Gem::Deprecate
|
177
|
-
deprecate :raw_request, "StripeClient#raw_request", 2024, 9
|
178
|
-
deprecate :deserialize, "StripeClient#deserialize", 2024, 9
|
179
|
-
end
|
180
135
|
end
|
181
136
|
|
182
137
|
Stripe.log_level = ENV["STRIPE_LOG"] unless ENV["STRIPE_LOG"].nil?
|