stripe 11.1.0.pre.beta.1 → 11.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/CHANGELOG.md +655 -1311
 - data/OPENAPI_VERSION +1 -1
 - data/README.md +0 -11
 - data/VERSION +1 -1
 - data/lib/stripe/api_operations/request.rb +1 -2
 - data/lib/stripe/api_version.rb +0 -1
 - data/lib/stripe/object_types.rb +0 -16
 - data/lib/stripe/resources/financial_connections/account.rb +0 -3
 - data/lib/stripe/resources/forwarding/request.rb +3 -3
 - data/lib/stripe/resources/invoice.rb +0 -113
 - data/lib/stripe/resources/payment_intent.rb +0 -50
 - data/lib/stripe/resources/quote.rb +0 -104
 - data/lib/stripe/resources/setup_intent.rb +4 -4
 - data/lib/stripe/resources/subscription_schedule.rb +0 -20
 - data/lib/stripe/resources/terminal/reader.rb +0 -60
 - data/lib/stripe/resources.rb +0 -15
 - data/lib/stripe/stripe_client.rb +28 -62
 - data/lib/stripe/stripe_configuration.rb +1 -2
 - data/lib/stripe/util.rb +1 -8
 - data/lib/stripe/version.rb +1 -1
 - data/lib/stripe.rb +0 -54
 - metadata +4 -20
 - data/lib/stripe/request_signing_authenticator.rb +0 -79
 - data/lib/stripe/resources/account_notice.rb +0 -32
 - data/lib/stripe/resources/capital/financing_offer.rb +0 -49
 - data/lib/stripe/resources/capital/financing_summary.rb +0 -15
 - data/lib/stripe/resources/capital/financing_transaction.rb +0 -27
 - data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +0 -14
 - data/lib/stripe/resources/gift_cards/card.rb +0 -59
 - data/lib/stripe/resources/gift_cards/transaction.rb +0 -93
 - data/lib/stripe/resources/invoice_payment.rb +0 -12
 - data/lib/stripe/resources/issuing/credit_underwriting_record.rb +0 -88
 - data/lib/stripe/resources/margin.rb +0 -37
 - data/lib/stripe/resources/order.rb +0 -120
 - data/lib/stripe/resources/quote_phase.rb +0 -39
 - data/lib/stripe/resources/quote_preview_invoice.rb +0 -43
 - data/lib/stripe/resources/quote_preview_subscription_schedule.rb +0 -11
 - data/lib/stripe/resources/tax/form.rb +0 -49
 
    
        data/OPENAPI_VERSION
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
             
     | 
| 
      
 1 
     | 
    
         
            +
            v961
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -339,17 +339,6 @@ If your beta feature requires a `Stripe-Version` header to be sent, set the `Str 
     | 
|
| 
       339 
339 
     | 
    
         
             
            Stripe.add_beta_version("feature_beta", "v3")
         
     | 
| 
       340 
340 
     | 
    
         
             
            ```
         
     | 
| 
       341 
341 
     | 
    
         | 
| 
       342 
     | 
    
         
            -
            ### Custom requests
         
     | 
| 
       343 
     | 
    
         
            -
             
     | 
| 
       344 
     | 
    
         
            -
            If you would like to send a request to an undocumented API (for example you are in a private beta), or if you prefer to bypass the method definitions in the library and specify your request details directly, you can use the `raw_request` method on `Stripe`.
         
     | 
| 
       345 
     | 
    
         
            -
             
     | 
| 
       346 
     | 
    
         
            -
            ```ruby
         
     | 
| 
       347 
     | 
    
         
            -
            resp = Stripe.raw_request(:post, "/v1/beta_endpoint", {param: 123}, {stripe_version: "2022-11-15; feature_beta=v3"})
         
     | 
| 
       348 
     | 
    
         
            -
             
     | 
| 
       349 
     | 
    
         
            -
            # (Optional) resp is a StripeResponse. You can use `Stripe.deserialize` to get a StripeObject.
         
     | 
| 
       350 
     | 
    
         
            -
            deserialized_resp = Stripe.deserialize(resp.http_body)
         
     | 
| 
       351 
     | 
    
         
            -
            ```
         
     | 
| 
       352 
     | 
    
         
            -
             
     | 
| 
       353 
342 
     | 
    
         
             
            ## Support
         
     | 
| 
       354 
343 
     | 
    
         | 
| 
       355 
344 
     | 
    
         
             
            New features and bug fixes are released on the latest major version of the Stripe Ruby library. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates.
         
     | 
    
        data/VERSION
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            11.1.0 
     | 
| 
      
 1 
     | 
    
         
            +
            11.1.0
         
     | 
| 
         @@ -48,14 +48,13 @@ module Stripe 
     | 
|
| 
       48 
48 
     | 
    
         
             
                      api_key = headers.delete(:api_key)
         
     | 
| 
       49 
49 
     | 
    
         
             
                      api_base = headers.delete(:api_base)
         
     | 
| 
       50 
50 
     | 
    
         
             
                      client = headers.delete(:client)
         
     | 
| 
       51 
     | 
    
         
            -
                      api_mode = headers.delete(:api_mode)
         
     | 
| 
       52 
51 
     | 
    
         
             
                      # Assume all remaining opts must be headers
         
     | 
| 
       53 
52 
     | 
    
         | 
| 
       54 
53 
     | 
    
         
             
                      resp, opts[:api_key] = client.send(
         
     | 
| 
       55 
54 
     | 
    
         
             
                        client_request_method_sym,
         
     | 
| 
       56 
55 
     | 
    
         
             
                        method, url,
         
     | 
| 
       57 
56 
     | 
    
         
             
                        api_base: api_base, api_key: api_key,
         
     | 
| 
       58 
     | 
    
         
            -
                        headers: headers, params: params, usage: usage, 
     | 
| 
      
 57 
     | 
    
         
            +
                        headers: headers, params: params, usage: usage,
         
     | 
| 
       59 
58 
     | 
    
         
             
                        &read_body_chunk_block
         
     | 
| 
       60 
59 
     | 
    
         
             
                      )
         
     | 
| 
       61 
60 
     | 
    
         | 
    
        data/lib/stripe/api_version.rb
    CHANGED
    
    
    
        data/lib/stripe/object_types.rb
    CHANGED
    
    | 
         @@ -15,7 +15,6 @@ module Stripe 
     | 
|
| 
       15 
15 
     | 
    
         
             
                    # object classes: The beginning of the section generated from our OpenAPI spec
         
     | 
| 
       16 
16 
     | 
    
         
             
                    Account.object_name => Account,
         
     | 
| 
       17 
17 
     | 
    
         
             
                    AccountLink.object_name => AccountLink,
         
     | 
| 
       18 
     | 
    
         
            -
                    AccountNotice.object_name => AccountNotice,
         
     | 
| 
       19 
18 
     | 
    
         
             
                    AccountSession.object_name => AccountSession,
         
     | 
| 
       20 
19 
     | 
    
         
             
                    ApplePayDomain.object_name => ApplePayDomain,
         
     | 
| 
       21 
20 
     | 
    
         
             
                    ApplicationFee.object_name => ApplicationFee,
         
     | 
| 
         @@ -31,9 +30,6 @@ module Stripe 
     | 
|
| 
       31 
30 
     | 
    
         
             
                    BillingPortal::Configuration.object_name => BillingPortal::Configuration,
         
     | 
| 
       32 
