stripe 6.3.0 → 6.6.0.pre.beta.1
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 +31 -3
 - data/Makefile +1 -1
 - data/OPENAPI_VERSION +1 -1
 - data/VERSION +1 -1
 - data/lib/stripe/api_operations/create.rb +6 -2
 - data/lib/stripe/api_operations/delete.rb +12 -7
 - data/lib/stripe/api_operations/list.rb +6 -9
 - data/lib/stripe/api_operations/nested_resource.rb +62 -34
 - data/lib/stripe/api_operations/request.rb +10 -0
 - data/lib/stripe/api_operations/save.rb +6 -3
 - data/lib/stripe/api_operations/search.rb +6 -9
 - data/lib/stripe/api_resource.rb +1 -1
 - data/lib/stripe/api_version.rb +8 -0
 - data/lib/stripe/object_types.rb +1 -0
 - data/lib/stripe/resources/account.rb +28 -8
 - data/lib/stripe/resources/apps/secret.rb +10 -12
 - data/lib/stripe/resources/charge.rb +10 -3
 - data/lib/stripe/resources/checkout/session.rb +10 -3
 - data/lib/stripe/resources/credit_note.rb +24 -9
 - data/lib/stripe/resources/customer.rb +67 -27
 - data/lib/stripe/resources/dispute.rb +10 -3
 - data/lib/stripe/resources/financial_connections/account.rb +30 -7
 - data/lib/stripe/resources/identity/verification_session.rb +20 -5
 - data/lib/stripe/resources/invoice.rb +64 -17
 - data/lib/stripe/resources/issuing/authorization.rb +20 -5
 - data/lib/stripe/resources/issuing/card.rb +90 -3
 - data/lib/stripe/resources/issuing/dispute.rb +10 -3
 - data/lib/stripe/resources/order.rb +40 -9
 - data/lib/stripe/resources/payment_intent.rb +60 -13
 - data/lib/stripe/resources/payment_link.rb +10 -3
 - data/lib/stripe/resources/payment_method.rb +20 -5
 - data/lib/stripe/resources/payout.rb +20 -5
 - data/lib/stripe/resources/quote.rb +50 -11
 - data/lib/stripe/resources/quote_phase.rb +28 -0
 - data/lib/stripe/resources/refund.rb +19 -5
 - data/lib/stripe/resources/review.rb +10 -3
 - data/lib/stripe/resources/setup_intent.rb +30 -7
 - data/lib/stripe/resources/source.rb +16 -6
 - data/lib/stripe/resources/subscription.rb +10 -3
 - data/lib/stripe/resources/subscription_item.rb +6 -2
 - data/lib/stripe/resources/subscription_schedule.rb +37 -4
 - data/lib/stripe/resources/terminal/reader.rb +49 -11
 - data/lib/stripe/resources/test_helpers/test_clock.rb +10 -3
 - data/lib/stripe/resources/topup.rb +10 -3
 - data/lib/stripe/resources/transfer.rb +10 -3
 - data/lib/stripe/resources/treasury/financial_account.rb +20 -5
 - data/lib/stripe/resources/treasury/inbound_transfer.rb +39 -9
 - data/lib/stripe/resources/treasury/outbound_payment.rb +39 -9
 - data/lib/stripe/resources/treasury/outbound_transfer.rb +43 -9
 - data/lib/stripe/resources/treasury/received_credit.rb +5 -6
 - data/lib/stripe/resources/treasury/received_debit.rb +5 -6
 - data/lib/stripe/resources.rb +1 -0
 - data/lib/stripe/stripe_configuration.rb +2 -0
 - data/lib/stripe/util.rb +38 -3
 - data/lib/stripe/version.rb +1 -1
 - data/lib/stripe.rb +1 -0
 - metadata +6 -4
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 7a286445665c480e3a76c430167b3ab15b3cfee150bbe8dac88c11b6f659a0ad
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: abecc95e3a2bca67e57d7fd45568566f04ea5ae633e93dd6fcfdc67da0f1e35b
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 3831e6f6fa2348dcb6abac005264e128cbb6028ba2f45e4d542c2c35788ad0c1a80547c49fe80d03ae3fa933abc4c9d9c0377600b53c9b75c3ccaccd2ada0e94
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 8beebb89c127e5b66bbb0d4d1358dc41395f39ed282a1b36650615ef705fc0c59da277ee05ba642d07c7001804f2ed5df743e572f66eb50ef01537a325dc120d
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -1,5 +1,35 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # Changelog
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
      
 3 
     | 
    
         
            +
            ## 6.6.0-beta.1 - 2022-07-22
         
     | 