31 
     | 
    
         
             
                    BillingPortal::Session.object_name => BillingPortal::Session,
         
     | 
| 
       33 
32 
     | 
    
         
             
                    Capability.object_name => Capability,
         
     | 
| 
       34 
     | 
    
         
            -
                    Capital::FinancingOffer.object_name => Capital::FinancingOffer,
         
     | 
| 
       35 
     | 
    
         
            -
                    Capital::FinancingSummary.object_name => Capital::FinancingSummary,
         
     | 
| 
       36 
     | 
    
         
            -
                    Capital::FinancingTransaction.object_name => Capital::FinancingTransaction,
         
     | 
| 
       37 
33 
     | 
    
         
             
                    Card.object_name => Card,
         
     | 
| 
       38 
34 
     | 
    
         
             
                    CashBalance.object_name => CashBalance,
         
     | 
| 
       39 
35 
     | 
    
         
             
                    Charge.object_name => Charge,
         
     | 
| 
         @@ -60,26 +56,20 @@ module Stripe 
     | 
|
| 
       60 
56 
     | 
    
         
             
                    File.object_name => File,
         
     | 
| 
       61 
57 
     | 
    
         
             
                    FileLink.object_name => FileLink,
         
     | 
| 
       62 
58 
     | 
    
         
             
                    FinancialConnections::Account.object_name => FinancialConnections::Account,
         
     | 
| 
       63 
     | 
    
         
            -
                    FinancialConnections::AccountInferredBalance.object_name =>
         
     | 
| 
       64 
     | 
    
         
            -
                    FinancialConnections::AccountInferredBalance,
         
     | 
| 
       65 
59 
     | 
    
         
             
                    FinancialConnections::AccountOwner.object_name => FinancialConnections::AccountOwner,
         
     | 
| 
       66 
60 
     | 
    
         
             
                    FinancialConnections::AccountOwnership.object_name => FinancialConnections::AccountOwnership,
         
     | 
| 
       67 
61 
     | 
    
         
             
                    FinancialConnections::Session.object_name => FinancialConnections::Session,
         
     | 
| 
       68 
62 
     | 
    
         
             
                    FinancialConnections::Transaction.object_name => FinancialConnections::Transaction,
         
     | 
| 
       69 
63 
     | 
    
         
             
                    Forwarding::Request.object_name => Forwarding::Request,
         
     | 
| 
       70 
64 
     | 
    
         
             
                    FundingInstructions.object_name => FundingInstructions,
         
     | 
| 
       71 
     | 
    
         
            -
                    GiftCards::Card.object_name => GiftCards::Card,
         
     | 
| 
       72 
     | 
    
         
            -
                    GiftCards::Transaction.object_name => GiftCards::Transaction,
         
     | 
| 
       73 
65 
     | 
    
         
             
                    Identity::VerificationReport.object_name => Identity::VerificationReport,
         
     | 
| 
       74 
66 
     | 
    
         
             
                    Identity::VerificationSession.object_name => Identity::VerificationSession,
         
     | 
| 
       75 
67 
     | 
    
         
             
                    Invoice.object_name => Invoice,
         
     | 
| 
       76 
68 
     | 
    
         
             
                    InvoiceItem.object_name => InvoiceItem,
         
     | 
| 
       77 
69 
     | 
    
         
             
                    InvoiceLineItem.object_name => InvoiceLineItem,
         
     | 
| 
       78 
     | 
    
         
            -
                    InvoicePayment.object_name => InvoicePayment,
         
     | 
| 
       79 
70 
     | 
    
         
             
                    Issuing::Authorization.object_name => Issuing::Authorization,
         
     | 
| 
       80 
71 
     | 
    
         
             
                    Issuing::Card.object_name => Issuing::Card,
         
     | 
| 
       81 
72 
     | 
    
         
             
                    Issuing::Cardholder.object_name => Issuing::Cardholder,
         
     | 
| 
       82 
     | 
    
         
            -
                    Issuing::CreditUnderwritingRecord.object_name => Issuing::CreditUnderwritingRecord,
         
     | 
| 
       83 
73 
     | 
    
         
             
                    Issuing::Dispute.object_name => Issuing::Dispute,
         
     | 
| 
       84 
74 
     | 
    
         
             
                    Issuing::PersonalizationDesign.object_name => Issuing::PersonalizationDesign,
         
     | 
| 
       85 
75 
     | 
    
         
             
                    Issuing::PhysicalBundle.object_name => Issuing::PhysicalBundle,
         
     | 
| 
         @@ -88,8 +78,6 @@ module Stripe 
     | 
|
| 
       88 
78 
     | 
    
         
             
                    LineItem.object_name => LineItem,
         
     | 
| 
       89 
79 
     | 
    
         
             
                    LoginLink.object_name => LoginLink,
         
     | 
| 
       90 
80 
     | 
    
         
             
                    Mandate.object_name => Mandate,
         
     | 
| 
       91 
     | 
    
         
            -
                    Margin.object_name => Margin,
         
     | 
| 
       92 
     | 
    
         
            -
                    Order.object_name => Order,
         
     | 
| 
       93 
81 
     | 
    
         
             
                    PaymentIntent.object_name => PaymentIntent,
         
     | 
| 
       94 
82 
     | 
    
         
             
                    PaymentLink.object_name => PaymentLink,
         
     | 
| 
       95 
83 
     | 
    
         
             
                    PaymentMethod.object_name => PaymentMethod,
         
     | 
| 
         @@ -103,9 +91,6 @@ module Stripe 
     | 
|
| 
       103 
91 
     | 
    
         
             
                    ProductFeature.object_name => ProductFeature,
         
     | 
| 
       104 
92 
     | 
    
         
             
                    PromotionCode.object_name => PromotionCode,
         
     | 
| 
       105 
93 
     | 
    
         
             
                    Quote.object_name => Quote,
         
     | 
| 
       106 
     | 
    
         
            -
                    QuotePhase.object_name => QuotePhase,
         
     | 
| 
       107 
     | 
    
         
            -
                    QuotePreviewInvoice.object_name => QuotePreviewInvoice,
         
     | 
| 
       108 
     | 
    
         
            -
                    QuotePreviewSubscriptionSchedule.object_name => QuotePreviewSubscriptionSchedule,
         
     | 
| 
       109 
94 
     | 
    
         
             
                    Radar::EarlyFraudWarning.object_name => Radar::EarlyFraudWarning,
         
     | 
| 
       110 
95 
     | 
    
         
             
                    Radar::ValueList.object_name => Radar::ValueList,
         
     | 
| 
       111 
96 
     | 
    
         
             
                    Radar::ValueListItem.object_name => Radar::ValueListItem,
         
     | 
| 
         @@ -125,7 +110,6 @@ module Stripe 
     | 
|
| 
       125 
110 
     | 
    
         
             
                    SubscriptionSchedule.object_name => SubscriptionSchedule,
         
     | 
| 
       126 
111 
     | 
    
         
             
                    Tax::Calculation.object_name => Tax::Calculation,
         
     | 
| 
       127 
112 
     | 
    
         
             
                    Tax::CalculationLineItem.object_name => Tax::CalculationLineItem,
         
     | 
| 
       128 
     | 
    
         
            -
                    Tax::Form.object_name => Tax::Form,
         
     | 
| 
       129 
113 
     | 
    
         
             
                    Tax::Registration.object_name => Tax::Registration,
         
     | 
| 
       130 
114 
     | 
    
         
             
                    Tax::Settings.object_name => Tax::Settings,
         
     | 
| 
       131 
115 
     | 
    
         
             
                    Tax::Transaction.object_name => Tax::Transaction,
         
     | 
| 
         @@ -6,15 +6,12 @@ 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 
     | 
    
         
             
                  def self.object_name
         
     | 
| 
       13 
12 
     | 
    
         
             
                    "financial_connections.account"
         
     | 
| 
       14 
13 
     | 
    
         
             
                  end
         
     | 
| 
       15 
14 
     | 
    
         | 
| 
       16 
     | 
    
         
            -
                  nested_resource_class_methods :inferred_balance, operations: %i[list]
         
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
       18 
15 
     | 
    
         
             
                  # 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).
         
     | 
| 
       19 
16 
     | 
    
         
             
                  def disconnect(params = {}, opts = {})
         
     | 
| 
       20 
17 
     | 
    
         
             
                    request_stripe_object(
         
     | 
| 
         @@ -3,9 +3,9 @@ 
     | 
|
| 
       3 
3 
     | 
    
         | 
| 
       4 
4 
     | 
    
         
             
            module Stripe
         
     | 
| 
       5 
5 
     | 
    
         
             
              module Forwarding
         
     | 
| 
       6 
     | 
    
         
            -
                # Instructs Stripe to make a request on your behalf using the destination URL  
     | 
| 
       7 
     | 
    
         
            -
                #  
     | 
| 
       8 
     | 
    
         
            -
                #  
     | 
| 
      
 6 
     | 
    
         
            +
                # Instructs Stripe to make a request on your behalf using the destination URL. The destination URL
         
     | 
| 
      
 7 
     | 
    
         
            +
                # is activated by Stripe at the time of onboarding. Stripe verifies requests with your credentials
         
     | 
| 
      
 8 
     | 
    
         
            +
                # provided during onboarding, and injects card details from the payment_method into the request.
         
     | 
| 
       9 
9 
     | 
    
         
             
                #
         
     | 
| 
       10 
10 
     | 
    
         
             
                # Stripe redacts all sensitive fields and headers, including authentication credentials and card numbers,
         
     | 
| 
       11 
11 
     | 
    
         
             
                # before storing the request and response data in the forwarding Request object, which are subject to a
         
     | 
| 
         @@ -38,7 +38,6 @@ module Stripe 
     | 
|
| 
       38 
38 
     | 
    
         
             
                extend Stripe::APIOperations::Create
         
     | 
| 
       39 
39 
     | 
    
         
             
                include Stripe::APIOperations::Delete
         
     | 
| 
       40 
40 
     | 
    
         
             
                extend Stripe::APIOperations::List
         
     | 
| 
       41 
     | 
    
         
            -
                extend Stripe::APIOperations::NestedResource
         
     | 
| 
       42 
41 
     | 
    
         
             
                extend Stripe::APIOperations::Search
         
     | 
| 
       43 
42 
     | 
    
         
             
                include Stripe::APIOperations::Save
         
     | 
| 
       44 
43 
     | 
    
         | 
| 
         @@ -47,83 +46,11 @@ module Stripe 
     | 
|
| 
       47 
46 
     | 
    
         
             
                  "invoice"
         
     | 
| 
       48 
47 
     | 
    
         
             
                end
         
     | 
| 
       49 
48 
     | 
    
         | 
| 
       50 
     | 
    
         
            -
                nested_resource_class_methods :payment, operations: %i[retrieve list]
         
     | 
| 
       51 
     | 
    
         
            -
             
     | 
| 
       52 
     | 
    
         
            -
                # Adds multiple line items to an invoice. This is only possible when an invoice is still a draft.
         
     | 
| 
       53 
     | 
    
         
            -
                def add_lines(params = {}, opts = {})
         
     | 
| 
       54 
     | 
    
         
            -
                  request_stripe_object(
         
     | 
| 
       55 
     | 
    
         
            -
                    method: :post,
         
     | 
| 
       56 
     | 
    
         
            -
                    path: format("/v1/invoices/%<invoice>s/add_lines", { invoice: CGI.escape(self["id"]) }),
         
     | 
| 
       57 
     | 
    
         
            -
                    params: params,
         
     | 
| 
       58 
     | 
    
         
            -
                    opts: opts
         
     | 
| 
       59 
     | 
    
         
            -
                  )
         
     | 
| 
       60 
     | 
    
         
            -
                end
         
     | 
| 
       61 
     | 
    
         
            -
             
     | 
| 
       62 
     | 
    
         
            -
                # Adds multiple line items to an invoice. This is only possible when an invoice is still a draft.
         
     | 
| 
       63 
     | 
    
         
            -
                def self.add_lines(invoice, params = {}, opts = {})
         
     | 
| 
       64 
     | 
    
         
            -
                  request_stripe_object(
         
     | 
| 
       65 
     | 
    
         
            -
                    method: :post,
         
     | 
| 
       66 
     | 
    
         
            -
                    path: format("/v1/invoices/%<invoice>s/add_lines", { invoice: CGI.escape(invoice) }),
         
     | 
| 
       67 
     | 
    
         
            -
                    params: params,
         
     | 
| 
       68 
     | 
    
         
            -
                    opts: opts
         
     | 
| 
       69 
     | 
    
         
            -
                  )
         
     | 
| 
       70 
     | 
    
         
            -
                end
         
     | 
| 
       71 
     | 
    
         
            -
             
     | 
| 
       72 
     | 
    
         
            -
                # Attaches a PaymentIntent to the invoice, adding it to the list of payments.
         
     | 
| 
       73 
     | 
    
         
            -
                # When the PaymentIntent's status changes to succeeded, the payment is credited
         
     | 
| 
       74 
     | 
    
         
            -
                # to the invoice, increasing its amount_paid. When the invoice is fully paid, the
         
     | 
| 
       75 
     | 
    
         
            -
                # invoice's status becomes paid.
         
     | 
| 
       76 
     | 
    
         
            -
                #
         
     | 
| 
       77 
     | 
    
         
            -
                # If the PaymentIntent's status is already succeeded when it is attached, it is
         
     | 
| 
       78 
     | 
    
         
            -
                # credited to the invoice immediately.
         
     | 
| 
       79 
     | 
    
         
            -
                #
         
     | 
| 
       80 
     | 
    
         
            -
                # Related guide: [Create an invoice payment](https://stripe.com/docs/invoicing/payments/create)
         
     | 
| 
       81 
     | 
    
         
            -
                def attach_payment_intent(params = {}, opts = {})
         
     | 
| 
       82 
     | 
    
         
            -
                  request_stripe_object(
         
     | 
| 
       83 
     | 
    
         
            -
                    method: :post,
         
     | 
| 
       84 
     | 
    
         
            -
                    path: format("/v1/invoices/%<invoice>s/attach_payment_intent", { invoice: CGI.escape(self["id"]) }),
         
     | 
| 
       85 
     | 
    
         
            -
                    params: params,
         
     | 
| 
       86 
     | 
    
         
            -
                    opts: opts
         
     | 
| 
       87 
     | 
    
         
            -
                  )
         
     | 
| 
       88 
     | 
    
         
            -
                end
         
     | 
| 
       89 
     | 
    
         
            -
             
     | 
| 
       90 
     | 
    
         
            -
                # Attaches a PaymentIntent to the invoice, adding it to the list of payments.
         
     | 
| 
       91 
     | 
    
         
            -
                # When the PaymentIntent's status changes to succeeded, the payment is credited
         
     | 
| 
       92 
     | 
    
         
            -
                # to the invoice, increasing its amount_paid. When the invoice is fully paid, the
         
     | 
| 
       93 
     | 
    
         
            -
                # invoice's status becomes paid.
         
     | 
| 
       94 
     | 
    
         
            -
                #
         
     | 
| 
       95 
     | 
    
         
            -
                # If the PaymentIntent's status is already succeeded when it is attached, it is
         
     | 
| 
       96 
     | 
    
         
            -
                # credited to the invoice immediately.
         
     | 
| 
       97 
     | 
    
         
            -
                #
         
     | 
| 
       98 
     | 
    
         
            -
                # Related guide: [Create an invoice payment](https://stripe.com/docs/invoicing/payments/create)
         
     | 
| 
       99 
     | 
    
         
            -
                def self.attach_payment_intent(invoice, params = {}, opts = {})
         
     | 
| 
       100 
     | 
    
         
            -
                  request_stripe_object(
         
     | 
| 
       101 
     | 
    
         
            -
                    method: :post,
         
     | 
| 
       102 
     | 
    
         
            -
                    path: format("/v1/invoices/%<invoice>s/attach_payment_intent", { invoice: CGI.escape(invoice) }),
         
     | 
| 
       103 
     | 
    
         
            -
                    params: params,
         
     | 
| 
       104 
     | 
    
         
            -
                    opts: opts
         
     | 
| 
       105 
     | 
    
         
            -
                  )
         
     | 
| 
       106 
     | 
    
         
            -
                end
         
     | 
| 
       107 
     | 
    
         
            -
             
     | 
| 
       108 
49 
     | 
    
         
             
                # 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.
         
     | 
| 
       109 
50 
     | 
    
         
             
                def self.create(params = {}, opts = {})
         
     | 
| 
       110 
51 
     | 
    
         
             
                  request_stripe_object(method: :post, path: "/v1/invoices", params: params, opts: opts)
         
     | 
| 
       111 
52 
     | 
    
         
             
                end
         
     | 
| 
       112 
53 
     | 
    
         | 
| 
       113 
     | 
    
         
            -
                # At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.
         
     | 
| 
       114 
     | 
    
         
            -
                #
         
     | 
| 
       115 
     | 
    
         
            -
                # Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount.
         
     | 
| 
       116 
     | 
    
         
            -
                #
         
     | 
| 
       117 
     | 
    
         
            -
                # You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.
         
     | 
| 
       118 
     | 
    
         
            -
                def self.create_preview(params = {}, opts = {})
         
     | 
| 
       119 
     | 
    
         
            -
                  request_stripe_object(
         
     | 
| 
       120 
     | 
    
         
            -
                    method: :post,
         
     | 
| 
       121 
     | 
    
         
            -
                    path: "/v1/invoices/create_preview",
         
     | 
| 
       122 
     | 
    
         
            -
                    params: params,
         
     | 
| 
       123 
     | 
    
         
            -
                    opts: opts
         
     | 
| 
       124 
     | 
    
         
            -
                  )
         
     | 
| 
       125 
     | 
    
         
            -
                end
         
     | 
| 
       126 
     | 
    
         
            -
             
     | 
| 
       127 
54 
     | 
    
         
             
                # Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://stripe.com/docs/api#void_invoice).
         
     | 
| 
       128 
55 
     | 
    
         
             
                def self.delete(id, params = {}, opts = {})
         
     | 
| 
       129 
56 
     | 
    
         
             
                  request_stripe_object(
         
     | 
| 
         @@ -219,26 +146,6 @@ module Stripe 
     | 
|
| 
       219 
146 
     | 
    
         
             
                  )
         
     | 
| 
       220 
147 
     | 
    
         
             
                end
         
     | 
| 
       221 
148 
     | 
    
         | 
| 
       222 
     | 
    
         
            -
                # Removes multiple line items from an invoice. This is only possible when an invoice is still a draft.
         
     | 
| 
       223 
     | 
    
         
            -
                def remove_lines(params = {}, opts = {})
         
     | 
| 
       224 
     | 
    
         
            -
                  request_stripe_object(
         
     | 
| 
       225 
     | 
    
         
            -
                    method: :post,
         
     | 
| 
       226 
     | 
    
         
            -
                    path: format("/v1/invoices/%<invoice>s/remove_lines", { invoice: CGI.escape(self["id"]) }),
         
     | 
| 
       227 
     | 
    
         
            -
                    params: params,
         
     | 
| 
       228 
     | 
    
         
            -
                    opts: opts
         
     | 
| 
       229 
     | 
    
         
            -
                  )
         
     | 
| 
       230 
     | 
    
         
            -
                end
         
     | 
| 
       231 
     | 
    
         
            -
             
     | 
| 
       232 
     | 
    
         
            -
                # Removes multiple line items from an invoice. This is only possible when an invoice is still a draft.
         
     | 
| 
       233 
     | 
    
         
            -
                def self.remove_lines(invoice, params = {}, opts = {})
         
     | 
| 
       234 
     | 
    
         
            -
                  request_stripe_object(
         
     | 
| 
       235 
     | 
    
         
            -
                    method: :post,
         
     | 
| 
       236 
     | 
    
         
            -
                    path: format("/v1/invoices/%<invoice>s/remove_lines", { invoice: CGI.escape(invoice) }),
         
     | 
| 
       237 
     | 
    
         
            -
                    params: params,
         
     | 
| 
       238 
     | 
    
         
            -
                    opts: opts
         
     | 
| 
       239 
     | 
    
         
            -
                  )
         
     | 
| 
       240 
     | 
    
         
            -
                end
         
     | 
| 
       241 
     | 
    
         
            -
             
     | 
| 
       242 
149 
     | 
    
         
             
                def self.search(params = {}, opts = {})
         
     | 
| 
       243 
150 
     | 
    
         
             
                  request_stripe_object(method: :get, path: "/v1/invoices/search", params: params, opts: opts)
         
     | 
| 
       244 
151 
     | 
    
         
             
                end
         
     | 
| 
         @@ -295,26 +202,6 @@ module Stripe 
     | 
|
| 
       295 
202 
     | 
    
         
             
                  )
         
     | 