| 
      
 4 
     | 
    
         
            +
            * [#1100](https://github.com/stripe/stripe-ruby/pull/1100) API Updates for beta branch
         
     | 
| 
      
 5 
     | 
    
         
            +
              - Updated stable APIs to the latest version
         
     | 
| 
      
 6 
     | 
    
         
            +
              - Add `QuotePhase` resource
         
     | 
| 
      
 7 
     | 
    
         
            +
            * [#1097](https://github.com/stripe/stripe-ruby/pull/1097) API Updates for beta branch
         
     | 
| 
      
 8 
     | 
    
         
            +
              - Updated stable APIs to the latest version
         
     | 
| 
      
 9 
     | 
    
         
            +
              - Add `SubscriptionSchedule.amend` method.
         
     | 
| 
      
 10 
     | 
    
         
            +
            * [#1093](https://github.com/stripe/stripe-ruby/pull/1093) API Updates for beta branch
         
     | 
| 
      
 11 
     | 
    
         
            +
              - Include `server_side_confirmation_beta=v1` beta
         
     | 
| 
      
 12 
     | 
    
         
            +
              - Add `secretKeyConfirmation` to `PaymentIntent`
         
     | 
| 
      
 13 
     | 
    
         
            +
            * [#1085](https://github.com/stripe/stripe-ruby/pull/1085) API Updates for beta branch
         
     | 
| 
      
 14 
     | 
    
         
            +
              - Updated stable APIs to the latest version
         
     | 
| 
      
 15 
     | 
    
         
            +
            * [#1075](https://github.com/stripe/stripe-ruby/pull/1075) Use the generated API version
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
            ## 6.5.0 - 2022-06-29
         
     | 
| 
      
 18 
     | 
    
         
            +
            * [#1084](https://github.com/stripe/stripe-ruby/pull/1084) API Updates
         
     | 
| 
      
 19 
     | 
    
         
            +
              * Add support for `deliver_card`, `fail_card`, `return_card`, and `ship_card` test helper methods on resource `Issuing.Card`
         
     | 
| 
      
 20 
     | 
    
         
            +
            * [#1076](https://github.com/stripe/stripe-ruby/pull/1076) fix: Update logging to coerce ASCII-8BIT into UTF-8.
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
            ## 6.4.0 - 2022-06-17
         
     | 
| 
      
 23 
     | 
    
         
            +
            * [#1073](https://github.com/stripe/stripe-ruby/pull/1073) API Updates
         
     | 
| 
      
 24 
     | 
    
         
            +
              * Add support for `fund_cash_balance` test helper method on resource `Customer`
         
     | 
| 
      
 25 
     | 
    
         
            +
            * [#1074](https://github.com/stripe/stripe-ruby/pull/1074) Support updating pre-release versions
         
     | 
| 
      
 26 
     | 
    
         
            +
            * [#1072](https://github.com/stripe/stripe-ruby/pull/1072) Trigger workflows on beta branches
         
     | 
| 
      
 27 
     | 
    
         
            +
            * [#1071](https://github.com/stripe/stripe-ruby/pull/1071) Use request_stripe_object for all requests
         
     | 
| 
      
 28 
     | 
    
         
            +
            * [#1070](https://github.com/stripe/stripe-ruby/pull/1070) API Updates
         
     | 
| 
      
 29 
     | 
    
         
            +
              
         
     | 
| 
      
 30 
     | 
    
         
            +
              Switch from using meta-programing to generating explicit methods for custom methods.
         
     | 
| 
      
 31 
     | 
    
         
            +
            * [#1069](https://github.com/stripe/stripe-ruby/pull/1069) chore: Stop special implementation of Account.persons method.
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
       3 
33 
     | 
    
         
             
            ## 6.3.0 - 2022-06-08
         
     | 
| 
       4 
34 
     | 
    
         
             
            * [#1063](https://github.com/stripe/stripe-ruby/pull/1063) fix: Update cash balance methods to no longer require nested ID.
         
     | 
| 
       5 
35 
     | 
    
         | 
| 
         @@ -12,8 +42,6 @@ 
     | 
|
| 
       12 
42 
     | 
    
         
             
              * Add support for new resources `Treasury.CreditReversal`, `Treasury.DebitReversal`, `Treasury.FinancialAccountFeatures`, `Treasury.FinancialAccount`, `Treasury.FlowDetails`, `Treasury.InboundTransfer`, `Treasury.OutboundPayment`, `Treasury.OutboundTransfer`, `Treasury.ReceivedCredit`, `Treasury.ReceivedDebit`, `Treasury.TransactionEntry`, and `Treasury.Transaction`
         
     | 
| 
       13 
43 
     | 
    
         
             
              * Add support for `retrieve_payment_method` method on resource `Customer`
         
     | 
| 
       14 
44 
     | 
    
         
             
              * Add support for `list_owners` and `list` methods on resource `FinancialConnections.Account`
         
     | 
| 
       15 
     | 
    
         
            -
              
         
     | 
| 
       16 
     | 
    
         
            -
              
         
     | 
| 
       17 
45 
     | 
    
         | 
| 
       18 
46 
     | 
    
         
             
            ## 6.0.0 - 2022-05-09
         
     | 
| 
       19 
47 
     | 
    
         
             
            * [#1056](https://github.com/stripe/stripe-ruby/pull/1056) API Updates
         
     | 
| 
         @@ -29,7 +57,6 @@ 
     | 
|
| 
       29 
57 
     | 
    
         
             
            ## 5.55.0 - 2022-05-05
         
     | 
| 
       30 
58 
     | 
    
         
             
            * [#1055](https://github.com/stripe/stripe-ruby/pull/1055) API Updates
         
     | 
| 
       31 
59 
     | 
    
         
             
              * Add support for new resources `FinancialConnections.AccountOwner`, `FinancialConnections.AccountOwnership`, `FinancialConnections.Account`, and `FinancialConnections.Session`
         
     | 
| 
       32 
     | 
    
         
            -
              
         
     | 
| 
       33 
60 
     | 
    
         | 
| 
       34 
61 
     | 
    
         
             
            ## 5.54.0 - 2022-05-03
         
     | 
| 
       35 
62 
     | 
    
         
             
            * [#1053](https://github.com/stripe/stripe-ruby/pull/1053) API Updates
         
     | 
| 
         @@ -1060,3 +1087,4 @@ Identical to 1.56.0 above. I incorrectly cut a patch-level release. 
     | 
|
| 
       1060 
1087 
     | 
    
         
             
            <!--
         
     | 
| 
       1061 
1088 
     | 
    
         
             
            # vim: set tw=0:
         
     | 
| 
       1062 
1089 
     | 
    
         
             
            -->
         
     | 
| 
      
 1090 
     | 
    
         
            +
             
     | 
    
        data/Makefile
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            .PHONY: update-version codegen-format
         
     | 
| 
       2 
2 
     | 
    
         
             
            update-version:
         
     | 
| 
       3 
3 
     | 
    
         
             
            	@echo "$(VERSION)" > VERSION
         
     | 
| 
       4 
     | 
    
         
            -
            	@perl -pi -e 's|VERSION = "[ 
     | 
| 
      
 4 
     | 
    
         
            +
            	@perl -pi -e 's|VERSION = "[.\-\w\d]+"|VERSION = "$(VERSION)"|' lib/stripe/version.rb
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
            codegen-format:
         
     | 
| 
       7 
7 
     | 
    
         
             
            	bundle exec rubocop -o /dev/null --auto-correct
         
     | 
    
        data/OPENAPI_VERSION
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
             
     | 
| 
      
 1 
     | 
    
         
            +
            v170
         
     | 
    
        data/VERSION
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            6. 
     | 
| 
      
 1 
     | 
    
         
            +
            6.6.0-beta.1
         
     | 
| 
         @@ -4,8 +4,12 @@ module Stripe 
     | 
|
| 
       4 
4 
     | 
    
         
             
              module APIOperations
         
     | 
| 
       5 
5 
     | 
    
         
             
                module Create
         
     | 
| 
       6 
6 
     | 
    
         
             
                  def create(params = {}, opts = {})
         
     | 
| 
       7 
     | 
    
         
            -
                     
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
      
 7 
     | 
    
         
            +
                    request_stripe_object(
         
     | 
| 
      
 8 
     | 
    
         
            +
                      method: :post,
         
     | 
| 
      
 9 
     | 
    
         
            +
                      path: resource_url,
         
     | 
| 
      
 10 
     | 
    
         
            +
                      params: params,
         
     | 
| 
      
 11 
     | 
    
         
            +
                      opts: opts
         
     | 
| 
      
 12 
     | 
    
         
            +
                    )
         
     | 
| 
       9 
13 
     | 
    
         
             
                  end
         
     | 
| 
       10 
14 
     | 
    
         
             
                end
         
     | 
| 
       11 
15 
     | 
    
         
             
              end
         
     | 
| 
         @@ -18,17 +18,22 @@ module Stripe 
     | 
|
| 
       18 
18 
     | 
    
         
             
                    #   api_key to be overwritten. See
         
     | 
| 
       19 
19 
     | 
    
         
             
                    #   {APIOperations::Request.execute_resource_request}.
         
     | 
| 
       20 
20 
     | 
    
         
             
                    def delete(id, params = {}, opts = {})
         
     | 
| 
       21 
     | 
    
         
            -
                       
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
      
 21 
     | 
    
         
            +
                      request_stripe_object(
         
     | 
| 
      
 22 
     | 
    
         
            +
                        method: :delete,
         
     | 
| 
      
 23 
     | 
    
         
            +
                        path: "#{resource_url}/#{id}",
         
     | 
| 
      
 24 
     | 
    
         
            +
                        params: params,
         
     | 
| 
      
 25 
     | 
    
         
            +
                        opts: opts
         
     | 
| 
      
 26 
     | 
    
         
            +
                      )
         
     | 
| 
       25 
27 
     | 
    
         
             
                    end
         
     | 
| 
       26 
28 
     | 
    
         
             
                  end
         
     | 
| 
       27 
29 
     | 
    
         | 
| 
       28 
30 
     | 
    
         
             
                  def delete(params = {}, opts = {})
         
     | 
| 
       29 
     | 
    
         
            -
                     
     | 
| 
       30 
     | 
    
         
            -
             
     | 
| 
       31 
     | 
    
         
            -
             
     | 
| 
      
 31 
     | 
    
         
            +
                    request_stripe_object(
         
     | 
| 
      
 32 
     | 
    
         
            +
                      method: :delete,
         
     | 
| 
      
 33 
     | 
    
         
            +
                      path: resource_url,
         
     | 
| 
      
 34 
     | 
    
         
            +
                      params: params,
         
     | 
| 
      
 35 
     | 
    
         
            +
                      opts: opts
         
     | 
| 
      
 36 
     | 
    
         
            +
                    )
         
     | 
| 
       32 
37 
     | 
    
         
             
                  end
         
     | 
| 
       33 
38 
     | 
    
         | 
| 
       34 
39 
     | 
    
         
             
                  def self.included(base)
         
     | 
| 
         @@ -4,15 +4,12 @@ module Stripe 
     | 
|
| 
       4 
4 
     | 
    
         
             
              module APIOperations
         
     | 
| 
       5 
5 
     | 
    
         
             
                module List
         
     | 
| 
       6 
6 
     | 
    
         
             
                  def list(filters = {}, opts = {})
         
     | 
| 
       7 
     | 
    
         
            -
                     
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
                     
     | 
| 
       13 
     | 
    
         
            -
                    # predicates when accessing the next and previous pages
         
     | 
| 
       14 
     | 
    
         
            -
                    obj.filters = filters.dup
         
     | 
| 
       15 
     | 
    
         
            -
                    obj
         
     | 
| 
      
 7 
     | 
    
         
            +
                    request_stripe_object(
         
     | 
| 
      
 8 
     | 
    
         
            +
                      method: :get,
         
     | 
| 
      
 9 
     | 
    
         
            +
                      path: resource_url,
         
     | 
| 
      
 10 
     | 
    
         
            +
                      params: filters,
         
     | 
| 
      
 11 
     | 
    
         
            +
                      opts: opts
         
     | 
| 
      
 12 
     | 
    
         
            +
                    )
         
     | 
| 
       16 
13 
     | 
    
         
             
                  end
         
     | 
| 
       17 
14 
     | 
    
         
             
                end
         
     | 
| 
       18 
15 
     | 
    
         
             
              end
         
     | 
| 
         @@ -26,46 +26,74 @@ module Stripe 
     | 
|
| 
       26 
26 
     | 
    
         
             
                    end
         
     | 
| 
       27 
27 
     | 
    
         | 
| 
       28 
28 
     | 
    
         
             
                    operations.each do |operation|
         
     | 
| 
       29 
     | 
    
         
            -
                       
     | 
| 
       30 
     | 
    
         
            -
             
     | 
| 
       31 
     | 
    
         
            -
                         
     | 
| 
      
 29 
     | 
    
         
            +
                      define_operation(
         
     | 
| 
      
 30 
     | 
    
         
            +
                        resource,
         
     | 
| 
      
 31 
     | 
    
         
            +
                        operation,
         
     | 
| 
      
 32 
     | 
    
         
            +
                        resource_url_method,
         
     | 
| 
      
 33 
     | 
    
         
            +
                        resource_plural
         
     | 
| 
      
 34 
     | 
    
         
            +
                      )
         
     | 
| 
      
 35 
     | 
    
         
            +
                    end
         
     | 
| 
      
 36 
     | 
    
         
            +
                  end
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
                  private def define_operation(
         
     | 
| 
      
 39 
     | 
    
         
            +
                    resource,
         
     | 
| 
      
 40 
     | 
    
         
            +
                    operation,
         
     | 
| 
      
 41 
     | 
    
         
            +
                    resource_url_method,
         
     | 
| 
      
 42 
     | 
    
         
            +
                    resource_plural
         
     | 
| 
      
 43 
     | 
    
         
            +
                  )
         
     | 
| 
      
 44 
     | 
    
         
            +
                    case operation
         
     | 
| 
      
 45 
     | 
    
         
            +
                    when :create
         
     | 
| 
      
 46 
     | 
    
         
            +
                      define_singleton_method(:"create_#{resource}") \
         
     | 
| 
       32 
47 
     | 
    
         
             
                          do |id, params = {}, opts = {}|
         
     | 
| 
       33 
     | 
    
         
            -
             
     | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
       35 
     | 
    
         
            -
             
     | 
| 
       36 
     | 
    
         
            -
                           
     | 
| 
       37 
     | 
    
         
            -
             
     | 
| 
       38 
     | 
    
         
            -
                         
     | 
| 
      
 48 
     | 
    
         
            +
                        request_stripe_object(
         
     | 
| 
      
 49 
     | 
    
         
            +
                          method: :post,
         
     | 
| 
      
 50 
     | 
    
         
            +
                          path: send(resource_url_method, id),
         
     | 
| 
      
 51 
     | 
    
         
            +
                          params: params,
         
     | 
| 
      
 52 
     | 
    
         
            +
                          opts: opts
         
     | 
| 
      
 53 
     | 
    
         
            +
                        )
         
     | 
| 
      
 54 
     | 
    
         
            +
                      end
         
     | 
| 
      
 55 
     | 
    
         
            +
                    when :retrieve
         
     | 
| 
      
 56 
     | 
    
         
            +
                      define_singleton_method(:"retrieve_#{resource}") \
         
     | 
| 
       39 
57 
     | 
    
         
             
                          do |id, nested_id, opts = {}|
         
     | 
| 
       40 
     | 
    
         
            -
             
     | 
| 
       41 
     | 
    
         
            -
             
     | 
| 
       42 
     | 
    
         
            -
             
     | 
| 
       43 
     | 
    
         
            -
                           
     | 
| 
       44 
     | 
    
         
            -
             
     | 
| 
       45 
     | 
    
         
            -
                         
     | 
| 
      
 58 
     | 
    
         
            +
                        request_stripe_object(
         
     | 
| 
      
 59 
     | 
    
         
            +
                          method: :get,
         
     | 
| 
      
 60 
     | 
    
         
            +
                          path: send(resource_url_method, id, nested_id),
         
     | 
| 
      
 61 
     | 
    
         
            +
                          params: {},
         
     | 
| 
      
 62 
     | 
    
         
            +
                          opts: opts
         
     | 
| 
      
 63 
     | 
    
         
            +
                        )
         
     | 
| 
      
 64 
     | 
    
         
            +
                      end
         
     | 
| 
      
 65 
     | 
    
         
            +
                    when :update
         
     | 
| 
      
 66 
     | 
    
         
            +
                      define_singleton_method(:"update_#{resource}") \
         
     | 
| 
       46 
67 
     | 
    
         
             
                          do |id, nested_id, params = {}, opts = {}|
         
     | 
| 
       47 
     | 
    
         
            -
             
     | 
| 
       48 
     | 
    
         
            -
             
     | 
| 
       49 
     | 
    
         
            -
             
     | 
| 
       50 
     | 
    
         
            -
                           
     | 
| 
       51 
     | 
    
         
            -
             
     | 
| 
       52 
     | 
    
         
            -
                         
     | 
| 
      
 68 
     | 
    
         
            +
                        request_stripe_object(
         
     | 
| 
      
 69 
     | 
    
         
            +
                          method: :post,
         
     | 
| 
      
 70 
     | 
    
         
            +
                          path: send(resource_url_method, id, nested_id),
         
     | 
| 
      
 71 
     | 
    
         
            +
                          params: params,
         
     | 
| 
      
 72 
     | 
    
         
            +
                          opts: opts
         
     | 
| 
      
 73 
     | 
    
         
            +
                        )
         
     | 
| 
      
 74 
     | 
    
         
            +
                      end
         
     | 
| 
      
 75 
     | 
    
         
            +
                    when :delete
         
     | 
| 
      
 76 
     | 
    
         
            +
                      define_singleton_method(:"delete_#{resource}") \
         
     | 
| 
       53 
77 
     | 
    
         
             
                          do |id, nested_id, params = {}, opts = {}|
         
     | 
| 
       54 
     | 
    
         
            -
             
     | 
| 
       55 
     | 
    
         
            -
             
     | 
| 
       56 
     | 
    
         
            -
             
     | 
| 
       57 
     | 
    
         
            -
             
     | 
| 
       58 
     | 
    
         
            -
                           
     | 
| 
       59 
     | 
    
         
            -
             
     | 
| 
       60 
     | 
    
         
            -
             
     | 
| 
      
 78 
     | 
    
         
            +
                        request_stripe_object(
         
     | 
| 
      
 79 
     | 
    
         
            +
                          method: :delete,
         
     | 
| 
      
 80 
     | 
    
         
            +
                          path: send(resource_url_method, id, nested_id),
         
     | 
| 
      
 81 
     | 
    
         
            +
                          params: params,
         
     | 
| 
      
 82 
     | 
    
         
            +
                          opts: opts
         
     | 
| 
      
 83 
     | 
    
         
            +
                        )
         
     | 
| 
      
 84 
     | 
    
         
            +
                      end
         
     | 
| 
      
 85 
     | 
    
         
            +
                    when :list
         
     | 
| 
      
 86 
     | 
    
         
            +
                      define_singleton_method(:"list_#{resource_plural}") \
         
     | 
| 
       61 
87 
     | 
    
         
             
                          do |id, params = {}, opts = {}|
         
     | 
| 
       62 
     | 
    
         
            -
             
     | 
| 
       63 
     | 
    
         
            -
             
     | 
| 
       64 
     | 
    
         
            -
             
     | 
| 
       65 
     | 
    
         
            -
                           
     | 
| 
       66 
     | 
    
         
            -
             
     | 
| 
       67 
     | 
    
         
            -
                         
     | 
| 
      
 88 
     | 
    
         
            +
                        request_stripe_object(
         
     | 
| 
      
 89 
     | 
    
         
            +
                          method: :get,
         
     | 
| 
      
 90 
     | 
    
         
            +
                          path: send(resource_url_method, id),
         
     | 
| 
      
 91 
     | 
    
         
            +
                          params: params,
         
     | 
| 
      
 92 
     | 
    
         
            +
                          opts: opts
         
     | 
| 
      
 93 
     | 
    
         
            +
                        )
         
     | 
| 
       68 
94 
     | 
    
         
             
                      end
         
     | 
| 
      
 95 
     | 
    
         
            +
                    else
         
     | 
| 
      
 96 
     | 
    
         
            +
                      raise ArgumentError, "Unknown operation: #{operation.inspect}"
         
     | 
| 
       69 
97 
     | 
    
         
             
                    end
         
     | 
| 
       70 
98 
     | 
    
         
             
                  end
         
     | 
| 
       71 
99 
     | 
    
         
             
                end
         
     | 
| 
         @@ -24,6 +24,11 @@ module Stripe 
     | 
|
| 
       24 
24 
     | 
    
         
             
                      )
         
     | 
| 
       25 
25 
     | 
    
         
             
                    end
         
     | 
| 
       26 
26 
     | 
    
         | 
| 
      
 27 
     | 
    
         
            +
                    private def request_stripe_object(method:, path:, params:, opts: {})
         
     | 
| 
      
 28 
     | 
    
         
            +
                      resp, opts = execute_resource_request(method, path, params, opts)
         
     | 
| 
      
 29 
     | 
    
         
            +
                      Util.convert_to_stripe_object_with_params(resp.data, params, opts)
         
     | 
| 
      
 30 
     | 
    
         
            +
                    end
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
       27 
32 
     | 
    
         
             
                    private def execute_resource_request_internal(client_request_method_sym,
         
     | 
| 
       28 
33 
     | 
    
         
             
                                                                  method, url,
         
     | 
| 
       29 
34 
     | 
    
         
             
                                                                  params, opts,
         
     | 
| 
         @@ -122,6 +127,11 @@ module Stripe 
     | 
|
| 
       122 
127 
     | 
    
         
             
                    )
         
     | 
| 
       123 
128 
     | 
    
         
             
                  end
         
     | 
| 
       124 
129 
     | 
    
         | 
| 
      
 130 
     | 
    
         
            +
                  private def request_stripe_object(method:, path:, params:, opts: {})
         
     | 
| 
      
 131 
     | 
    
         
            +
                    resp, opts = execute_resource_request(method, path, params, opts)
         
     | 
| 
      
 132 
     | 
    
         
            +
                    Util.convert_to_stripe_object_with_params(resp.data, params, opts)
         
     | 
| 
      
 133 
     | 
    
         
            +
                  end
         
     | 
| 
      
 134 
     | 
    
         
            +
             
     | 
| 
       125 
135 
     | 
    
         
             
                  # See notes on `alias` above.
         
     | 
| 
       126 
136 
     | 
    
         
             
                  alias request execute_resource_request
         
     | 
| 
       127 
137 
     | 
    
         
             
                end
         
     | 
| 
         @@ -24,9 +24,12 @@ module Stripe 
     | 
|
| 
       24 
24 
     | 
    
         
             
                        end
         
     | 
| 
       25 
25 
     | 
    
         
             
                      end
         
     | 
| 
       26 
26 
     | 
    
         | 
| 
       27 
     | 
    
         
            -
                       
     | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
       29 
     | 
    
         
            -
             
     | 
| 
      
 27 
     | 
    
         
            +
                      request_stripe_object(
         
     | 
| 
      
 28 
     | 
    
         
            +
                        method: :post,
         
     | 
| 
      
 29 
     | 
    
         
            +
                        path: "#{resource_url}/#{id}",
         
     | 
| 
      
 30 
     | 
    
         
            +
                        params: params,
         
     | 
| 
      
 31 
     | 
    
         
            +
                        opts: opts
         
     | 
| 
      
 32 
     | 
    
         
            +
                      )
         
     | 
| 
       30 
33 
     | 
    
         
             
                    end
         
     | 
| 
       31 
34 
     | 
    
         
             
                  end
         
     | 
| 
       32 
35 
     | 
    
         | 
| 
         @@ -4,15 +4,12 @@ module Stripe 
     | 
|
| 
       4 
4 
     | 
    
         
             
              module APIOperations
         
     | 
| 
       5 
5 
     | 
    
         
             
                module Search
         
     | 
| 
       6 
6 
     | 
    
         
             
                  def _search(search_url, filters = {}, opts = {})
         
     | 
| 
       7 
     | 
    
         
            -
                     
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
                     
     | 
| 
       13 
     | 
    
         
            -
                    # when accessing the next page
         
     | 
| 
       14 
     | 
    
         
            -
                    obj.filters = filters.dup
         
     | 
| 
       15 
     | 
    
         
            -
                    obj
         
     | 
| 
      
 7 
     | 
    
         
            +
                    request_stripe_object(
         
     | 
| 
      
 8 
     | 
    
         
            +
                      method: :get,
         
     | 
| 
      
 9 
     | 
    
         
            +
                      path: search_url,
         
     | 
| 
      
 10 
     | 
    
         
            +
                      params: filters,
         
     | 
| 
      
 11 
     | 
    
         
            +
                      opts: opts
         
     | 
| 
      
 12 
     | 
    
         
            +
                    )
         
     | 
| 
       16 
13 
     | 
    
         
             
                  end
         
     | 
| 
       17 
14 
     | 
    
         
             
                end
         
     | 
| 
       18 
15 
     | 
    
         
             
              end
         
     | 
    
        data/lib/stripe/api_resource.rb
    CHANGED
    
    | 
         @@ -97,7 +97,7 @@ module Stripe 
     | 
|
| 
       97 
97 
     | 
    
         
             
                  if Util.object_name_matches_class?(resp.data[:object], self.class)
         
     | 
| 
       98 
98 
     | 
    
         
             
                    initialize_from(resp.data, opts)
         
     | 
| 
       99 
99 
     | 
    
         
             
                  else
         
     | 
| 
       100 
     | 
    
         
            -
                    Util. 
     | 
| 
      
 100 
     | 
    
         
            +
                    Util.convert_to_stripe_object_with_params(resp.data, params, opts)
         
     | 
| 
       101 
101 
     | 
    
         
             
                  end
         
     | 
| 
       102 
102 
     | 
    
         
             
                end
         
     | 
| 
       103 
103 
     | 
    
         | 
    
        data/lib/stripe/object_types.rb
    CHANGED
    
    | 
         @@ -76,6 +76,7 @@ module Stripe 
     | 
|
| 
       76 
76 
     | 
    
         
             
                    Product::OBJECT_NAME => Product,
         
     | 
| 
       77 
77 
     | 
    
         
             
                    PromotionCode::OBJECT_NAME => PromotionCode,
         
     | 
| 
       78 
78 
     | 
    
         
             
                    Quote::OBJECT_NAME => Quote,
         
     | 
| 
      
 79 
     | 
    
         
            +
                    QuotePhase::OBJECT_NAME => QuotePhase,
         
     | 
| 
       79 
80 
     | 
    
         
             
                    Radar::EarlyFraudWarning::OBJECT_NAME => Radar::EarlyFraudWarning,
         
     | 
| 
       80 
81 
     | 
    
         
             
                    Radar::ValueList::OBJECT_NAME => Radar::ValueList,
         
     | 
| 
       81 
82 
     | 
    
         
             
                    Radar::ValueListItem::OBJECT_NAME => Radar::ValueListItem,
         
     | 
| 
         @@ -12,18 +12,43 @@ module Stripe 
     | 
|
| 
       12 
12 
     | 
    
         | 
| 
       13 
13 
     | 
    
         
             
                OBJECT_NAME = "account"
         
     | 
| 
       14 
14 
     | 
    
         | 
| 
       15 
     | 
    
         
            -
                custom_method :reject, http_verb: :post
         
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
15 
     | 
    
         
             
                nested_resource_class_methods :capability,
         
     | 
| 
       18 
16 
     | 
    
         
             
                                              operations: %i[retrieve update list],
         
     | 
| 
       19 
17 
     | 
    
         
             
                                              resource_plural: "capabilities"
         
     | 
| 
       20 
18 
     | 
    
         
             
                nested_resource_class_methods :person,
         
     | 
| 
       21 
19 
     | 
    
         
             
                                              operations: %i[create retrieve update delete list]
         
     | 
| 
       22 
20 
     | 
    
         | 
| 
      
 21 
     | 
    
         
            +
                def persons(params = {}, opts = {})
         
     | 
| 
      
 22 
     | 
    
         
            +
                  request_stripe_object(
         
     | 
| 
      
 23 
     | 
    
         
            +
                    method: :get,
         
     | 
| 
      
 24 
     | 
    
         
            +
                    path: format("/v1/accounts/%<account>s/persons", { account: CGI.escape(self["id"]) }),
         
     | 
| 
      
 25 
     | 
    
         
            +
                    params: params,
         
     | 
| 
      
 26 
     | 
    
         
            +
                    opts: opts
         
     | 
| 
      
 27 
     | 
    
         
            +
                  )
         
     | 
| 
      
 28 
     | 
    
         
            +
                end
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
       23 
30 
     | 
    
         
             
                def reject(params = {}, opts = {})
         
     | 
| 
       24 
31 
     | 
    
         
             
                  request_stripe_object(
         
     | 
| 
       25 
32 
     | 
    
         
             
                    method: :post,
         
     | 
| 
       26 
     | 
    
         
            -
                    path:  
     | 
| 
      
 33 
     | 
    
         
            +
                    path: format("/v1/accounts/%<account>s/reject", { account: CGI.escape(self["id"]) }),
         
     | 
| 
      
 34 
     | 
    
         
            +
                    params: params,
         
     | 
| 
      
 35 
     | 
    
         
            +
                    opts: opts
         
     | 
| 
      
 36 
     | 
    
         
            +
                  )
         
     | 
| 
      
 37 
     | 
    
         
            +
                end
         
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
      
 39 
     | 
    
         
            +
                def self.persons(account, params = {}, opts = {})
         
     | 
| 
      
 40 
     | 
    
         
            +
                  request_stripe_object(
         
     | 
| 
      
 41 
     | 
    
         
            +
                    method: :get,
         
     | 
| 
      
 42 
     | 
    
         
            +
                    path: format("/v1/accounts/%<account>s/persons", { account: CGI.escape(account) }),
         
     | 
| 
      
 43 
     | 
    
         
            +
                    params: params,
         
     | 
| 
      
 44 
     | 
    
         
            +
                    opts: opts
         
     | 
| 
      
 45 
     | 
    
         
            +
                  )
         
     | 
| 
      
 46 
     | 
    
         
            +
                end
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
                def self.reject(account, params = {}, opts = {})
         
     | 
| 
      
 49 
     | 
    
         
            +
                  request_stripe_object(
         
     | 
| 
      
 50 
     | 
    
         
            +
                    method: :post,
         
     | 
| 
      
 51 
     | 
    
         
            +
                    path: format("/v1/accounts/%<account>s/reject", { account: CGI.escape(account) }),
         
     | 
| 
       27 
52 
     | 
    
         
             
                    params: params,
         
     | 
| 
       28 
53 
     | 
    
         
             
                    opts: opts
         
     | 
| 
       29 
54 
     | 
    
         
             
                  )
         
     | 
| 
         @@ -60,11 +85,6 @@ module Stripe 
     | 
|
| 
       60 
85 
     | 
    
         
             
                  super(id, opts)
         
     | 
| 
       61 
86 
     | 
    
         
             
                end
         
     | 
| 
       62 
87 
     | 
    
         | 
| 
       63 
     | 
    
         
            -
                def persons(params = {}, opts = {})
         
     | 
| 
       64 
     | 
    
         
            -
                  resp, opts = execute_resource_request(:get, resource_url + "/persons", params, opts)
         
     | 
| 
       65 
     | 
    
         
            -
                  Util.convert_to_stripe_object(resp.data, opts)
         
     | 
| 
       66 
     | 
    
         
            -
                end
         
     | 
| 
       67 
     | 
    
         
            -
             
     | 
| 
       68 
88 
     | 
    
         
             
                # We are not adding a helper for capabilities here as the Account object
         
     | 
| 
       69 
89 
     | 
    
         
             
                # already has a capabilities property which is a hash and not the sub-list
         
     | 
| 
       70 
90 
     | 
    
         
             
                # of capabilities.
         
     | 
| 
         @@ -10,23 +10,21 @@ module Stripe 
     | 
|
| 
       10 
10 
     | 
    
         
             
                  OBJECT_NAME = "apps.secret"
         
     | 
| 
       11 
11 
     | 
    
         | 
| 
       12 
12 
     | 
    
         
             
                  def self.delete_where(params = {}, opts = {})
         
     | 
| 
       13 
     | 
    
         
            -
                     
     | 
| 
       14 
     | 
    
         
            -
                      :post,
         
     | 
| 
       15 
     | 
    
         
            -
                       
     | 
| 
       16 
     | 
    
         
            -
                      params,
         
     | 
| 
       17 
     | 
    
         
            -
                      opts
         
     | 
| 
      
 13 
     | 
    
         
            +
                    request_stripe_object(
         
     | 
| 
      
 14 
     | 
    
         
            +
                      method: :post,
         
     | 
| 
      
 15 
     | 
    
         
            +
                      path: "/v1/apps/secrets/delete",
         
     | 
| 
      
 16 
     | 
    
         
            +
                      params: params,
         
     | 
| 
      
 17 
     | 
    
         
            +
                      opts: opts
         
     | 
| 
       18 
18 
     | 
    
         
             
                    )
         
     | 
| 
       19 
     | 
    
         
            -
                    Util.convert_to_stripe_object(resp.data, opts)
         
     | 
| 
       20 
19 
     | 
    
         
             
                  end
         
     | 
| 
       21 
20 
     | 
    
         | 
| 
       22 
21 
     | 
    
         
             
                  def self.find(params = {}, opts = {})
         
     | 
| 
       23 
     | 
    
         
            -
                     
     | 
| 
       24 
     | 
    
         
            -
                      :get,
         
     | 
| 
       25 
     | 
    
         
            -
                       
     | 
| 
       26 
     | 
    
         
            -
                      params,
         
     | 
| 
       27 
     | 
    
         
            -
                      opts
         
     | 
| 
      
 22 
     | 
    
         
            +
                    request_stripe_object(
         
     | 
| 
      
 23 
     | 
    
         
            +
                      method: :get,
         
     | 
| 
      
 24 
     | 
    
         
            +
                      path: "/v1/apps/secrets/find",
         
     | 
| 
      
 25 
     | 
    
         
            +
                      params: params,
         
     | 
| 
      
 26 
     | 
    
         
            +
                      opts: opts
         
     | 
| 
       28 
27 
     | 
    
         
             
                    )
         
     | 
| 
       29 
     | 
    
         
            -
                    Util.convert_to_stripe_object(resp.data, opts)
         
     | 
| 
       30 
28 
     | 
    
         
             
                  end
         
     | 
| 
       31 
29 
     | 
    
         
             
                end
         
     | 
| 
       32 
30 
     | 
    
         
             
              end
         
     | 
| 
         @@ -10,12 +10,19 @@ module Stripe 
     | 
|
| 
       10 
10 
     | 
    
         | 
| 
       11 
11 
     | 
    
         
             
                OBJECT_NAME = "charge"
         
     | 
| 
       12 
12 
     | 
    
         | 
| 
       13 
     | 
    
         
            -
                custom_method :capture, http_verb: :post
         
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
       15 
13 
     | 
    
         
             
                def capture(params = {}, opts = {})
         
     | 
| 
       16 
14 
     | 
    
         
             
                  request_stripe_object(
         
     | 
| 
       17 
15 
     | 
    
         
             
                    method: :post,
         
     | 
| 
       18 
     | 
    
         
            -
                    path:  
     | 
| 
      
 16 
     | 
    
         
            +
                    path: format("/v1/charges/%<charge>s/capture", { charge: CGI.escape(self["id"]) }),
         
     | 
| 
      
 17 
     | 
    
         
            +
                    params: params,
         
     | 
| 
      
 18 
     | 
    
         
            +
                    opts: opts
         
     | 
| 
      
 19 
     | 
    
         
            +
                  )
         
     | 
| 
      
 20 
     | 
    
         
            +
                end
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
                def self.capture(charge, params = {}, opts = {})
         
     | 
| 
      
 23 
     | 
    
         
            +
                  request_stripe_object(
         
     | 
| 
      
 24 
     | 
    
         
            +
                    method: :post,
         
     | 
| 
      
 25 
     | 
    
         
            +
                    path: format("/v1/charges/%<charge>s/capture", { charge: CGI.escape(charge) }),
         
     | 
| 
       19 
26 
     | 
    
         
             
                    params: params,
         
     | 
| 
       20 
27 
     | 
    
         
             
                    opts: opts
         
     | 
| 
       21 
28 
     | 
    
         
             
                  )
         
     | 
| 
         @@ -10,14 +10,21 @@ module Stripe 
     | 
|
| 
       10 
10 
     | 
    
         | 
| 
       11 
11 
     | 
    
         
             
                  OBJECT_NAME = "checkout.session"
         
     | 
| 
       12 
12 
     | 
    
         | 
| 
       13 
     | 
    
         
            -
                  custom_method :expire, http_verb: :post
         
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
       15 
13 
     | 
    
         
             
                  nested_resource_class_methods :line_item, operations: %i[list]
         
     | 
| 
       16 
14 
     | 
    
         | 
| 
       17 
15 
     | 
    
         
             
                  def expire(params = {}, opts = {})
         
     | 
| 
       18 
16 
     | 
    
         
             
                    request_stripe_object(
         
     | 
| 
       19 
17 
     | 
    
         
             
                      method: :post,
         
     | 
| 
       20 
     | 
    
         
            -
                      path:  
     | 
| 
      
 18 
     | 
    
         
            +
                      path: format("/v1/checkout/sessions/%<session>s/expire", { session: CGI.escape(self["id"]) }),
         
     | 
| 
      
 19 
     | 
    
         
            +
                      params: params,
         
     | 
| 
      
 20 
     | 
    
         
            +
                      opts: opts
         
     | 
| 
      
 21 
     | 
    
         
            +
                    )
         
     | 
| 
      
 22 
     | 
    
         
            +
                  end
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
                  def self.expire(session, params = {}, opts = {})
         
     | 
| 
      
 25 
     | 
    
         
            +
                    request_stripe_object(
         
     | 
| 
      
 26 
     | 
    
         
            +
                      method: :post,
         
     | 
| 
      
 27 
     | 
    
         
            +
                      path: format("/v1/checkout/sessions/%<session>s/expire", { session: CGI.escape(session) }),
         
     | 
| 
       21 
28 
     | 
    
         
             
                      params: params,
         
     | 
| 
       22 
29 
     | 
    
         
             
                      opts: opts
         
     | 
| 
       23 
30 
     | 
    
         
             
                    )
         
     | 
| 
         @@ -9,25 +9,40 @@ module Stripe 
     | 
|
| 
       9 
9 
     | 
    
         | 
| 
       10 
10 
     | 
    
         
             
                OBJECT_NAME = "credit_note"
         
     | 
| 
       11 
11 
     | 
    
         | 
| 
       12 
     | 
    
         
            -
                custom_method :void_credit_note, http_verb: :post, http_path: "void"
         
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
12 
     | 
    
         
             
                def void_credit_note(params = {}, opts = {})
         
     | 
| 
       15 
13 
     | 
    
         
             
                  request_stripe_object(
         
     | 
| 
       16 
14 
     | 
    
         
             
                    method: :post,
         
     | 
| 
       17 
     | 
    
         
            -
                    path:  
     | 
| 
      
 15 
     | 
    
         
            +
                    path: format("/v1/credit_notes/%<id>s/void", { id: CGI.escape(self["id"]) }),
         
     | 
| 
      
 16 
     | 
    
         
            +
                    params: params,
         
     | 
| 
      
 17 
     | 
    
         
            +
                    opts: opts
         
     | 
| 
      
 18 
     | 
    
         
            +
                  )
         
     | 
| 
      
 19 
     | 
    
         
            +
                end
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
                def self.list_preview_line_items(params = {}, opts = {})
         
     | 
| 
      
 22 
     | 
    
         
            +
                  request_stripe_object(
         
     | 
| 
      
 23 
     | 
    
         
            +
                    method: :get,
         
     | 
| 
      
 24 
     | 
    
         
            +
                    path: "/v1/credit_notes/preview/lines",
         
     | 
| 
       18 
25 
     | 
    
         
             
                    params: params,
         
     | 
| 
       19 
26 
     | 
    
         
             
                    opts: opts
         
     | 
| 
       20 
27 
     | 
    
         
             
                  )
         
     | 
| 
       21 
28 
     | 
    
         
             
                end
         
     | 
| 
       22 
29 
     | 
    
         | 
| 
       23 
     | 
    
         
            -
                def self.preview(params, opts = {})
         
     | 
| 
       24 
     | 
    
         
            -
                   
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
      
 30 
     | 
    
         
            +
                def self.preview(params = {}, opts = {})
         
     | 
| 
      
 31 
     | 
    
         
            +
                  request_stripe_object(
         
     | 
| 
      
 32 
     | 
    
         
            +
                    method: :get,
         
     | 
| 
      
 33 
     | 
    
         
            +
                    path: "/v1/credit_notes/preview",
         
     | 
| 
      
 34 
     | 
    
         
            +
                    params: params,
         
     | 
| 
      
 35 
     | 
    
         
            +
                    opts: opts
         
     | 
| 
      
 36 
     | 
    
         
            +
                  )
         
     | 
| 
       26 
37 
     | 
    
         
             
                end
         
     | 
| 
       27 
38 
     | 
    
         | 
| 
       28 
     | 
    
         
            -
                def self. 
     | 
| 
       29 
     | 
    
         
            -
                   
     | 
| 
       30 
     | 
    
         
            -
             
     | 
| 
      
 39 
     | 
    
         
            +
                def self.void_credit_note(id, params = {}, opts = {})
         
     | 
| 
      
 40 
     | 
    
         
            +
                  request_stripe_object(
         
     | 
| 
      
 41 
     | 
    
         
            +
                    method: :post,
         
     | 
| 
      
 42 
     | 
    
         
            +
                    path: format("/v1/credit_notes/%<id>s/void", { id: CGI.escape(id) }),
         
     | 
| 
      
 43 
     | 
    
         
            +
                    params: params,
         
     | 
| 
      
 44 
     | 
    
         
            +
                    opts: opts
         
     | 
| 
      
 45 
     | 
    
         
            +
                  )
         
     | 
| 
       31 
46 
     | 
    
         
             
                end
         
     | 
| 
       32 
47 
     | 
    
         
             
              end
         
     | 
| 
       33 
48 
     | 
    
         
             
            end
         
     |