| 
       296 
203 
     | 
    
         
             
                end
         
     | 
| 
       297 
204 
     | 
    
         | 
| 
       298 
     | 
    
         
            -
                # Updates multiple line items on an invoice. This is only possible when an invoice is still a draft.
         
     | 
| 
       299 
     | 
    
         
            -
                def update_lines(params = {}, opts = {})
         
     | 
| 
       300 
     | 
    
         
            -
                  request_stripe_object(
         
     | 
| 
       301 
     | 
    
         
            -
                    method: :post,
         
     | 
| 
       302 
     | 
    
         
            -
                    path: format("/v1/invoices/%<invoice>s/update_lines", { invoice: CGI.escape(self["id"]) }),
         
     | 
| 
       303 
     | 
    
         
            -
                    params: params,
         
     | 
| 
       304 
     | 
    
         
            -
                    opts: opts
         
     | 
| 
       305 
     | 
    
         
            -
                  )
         
     | 
| 
       306 
     | 
    
         
            -
                end
         
     | 
| 
       307 
     | 
    
         
            -
             
     | 
| 
       308 
     | 
    
         
            -
                # Updates multiple line items on an invoice. This is only possible when an invoice is still a draft.
         
     | 
| 
       309 
     | 
    
         
            -
                def self.update_lines(invoice, params = {}, opts = {})
         
     | 
| 
       310 
     | 
    
         
            -
                  request_stripe_object(
         
     | 
| 
       311 
     | 
    
         
            -
                    method: :post,
         
     | 
| 
       312 
     | 
    
         
            -
                    path: format("/v1/invoices/%<invoice>s/update_lines", { invoice: CGI.escape(invoice) }),
         
     | 
| 
       313 
     | 
    
         
            -
                    params: params,
         
     | 
| 
       314 
     | 
    
         
            -
                    opts: opts
         
     | 
| 
       315 
     | 
    
         
            -
                  )
         
     | 
| 
       316 
     | 
    
         
            -
                end
         
     | 
| 
       317 
     | 
    
         
            -
             
     | 
| 
       318 
205 
     | 
    
         
             
                # Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.
         
     | 
| 
       319 
206 
     | 
    
         
             
                #
         
     | 
| 
       320 
207 
     | 
    
         
             
                # Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or <a href="#create_credit_note">credit note](https://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business.
         
     | 
| 
         @@ -176,56 +176,6 @@ module Stripe 
     | 
|
| 
       176 
176 
     | 
    
         
             
                  request_stripe_object(method: :post, path: "/v1/payment_intents", params: params, opts: opts)
         
     | 
| 
       177 
177 
     | 
    
         
             
                end
         
     | 
| 
       178 
178 
     | 
    
         | 
| 
       179 
     | 
    
         
            -
                # Perform a decremental authorization on an eligible
         
     | 
| 
       180 
     | 
    
         
            -
                # [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the
         
     | 
| 
       181 
     | 
    
         
            -
                # PaymentIntent's status must be requires_capture and
         
     | 
| 
       182 
     | 
    
         
            -
                # [decremental_authorization.status](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card-decremental_authorization)
         
     | 
| 
       183 
     | 
    
         
            -
                # must be available.
         
     | 
| 
       184 
     | 
    
         
            -
                #
         
     | 
| 
       185 
     | 
    
         
            -
                # Decremental authorizations decrease the authorized amount on your customer's card
         
     | 
| 
       186 
     | 
    
         
            -
                # to the new, lower amount provided. A single PaymentIntent can call this endpoint multiple times to further decrease the authorized amount.
         
     | 
| 
       187 
     | 
    
         
            -
                #
         
     | 
| 
       188 
     | 
    
         
            -
                # After decrement, the PaymentIntent object
         
     | 
| 
       189 
     | 
    
         
            -
                # returns with the updated
         
     | 
| 
       190 
     | 
    
         
            -
                # [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount).
         
     | 
| 
       191 
     | 
    
         
            -
                # The PaymentIntent will now be capturable up to the new authorized amount.
         
     | 
| 
       192 
     | 
    
         
            -
                #
         
     | 
| 
       193 
     | 
    
         
            -
                # Each PaymentIntent can have a maximum of 10 decremental or incremental authorization attempts, including declines.
         
     | 
| 
       194 
     | 
    
         
            -
                # After it's fully captured, a PaymentIntent can no longer be decremented.
         
     | 
| 
       195 
     | 
    
         
            -
                def decrement_authorization(params = {}, opts = {})
         
     | 
| 
       196 
     | 
    
         
            -
                  request_stripe_object(
         
     | 
| 
       197 
     | 
    
         
            -
                    method: :post,
         
     | 
| 
       198 
     | 
    
         
            -
                    path: format("/v1/payment_intents/%<intent>s/decrement_authorization", { intent: CGI.escape(self["id"]) }),
         
     | 
| 
       199 
     | 
    
         
            -
                    params: params,
         
     | 
| 
       200 
     | 
    
         
            -
                    opts: opts
         
     | 
| 
       201 
     | 
    
         
            -
                  )
         
     | 
| 
       202 
     | 
    
         
            -
                end
         
     | 
| 
       203 
     | 
    
         
            -
             
     | 
| 
       204 
     | 
    
         
            -
                # Perform a decremental authorization on an eligible
         
     | 
| 
       205 
     | 
    
         
            -
                # [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the
         
     | 
| 
       206 
     | 
    
         
            -
                # PaymentIntent's status must be requires_capture and
         
     | 
| 
       207 
     | 
    
         
            -
                # [decremental_authorization.status](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card-decremental_authorization)
         
     | 
| 
       208 
     | 
    
         
            -
                # must be available.
         
     | 
| 
       209 
     | 
    
         
            -
                #
         
     | 
| 
       210 
     | 
    
         
            -
                # Decremental authorizations decrease the authorized amount on your customer's card
         
     | 
| 
       211 
     | 
    
         
            -
                # to the new, lower amount provided. A single PaymentIntent can call this endpoint multiple times to further decrease the authorized amount.
         
     | 
| 
       212 
     | 
    
         
            -
                #
         
     | 
| 
       213 
     | 
    
         
            -
                # After decrement, the PaymentIntent object
         
     | 
| 
       214 
     | 
    
         
            -
                # returns with the updated
         
     | 
| 
       215 
     | 
    
         
            -
                # [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount).
         
     | 
| 
       216 
     | 
    
         
            -
                # The PaymentIntent will now be capturable up to the new authorized amount.
         
     | 
| 
       217 
     | 
    
         
            -
                #
         
     | 
| 
       218 
     | 
    
         
            -
                # Each PaymentIntent can have a maximum of 10 decremental or incremental authorization attempts, including declines.
         
     | 
| 
       219 
     | 
    
         
            -
                # After it's fully captured, a PaymentIntent can no longer be decremented.
         
     | 
| 
       220 
     | 
    
         
            -
                def self.decrement_authorization(intent, params = {}, opts = {})
         
     | 
| 
       221 
     | 
    
         
            -
                  request_stripe_object(
         
     | 
| 
       222 
     | 
    
         
            -
                    method: :post,
         
     | 
| 
       223 
     | 
    
         
            -
                    path: format("/v1/payment_intents/%<intent>s/decrement_authorization", { intent: CGI.escape(intent) }),
         
     | 
| 
       224 
     | 
    
         
            -
                    params: params,
         
     | 
| 
       225 
     | 
    
         
            -
                    opts: opts
         
     | 
| 
       226 
     | 
    
         
            -
                  )
         
     | 
| 
       227 
     | 
    
         
            -
                end
         
     | 
| 
       228 
     | 
    
         
            -
             
     | 
| 
       229 
179 
     | 
    
         
             
                # Perform an incremental authorization on an eligible
         
     | 
| 
       230 
180 
     | 
    
         
             
                # [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the
         
     | 
| 
       231 
181 
     | 
    
         
             
                # PaymentIntent's status must be requires_capture and
         
     | 
| 
         @@ -7,7 +7,6 @@ module Stripe 
     | 
|
| 
       7 
7 
     | 
    
         
             
              class Quote < APIResource
         
     | 
| 
       8 
8 
     | 
    
         
             
                extend Stripe::APIOperations::Create
         
     | 
| 
       9 
9 
     | 
    
         
             
                extend Stripe::APIOperations::List
         
     | 
| 
       10 
     | 
    
         
            -
                extend Stripe::APIOperations::NestedResource
         
     | 
| 
       11 
10 
     | 
    
         
             
                include Stripe::APIOperations::Save
         
     | 
| 
       12 
11 
     | 
    
         | 
| 
       13 
12 
     | 
    
         
             
                OBJECT_NAME = "quote"
         
     | 
| 
         @@ -15,9 +14,6 @@ module Stripe 
     | 
|
| 
       15 
14 
     | 
    
         
             
                  "quote"
         
     | 
| 
       16 
15 
     | 
    
         
             
                end
         
     | 
| 
       17 
16 
     | 
    
         | 
| 
       18 
     | 
    
         
            -
                nested_resource_class_methods :preview_invoice, operations: %i[list]
         
     | 
| 
       19 
     | 
    
         
            -
                nested_resource_class_methods :preview_subscription_schedule, operations: %i[list]
         
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
       21 
17 
     | 
    
         
             
                # Accepts the specified quote.
         
     | 
| 
       22 
18 
     | 
    
         
             
                def accept(params = {}, opts = {})
         
     | 
| 
       23 
19 
     | 
    
         
             
                  request_stripe_object(
         
     | 
| 
         @@ -128,86 +124,6 @@ module Stripe 
     | 
|
| 
       128 
124 
     | 
    
         
             
                  )
         
     | 
| 
       129 
125 
     | 
    
         
             
                end
         
     | 
| 
       130 
126 
     | 
    
         | 
| 
       131 
     | 
    
         
            -
                # Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
         
     | 
| 
       132 
     | 
    
         
            -
                def list_lines(params = {}, opts = {})
         
     | 
| 
       133 
     | 
    
         
            -
                  request_stripe_object(
         
     | 
| 
       134 
     | 
    
         
            -
                    method: :get,
         
     | 
| 
       135 
     | 
    
         
            -
                    path: format("/v1/quotes/%<quote>s/lines", { quote: CGI.escape(self["id"]) }),
         
     | 
| 
       136 
     | 
    
         
            -
                    params: params,
         
     | 
| 
       137 
     | 
    
         
            -
                    opts: opts
         
     | 
| 
       138 
     | 
    
         
            -
                  )
         
     | 
| 
       139 
     | 
    
         
            -
                end
         
     | 
| 
       140 
     | 
    
         
            -
             
     | 
| 
       141 
     | 
    
         
            -
                # Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
         
     | 
| 
       142 
     | 
    
         
            -
                def self.list_lines(quote, params = {}, opts = {})
         
     | 
| 
       143 
     | 
    
         
            -
                  request_stripe_object(
         
     | 
| 
       144 
     | 
    
         
            -
                    method: :get,
         
     | 
| 
       145 
     | 
    
         
            -
                    path: format("/v1/quotes/%<quote>s/lines", { quote: CGI.escape(quote) }),
         
     | 
| 
       146 
     | 
    
         
            -
                    params: params,
         
     | 
| 
       147 
     | 
    
         
            -
                    opts: opts
         
     | 
| 
       148 
     | 
    
         
            -
                  )
         
     | 
| 
       149 
     | 
    
         
            -
                end
         
     | 
| 
       150 
     | 
    
         
            -
             
     | 
| 
       151 
     | 
    
         
            -
                # Preview the invoice line items that would be generated by accepting the quote.
         
     | 
| 
       152 
     | 
    
         
            -
                def list_preview_invoice_lines(preview_invoice, params = {}, opts = {})
         
     | 
| 
       153 
     | 
    
         
            -
                  request_stripe_object(
         
     | 
| 
       154 
     | 
    
         
            -
                    method: :get,
         
     | 
| 
       155 
     | 
    
         
            -
                    path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(self["id"]), preview_invoice: CGI.escape(preview_invoice) }),
         
     | 
| 
       156 
     | 
    
         
            -
                    params: params,
         
     | 
| 
       157 
     | 
    
         
            -
                    opts: opts
         
     | 
| 
       158 
     | 
    
         
            -
                  )
         
     | 
| 
       159 
     | 
    
         
            -
                end
         
     | 
| 
       160 
     | 
    
         
            -
             
     | 
| 
       161 
     | 
    
         
            -
                # Preview the invoice line items that would be generated by accepting the quote.
         
     | 
| 
       162 
     | 
    
         
            -
                def self.list_preview_invoice_lines(quote, preview_invoice, params = {}, opts = {})
         
     | 
| 
       163 
     | 
    
         
            -
                  request_stripe_object(
         
     | 
| 
       164 
     | 
    
         
            -
                    method: :get,
         
     | 
| 
       165 
     | 
    
         
            -
                    path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(quote), preview_invoice: CGI.escape(preview_invoice) }),
         
     | 
| 
       166 
     | 
    
         
            -
                    params: params,
         
     | 
| 
       167 
     | 
    
         
            -
                    opts: opts
         
     | 
| 
       168 
     | 
    
         
            -
                  )
         
     | 
| 
       169 
     | 
    
         
            -
                end
         
     | 
| 
       170 
     | 
    
         
            -
             
     | 
| 
       171 
     | 
    
         
            -
                # Converts a stale quote to draft.
         
     | 
| 
       172 
     | 
    
         
            -
                def mark_draft(params = {}, opts = {})
         
     | 
| 
       173 
     | 
    
         
            -
                  request_stripe_object(
         
     | 
| 
       174 
     | 
    
         
            -
                    method: :post,
         
     | 
| 
       175 
     | 
    
         
            -
                    path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(self["id"]) }),
         
     | 
| 
       176 
     | 
    
         
            -
                    params: params,
         
     | 
| 
       177 
     | 
    
         
            -
                    opts: opts
         
     | 
| 
       178 
     | 
    
         
            -
                  )
         
     | 
| 
       179 
     | 
    
         
            -
                end
         
     | 
| 
       180 
     | 
    
         
            -
             
     | 
| 
       181 
     | 
    
         
            -
                # Converts a stale quote to draft.
         
     | 
| 
       182 
     | 
    
         
            -
                def self.mark_draft(quote, params = {}, opts = {})
         
     | 
| 
       183 
     | 
    
         
            -
                  request_stripe_object(
         
     | 
| 
       184 
     | 
    
         
            -
                    method: :post,
         
     | 
| 
       185 
     | 
    
         
            -
                    path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(quote) }),
         
     | 
| 
       186 
     | 
    
         
            -
                    params: params,
         
     | 
| 
       187 
     | 
    
         
            -
                    opts: opts
         
     | 
| 
       188 
     | 
    
         
            -
                  )
         
     | 
| 
       189 
     | 
    
         
            -
                end
         
     | 
| 
       190 
     | 
    
         
            -
             
     | 
| 
       191 
     | 
    
         
            -
                # Converts a draft or open quote to stale.
         
     | 
| 
       192 
     | 
    
         
            -
                def mark_stale(params = {}, opts = {})
         
     | 
| 
       193 
     | 
    
         
            -
                  request_stripe_object(
         
     | 
| 
       194 
     | 
    
         
            -
                    method: :post,
         
     | 
| 
       195 
     | 
    
         
            -
                    path: format("/v1/quotes/%<quote>s/mark_stale", { quote: CGI.escape(self["id"]) }),
         
     | 
| 
       196 
     | 
    
         
            -
                    params: params,
         
     | 
| 
       197 
     | 
    
         
            -
                    opts: opts
         
     | 
| 
       198 
     | 
    
         
            -
                  )
         
     | 
| 
       199 
     | 
    
         
            -
                end
         
     | 
| 
       200 
     | 
    
         
            -
             
     | 
| 
       201 
     | 
    
         
            -
                # Converts a draft or open quote to stale.
         
     | 
| 
       202 
     | 
    
         
            -
                def self.mark_stale(quote, params = {}, opts = {})
         
     | 
| 
       203 
     | 
    
         
            -
                  request_stripe_object(
         
     | 
| 
       204 
     | 
    
         
            -
                    method: :post,
         
     | 
| 
       205 
     | 
    
         
            -
                    path: format("/v1/quotes/%<quote>s/mark_stale", { quote: CGI.escape(quote) }),
         
     | 
| 
       206 
     | 
    
         
            -
                    params: params,
         
     | 
| 
       207 
     | 
    
         
            -
                    opts: opts
         
     | 
| 
       208 
     | 
    
         
            -
                  )
         
     | 
| 
       209 
     | 
    
         
            -
                end
         
     | 
| 
       210 
     | 
    
         
            -
             
     | 
| 
       211 
127 
     | 
    
         
             
                # Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf)
         
     | 
| 
       212 
128 
     | 
    
         
             
                def pdf(params = {}, opts = {}, &read_body_chunk_block)
         
     | 
| 
       213 
129 
     | 
    
         
             
                  config = opts[:client]&.config || Stripe.config
         
     | 
| 
         @@ -234,26 +150,6 @@ module Stripe 
     | 
|
| 
       234 
150 
     | 
    
         
             
                  )
         
     | 
| 
       235 
151 
     | 
    
         
             
                end
         
     | 
| 
       236 
152 
     | 
    
         | 
| 
       237 
     | 
    
         
            -
                # Recompute the upcoming invoice estimate for the quote.
         
     | 
| 
       238 
     | 
    
         
            -
                def reestimate(params = {}, opts = {})
         
     | 
| 
       239 
     | 
    
         
            -
                  request_stripe_object(
         
     | 
| 
       240 
     | 
    
         
            -
                    method: :post,
         
     | 
| 
       241 
     | 
    
         
            -
                    path: format("/v1/quotes/%<quote>s/reestimate", { quote: CGI.escape(self["id"]) }),
         
     | 
| 
       242 
     | 
    
         
            -
                    params: params,
         
     | 
| 
       243 
     | 
    
         
            -
                    opts: opts
         
     | 
| 
       244 
     | 
    
         
            -
                  )
         
     | 
| 
       245 
     | 
    
         
            -
                end
         
     | 
| 
       246 
     | 
    
         
            -
             
     | 
| 
       247 
     | 
    
         
            -
                # Recompute the upcoming invoice estimate for the quote.
         
     | 
| 
       248 
     | 
    
         
            -
                def self.reestimate(quote, params = {}, opts = {})
         
     | 
| 
       249 
     | 
    
         
            -
                  request_stripe_object(
         
     | 
| 
       250 
     | 
    
         
            -
                    method: :post,
         
     | 
| 
       251 
     | 
    
         
            -
                    path: format("/v1/quotes/%<quote>s/reestimate", { quote: CGI.escape(quote) }),
         
     | 
| 
       252 
     | 
    
         
            -
                    params: params,
         
     | 
| 
       253 
     | 
    
         
            -
                    opts: opts
         
     | 
| 
       254 
     | 
    
         
            -
                  )
         
     | 
| 
       255 
     | 
    
         
            -
                end
         
     | 
| 
       256 
     | 
    
         
            -
             
     | 
| 
       257 
153 
     | 
    
         
             
                # A quote models prices and services for a customer.
         
     | 
| 
       258 
154 
     | 
    
         
             
                def self.update(id, params = {}, opts = {})
         
     | 
| 
       259 
155 
     | 
    
         
             
                  request_stripe_object(
         
     | 
| 
         @@ -8,13 +8,13 @@ module Stripe 
     | 
|
| 
       8 
8 
     | 
    
         
             
              #
         
     | 
| 
       9 
9 
     | 
    
         
             
              # Create a SetupIntent when you're ready to collect your customer's payment credentials.
         
     | 
| 
       10 
10 
     | 
    
         
             
              # Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid.
         
     | 
| 
       11 
     | 
    
         
            -
              # The SetupIntent transitions through multiple [statuses](https://stripe.com/ 
     | 
| 
      
 11 
     | 
    
         
            +
              # The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides
         
     | 
| 
       12 
12 
     | 
    
         
             
              # you through the setup process.
         
     | 
| 
       13 
13 
     | 
    
         
             
              #
         
     | 
| 
       14 
14 
     | 
    
         
             
              # Successful SetupIntents result in payment credentials that are optimized for future payments.
         
     | 
| 
       15 
15 
     | 
    
         
             
              # For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through
         
     | 
| 
       16 
     | 
    
         
            -
              # [Strong Customer Authentication](https://stripe.com/ 
     | 
| 
       17 
     | 
    
         
            -
              # to streamline later [off-session payments](https://stripe.com/ 
     | 
| 
      
 16 
     | 
    
         
            +
              # [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection
         
     | 
| 
      
 17 
     | 
    
         
            +
              # to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents).
         
     | 
| 
       18 
18 
     | 
    
         
             
              # If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer),
         
     | 
| 
       19 
19 
     | 
    
         
             
              # it automatically attaches the resulting payment method to that Customer after successful setup.
         
     | 
| 
       20 
20 
     | 
    
         
             
              # We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on
         
     | 
| 
         @@ -22,7 +22,7 @@ module Stripe 
     | 
|
| 
       22 
22 
     | 
    
         
             
              #
         
     | 
| 
       23 
23 
     | 
    
         
             
              # By using SetupIntents, you can reduce friction for your customers, even as regulations change over time.
         
     | 
| 
       24 
24 
     | 
    
         
             
              #
         
     | 
| 
       25 
     | 
    
         
            -
              # Related guide: [Setup Intents API](https://stripe.com/ 
     | 
| 
      
 25 
     | 
    
         
            +
              # Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents)
         
     | 
| 
       26 
26 
     | 
    
         
             
              class SetupIntent < APIResource
         
     | 
| 
       27 
27 
     | 
    
         
             
                extend Stripe::APIOperations::Create
         
     | 
| 
       28 
28 
     | 
    
         
             
                extend Stripe::APIOperations::List
         
     | 
| 
         @@ -15,26 +15,6 @@ module Stripe 
     | 
|
| 
       15 
15 
     | 
    
         
             
                  "subscription_schedule"
         
     | 
| 
       16 
16 
     | 
    
         
             
                end
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
       18 
     | 
    
         
            -
                # Amends an existing subscription schedule.
         
     | 
| 
       19 
     | 
    
         
            -
                def amend(params = {}, opts = {})
         
     | 
| 
       20 
     | 
    
         
            -
                  request_stripe_object(
         
     | 
| 
       21 
     | 
    
         
            -
                    method: :post,
         
     | 
| 
       22 
     | 
    
         
            -
                    path: format("/v1/subscription_schedules/%<schedule>s/amend", { schedule: CGI.escape(self["id"]) }),
         
     | 
| 
       23 
     | 
    
         
            -
                    params: params,
         
     | 
| 
       24 
     | 
    
         
            -
                    opts: opts
         
     | 
| 
       25 
     | 
    
         
            -
                  )
         
     | 
| 
       26 
     | 
    
         
            -
                end
         
     | 
| 
       27 
     | 
    
         
            -
             
     | 
| 
       28 
     | 
    
         
            -
                # Amends an existing subscription schedule.
         
     | 
| 
       29 
     | 
    
         
            -
                def self.amend(schedule, params = {}, opts = {})
         
     | 
| 
       30 
     | 
    
         
            -
                  request_stripe_object(
         
     | 
| 
       31 
     | 
    
         
            -
                    method: :post,
         
     | 
| 
       32 
     | 
    
         
            -
                    path: format("/v1/subscription_schedules/%<schedule>s/amend", { schedule: CGI.escape(schedule) }),
         
     | 
| 
       33 
     | 
    
         
            -
                    params: params,
         
     | 
| 
       34 
     | 
    
         
            -
                    opts: opts
         
     | 
| 
       35 
     | 
    
         
            -
                  )
         
     | 
| 
       36 
     | 
    
         
            -
                end
         
     | 
| 
       37 
     | 
    
         
            -
             
     | 
| 
       38 
18 
     | 
    
         
             
                # 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.
         
     | 
| 
       39 
19 
     | 
    
         
             
                def cancel(params = {}, opts = {})
         
     | 
| 
       40 
20 
     | 
    
         
             
                  request_stripe_object(
         
     | 
| 
         @@ -37,66 +37,6 @@ module Stripe 
     | 
|
| 
       37 
37 
     | 
    
         
             
                    )
         
     | 
| 
       38 
38 
     | 
    
         
             
                  end
         
     | 
| 
       39 
39 
     | 
    
         | 
| 
       40 
     | 
    
         
            -
                  # Initiates an input collection flow on a Reader.
         
     | 
| 
       41 
     | 
    
         
            -
                  def collect_inputs(params = {}, opts = {})
         
     | 
| 
       42 
     | 
    
         
            -
                    request_stripe_object(
         
     | 
| 
       43 
     | 
    
         
            -
                      method: :post,
         
     | 
| 
       44 
     | 
    
         
            -
                      path: format("/v1/terminal/readers/%<reader>s/collect_inputs", { reader: CGI.escape(self["id"]) }),
         
     | 
| 
       45 
     | 
    
         
            -
                      params: params,
         
     | 
| 
       46 
     | 
    
         
            -
                      opts: opts
         
     | 
| 
       47 
     | 
    
         
            -
                    )
         
     | 
| 
       48 
     | 
    
         
            -
                  end
         
     | 
| 
       49 
     | 
    
         
            -
             
     | 
| 
       50 
     | 
    
         
            -
                  # Initiates an input collection flow on a Reader.
         
     | 
| 
       51 
     | 
    
         
            -
                  def self.collect_inputs(reader, params = {}, opts = {})
         
     | 
| 
       52 
     | 
    
         
            -
                    request_stripe_object(
         
     | 
| 
       53 
     | 
    
         
            -
                      method: :post,
         
     | 
| 
       54 
     | 
    
         
            -
                      path: format("/v1/terminal/readers/%<reader>s/collect_inputs", { reader: CGI.escape(reader) }),
         
     | 
| 
       55 
     | 
    
         
            -
                      params: params,
         
     | 
| 
       56 
     | 
    
         
            -
                      opts: opts
         
     | 
| 
       57 
     | 
    
         
            -
                    )
         
     | 
| 
       58 
     | 
    
         
            -
                  end
         
     | 
| 
       59 
     | 
    
         
            -
             
     | 
| 
       60 
     | 
    
         
            -
                  # Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation.
         
     | 
| 
       61 
     | 
    
         
            -
                  def collect_payment_method(params = {}, opts = {})
         
     | 
| 
       62 
     | 
    
         
            -
                    request_stripe_object(
         
     | 
| 
       63 
     | 
    
         
            -
                      method: :post,
         
     | 
| 
       64 
     | 
    
         
            -
                      path: format("/v1/terminal/readers/%<reader>s/collect_payment_method", { reader: CGI.escape(self["id"]) }),
         
     | 
| 
       65 
     | 
    
         
            -
                      params: params,
         
     | 
| 
       66 
     | 
    
         
            -
                      opts: opts
         
     | 
| 
       67 
     | 
    
         
            -
                    )
         
     | 
| 
       68 
     | 
    
         
            -
                  end
         
     | 
| 
       69 
     | 
    
         
            -
             
     | 
| 
       70 
     | 
    
         
            -
                  # Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation.
         
     | 
| 
       71 
     | 
    
         
            -
                  def self.collect_payment_method(reader, params = {}, opts = {})
         
     | 
| 
       72 
     | 
    
         
            -
                    request_stripe_object(
         
     | 
| 
       73 
     | 
    
         
            -
                      method: :post,
         
     | 
| 
       74 
     | 
    
         
            -
                      path: format("/v1/terminal/readers/%<reader>s/collect_payment_method", { reader: CGI.escape(reader) }),
         
     | 
| 
       75 
     | 
    
         
            -
                      params: params,
         
     | 
| 
       76 
     | 
    
         
            -
                      opts: opts
         
     | 
| 
       77 
     | 
    
         
            -
                    )
         
     | 
| 
       78 
     | 
    
         
            -
                  end
         
     | 
| 
       79 
     | 
    
         
            -
             
     | 
| 
       80 
     | 
    
         
            -
                  # Finalizes a payment on a Reader.
         
     | 
| 
       81 
     | 
    
         
            -
                  def confirm_payment_intent(params = {}, opts = {})
         
     | 
| 
       82 
     | 
    
         
            -
                    request_stripe_object(
         
     | 
| 
       83 
     | 
    
         
            -
                      method: :post,
         
     | 
| 
       84 
     | 
    
         
            -
                      path: format("/v1/terminal/readers/%<reader>s/confirm_payment_intent", { reader: CGI.escape(self["id"]) }),
         
     | 
| 
       85 
     | 
    
         
            -
                      params: params,
         
     | 
| 
       86 
     | 
    
         
            -
                      opts: opts
         
     | 
| 
       87 
     | 
    
         
            -
                    )
         
     | 
| 
       88 
     | 
    
         
            -
                  end
         
     | 
| 
       89 
     | 
    
         
            -
             
     | 
| 
       90 
     | 
    
         
            -
                  # Finalizes a payment on a Reader.
         
     | 
| 
       91 
     | 
    
         
            -
                  def self.confirm_payment_intent(reader, params = {}, opts = {})
         
     | 
| 
       92 
     | 
    
         
            -
                    request_stripe_object(
         
     | 
| 
       93 
     | 
    
         
            -
                      method: :post,
         
     | 
| 
       94 
     | 
    
         
            -
                      path: format("/v1/terminal/readers/%<reader>s/confirm_payment_intent", { reader: CGI.escape(reader) }),
         
     | 
| 
       95 
     | 
    
         
            -
                      params: params,
         
     | 
| 
       96 
     | 
    
         
            -
                      opts: opts
         
     | 
| 
       97 
     | 
    
         
            -
                    )
         
     | 
| 
       98 
     | 
    
         
            -
                  end
         
     | 
| 
       99 
     | 
    
         
            -
             
     | 
| 
       100 
40 
     | 
    
         
             
                  # Creates a new Reader object.
         
     | 
| 
       101 
41 
     | 
    
         
             
                  def self.create(params = {}, opts = {})
         
     | 
| 
       102 
42 
     | 
    
         
             
                    request_stripe_object(
         
     |