stripe 10.8.0.pre.beta.1 → 10.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +47 -270
  3. data/Gemfile +1 -1
  4. data/OPENAPI_VERSION +1 -1
  5. data/README.md +0 -11
  6. data/VERSION +1 -1
  7. data/lib/stripe/api_operations/request.rb +1 -2
  8. data/lib/stripe/api_version.rb +0 -1
  9. data/lib/stripe/object_types.rb +0 -23
  10. data/lib/stripe/resources/account.rb +61 -1
  11. data/lib/stripe/resources/account_link.rb +5 -0
  12. data/lib/stripe/resources/account_session.rb +5 -0
  13. data/lib/stripe/resources/apple_pay_domain.rb +40 -0
  14. data/lib/stripe/resources/application_fee.rb +5 -0
  15. data/lib/stripe/resources/apps/secret.rb +10 -0
  16. data/lib/stripe/resources/balance_transaction.rb +12 -0
  17. data/lib/stripe/resources/bank_account.rb +27 -0
  18. data/lib/stripe/resources/billing_portal/configuration.rb +30 -0
  19. data/lib/stripe/resources/billing_portal/session.rb +10 -0
  20. data/lib/stripe/resources/card.rb +27 -0
  21. data/lib/stripe/resources/charge.rb +22 -0
  22. data/lib/stripe/resources/checkout/session.rb +20 -0
  23. data/lib/stripe/resources/climate/order.rb +22 -0
  24. data/lib/stripe/resources/climate/product.rb +10 -0
  25. data/lib/stripe/resources/climate/supplier.rb +10 -0
  26. data/lib/stripe/resources/country_spec.rb +5 -0
  27. data/lib/stripe/resources/coupon.rb +42 -0
  28. data/lib/stripe/resources/credit_note.rb +33 -0
  29. data/lib/stripe/resources/customer.rb +42 -11
  30. data/lib/stripe/resources/customer_session.rb +10 -0
  31. data/lib/stripe/resources/dispute.rb +17 -0
  32. data/lib/stripe/resources/ephemeral_key.rb +20 -0
  33. data/lib/stripe/resources/event.rb +5 -0
  34. data/lib/stripe/resources/exchange_rate.rb +5 -0
  35. data/lib/stripe/resources/file.rb +5 -0
  36. data/lib/stripe/resources/file_link.rb +20 -0
  37. data/lib/stripe/resources/financial_connections/account.rb +10 -3
  38. data/lib/stripe/resources/financial_connections/session.rb +10 -0
  39. data/lib/stripe/resources/financial_connections/transaction.rb +10 -0
  40. data/lib/stripe/resources/identity/verification_report.rb +10 -0
  41. data/lib/stripe/resources/identity/verification_session.rb +39 -0
  42. data/lib/stripe/resources/invoice.rb +45 -53
  43. data/lib/stripe/resources/invoice_item.rb +40 -0
  44. data/lib/stripe/resources/issuing/authorization.rb +20 -0
  45. data/lib/stripe/resources/issuing/card.rb +20 -0
  46. data/lib/stripe/resources/issuing/cardholder.rb +30 -0
  47. data/lib/stripe/resources/issuing/dispute.rb +30 -0
  48. data/lib/stripe/resources/issuing/token.rb +15 -0
  49. data/lib/stripe/resources/issuing/transaction.rb +20 -0
  50. data/lib/stripe/resources/payment_intent.rb +35 -0
  51. data/lib/stripe/resources/payment_link.rb +20 -0
  52. data/lib/stripe/resources/payment_method.rb +22 -0
  53. data/lib/stripe/resources/payment_method_configuration.rb +30 -0
  54. data/lib/stripe/resources/payment_method_domain.rb +30 -0
  55. data/lib/stripe/resources/payout.rb +24 -0
  56. data/lib/stripe/resources/plan.rb +40 -0
  57. data/lib/stripe/resources/price.rb +20 -0
  58. data/lib/stripe/resources/product.rb +40 -0
  59. data/lib/stripe/resources/promotion_code.rb +20 -0
  60. data/lib/stripe/resources/quote.rb +13 -97
  61. data/lib/stripe/resources/radar/early_fraud_warning.rb +10 -0
  62. data/lib/stripe/resources/radar/value_list.rb +50 -0
  63. data/lib/stripe/resources/radar/value_list_item.rb +40 -0
  64. data/lib/stripe/resources/refund.rb +36 -0
  65. data/lib/stripe/resources/reporting/report_run.rb +20 -0
  66. data/lib/stripe/resources/reporting/report_type.rb +10 -0
  67. data/lib/stripe/resources/review.rb +5 -0
  68. data/lib/stripe/resources/setup_attempt.rb +5 -0
  69. data/lib/stripe/resources/setup_intent.rb +23 -0
  70. data/lib/stripe/resources/shipping_rate.rb +20 -0
  71. data/lib/stripe/resources/sigma/scheduled_query_run.rb +10 -0
  72. data/lib/stripe/resources/source.rb +17 -0
  73. data/lib/stripe/resources/subscription.rb +46 -0
  74. data/lib/stripe/resources/subscription_item.rb +50 -0
  75. data/lib/stripe/resources/subscription_schedule.rb +28 -18
  76. data/lib/stripe/resources/tax/calculation.rb +10 -0
  77. data/lib/stripe/resources/tax/registration.rb +32 -0
  78. data/lib/stripe/resources/tax_code.rb +5 -0
  79. data/lib/stripe/resources/tax_id.rb +20 -0
  80. data/lib/stripe/resources/tax_rate.rb +20 -0
  81. data/lib/stripe/resources/terminal/configuration.rb +50 -0
  82. data/lib/stripe/resources/terminal/connection_token.rb +10 -0
  83. data/lib/stripe/resources/terminal/location.rb +51 -0
  84. data/lib/stripe/resources/terminal/reader.rb +42 -52
  85. data/lib/stripe/resources/test_helpers/test_clock.rb +40 -0
  86. data/lib/stripe/resources/token.rb +6 -0
  87. data/lib/stripe/resources/topup.rb +20 -0
  88. data/lib/stripe/resources/transfer.rb +22 -0
  89. data/lib/stripe/resources/treasury/credit_reversal.rb +20 -0
  90. data/lib/stripe/resources/treasury/debit_reversal.rb +20 -0
  91. data/lib/stripe/resources/treasury/financial_account.rb +30 -0
  92. data/lib/stripe/resources/treasury/inbound_transfer.rb +20 -0
  93. data/lib/stripe/resources/treasury/outbound_payment.rb +20 -0
  94. data/lib/stripe/resources/treasury/outbound_transfer.rb +20 -0
  95. data/lib/stripe/resources/treasury/received_credit.rb +10 -0
  96. data/lib/stripe/resources/treasury/received_debit.rb +10 -0
  97. data/lib/stripe/resources/treasury/transaction.rb +10 -0
  98. data/lib/stripe/resources/treasury/transaction_entry.rb +10 -0
  99. data/lib/stripe/resources/webhook_endpoint.rb +50 -0
  100. data/lib/stripe/resources.rb +0 -22
  101. data/lib/stripe/search_result_object.rb +1 -1
  102. data/lib/stripe/stripe_client.rb +28 -62
  103. data/lib/stripe/stripe_configuration.rb +1 -2
  104. data/lib/stripe/util.rb +1 -8
  105. data/lib/stripe/version.rb +1 -1
  106. data/lib/stripe.rb +0 -46
  107. metadata +4 -27
  108. data/lib/stripe/request_signing_authenticator.rb +0 -79
  109. data/lib/stripe/resources/account_notice.rb +0 -14
  110. data/lib/stripe/resources/capital/financing_offer.rb +0 -36
  111. data/lib/stripe/resources/capital/financing_summary.rb +0 -12
  112. data/lib/stripe/resources/capital/financing_transaction.rb +0 -13
  113. data/lib/stripe/resources/confirmation_token.rb +0 -13
  114. data/lib/stripe/resources/customer_entitlement.rb +0 -9
  115. data/lib/stripe/resources/customer_entitlement_summary.rb +0 -9
  116. data/lib/stripe/resources/entitlements/event.rb +0 -13
  117. data/lib/stripe/resources/entitlements/feature.rb +0 -15
  118. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +0 -11
  119. data/lib/stripe/resources/gift_cards/card.rb +0 -26
  120. data/lib/stripe/resources/gift_cards/transaction.rb +0 -60
  121. data/lib/stripe/resources/invoice_payment.rb +0 -9
  122. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +0 -75
  123. data/lib/stripe/resources/issuing/personalization_design.rb +0 -83
  124. data/lib/stripe/resources/issuing/physical_bundle.rb +0 -13
  125. data/lib/stripe/resources/margin.rb +0 -14
  126. data/lib/stripe/resources/order.rb +0 -97
  127. data/lib/stripe/resources/quote_phase.rb +0 -31
  128. data/lib/stripe/resources/quote_preview_invoice.rb +0 -40
  129. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +0 -8
  130. data/lib/stripe/resources/tax/form.rb +0 -41
@@ -16,5 +16,25 @@ module Stripe
16
16
  end
17
17
  super
18
18
  end
19
+
20
+ # Invalidates a short-lived API key for a given resource.
21
+ def self.delete(id, params = {}, opts = {})
22
+ request_stripe_object(
23
+ method: :delete,
24
+ path: format("/v1/ephemeral_keys/%<id>s", { id: CGI.escape(id) }),
25
+ params: params,
26
+ opts: opts
27
+ )
28
+ end
29
+
30
+ # Invalidates a short-lived API key for a given resource.
31
+ def delete(params = {}, opts = {})
32
+ request_stripe_object(
33
+ method: :delete,
34
+ path: format("/v1/ephemeral_keys/%<key>s", { key: CGI.escape(self["id"]) }),
35
+ params: params,
36
+ opts: opts
37
+ )
38
+ end
19
39
  end
20
40
  end
@@ -36,5 +36,10 @@ module Stripe
36
36
  extend Stripe::APIOperations::List
37
37
 
38
38
  OBJECT_NAME = "event"
39
+
40
+ # List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://stripe.com/docs/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header).
41
+ def self.list(filters = {}, opts = {})
42
+ request_stripe_object(method: :get, path: "/v1/events", params: filters, opts: opts)
43
+ end
39
44
  end
40
45
  end
@@ -32,5 +32,10 @@ module Stripe
32
32
  extend Stripe::APIOperations::List
33
33
 
34
34
  OBJECT_NAME = "exchange_rate"
35
+
36
+ # Returns a list of objects that contain the rates at which foreign currencies are converted to one another. Only shows the currencies for which Stripe supports.
37
+ def self.list(filters = {}, opts = {})
38
+ request_stripe_object(method: :get, path: "/v1/exchange_rates", params: filters, opts: opts)
39
+ end
35
40
  end
36
41
  end
@@ -37,5 +37,10 @@ module Stripe
37
37
  }.merge(Util.normalize_opts(opts))
38
38
  super
39
39
  end
40
+
41
+ # Returns a list of the files that your account has access to. Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top.
42
+ def self.list(filters = {}, opts = {})
43
+ request_stripe_object(method: :get, path: "/v1/files", params: filters, opts: opts)
44
+ end
40
45
  end
41
46
  end
@@ -11,5 +11,25 @@ module Stripe
11
11
  include Stripe::APIOperations::Save
12
12
 
13
13
  OBJECT_NAME = "file_link"
14
+
15
+ # Creates a new file link object.
16
+ def self.create(params = {}, opts = {})
17
+ request_stripe_object(method: :post, path: "/v1/file_links", params: params, opts: opts)
18
+ end
19
+
20
+ # Returns a list of file links.
21
+ def self.list(filters = {}, opts = {})
22
+ request_stripe_object(method: :get, path: "/v1/file_links", params: filters, opts: opts)
23
+ end
24
+
25
+ # Updates an existing file link object. Expired links can no longer be updated.
26
+ def self.update(id, params = {}, opts = {})
27
+ request_stripe_object(
28
+ method: :post,
29
+ path: format("/v1/file_links/%<id>s", { id: CGI.escape(id) }),
30
+ params: params,
31
+ opts: opts
32
+ )
33
+ end
14
34
  end
15
35
  end
@@ -6,12 +6,9 @@ module Stripe
6
6
  # A Financial Connections Account represents an account that exists outside of Stripe, to which you have been granted some degree of access.
7
7
  class Account < APIResource
8
8
  extend Stripe::APIOperations::List
9
- extend Stripe::APIOperations::NestedResource
10
9
 
11
10
  OBJECT_NAME = "financial_connections.account"
12
11
 
13
- nested_resource_class_methods :inferred_balance, operations: %i[list]
14
-
15
12
  # Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions).
16
13
  def disconnect(params = {}, opts = {})
17
14
  request_stripe_object(
@@ -111,6 +108,16 @@ module Stripe
111
108
  opts: opts
112
109
  )
113
110
  end
111
+
112
+ # Returns a list of Financial Connections Account objects.
113
+ def self.list(filters = {}, opts = {})
114
+ request_stripe_object(
115
+ method: :get,
116
+ path: "/v1/financial_connections/accounts",
117
+ params: filters,
118
+ opts: opts
119
+ )
120
+ end
114
121
  end
115
122
  end
116
123
  end
@@ -8,6 +8,16 @@ module Stripe
8
8
  extend Stripe::APIOperations::Create
9
9
 
10
10
  OBJECT_NAME = "financial_connections.session"
11
+
12
+ # To launch the Financial Connections authorization flow, create a Session. The session's client_secret can be used to launch the flow using Stripe.js.
13
+ def self.create(params = {}, opts = {})
14
+ request_stripe_object(
15
+ method: :post,
16
+ path: "/v1/financial_connections/sessions",
17
+ params: params,
18
+ opts: opts
19
+ )
20
+ end
11
21
  end
12
22
  end
13
23
  end
@@ -8,6 +8,16 @@ module Stripe
8
8
  extend Stripe::APIOperations::List
9
9
 
10
10
  OBJECT_NAME = "financial_connections.transaction"
11
+
12
+ # Returns a list of Financial Connections Transaction objects.
13
+ def self.list(filters = {}, opts = {})
14
+ request_stripe_object(
15
+ method: :get,
16
+ path: "/v1/financial_connections/transactions",
17
+ params: filters,
18
+ opts: opts
19
+ )
20
+ end
11
21
  end
12
22
  end
13
23
  end
@@ -18,6 +18,16 @@ module Stripe
18
18
  extend Stripe::APIOperations::List
19
19
 
20
20
  OBJECT_NAME = "identity.verification_report"
21
+
22
+ # List all verification reports.
23
+ def self.list(filters = {}, opts = {})
24
+ request_stripe_object(
25
+ method: :get,
26
+ path: "/v1/identity/verification_reports",
27
+ params: filters,
28
+ opts: opts
29
+ )
30
+ end
21
31
  end
22
32
  end
23
33
  end
@@ -100,6 +100,45 @@ module Stripe
100
100
  opts: opts
101
101
  )
102
102
  end
103
+
104
+ # Creates a VerificationSession object.
105
+ #
106
+ # After the VerificationSession is created, display a verification modal using the session client_secret or send your users to the session's url.
107
+ #
108
+ # If your API key is in test mode, verification checks won't actually process, though everything else will occur as if in live mode.
109
+ #
110
+ # Related guide: [Verify your users' identity documents](https://stripe.com/docs/identity/verify-identity-documents)
111
+ def self.create(params = {}, opts = {})
112
+ request_stripe_object(
113
+ method: :post,
114
+ path: "/v1/identity/verification_sessions",
115
+ params: params,
116
+ opts: opts
117
+ )
118
+ end
119
+
120
+ # Returns a list of VerificationSessions
121
+ def self.list(filters = {}, opts = {})
122
+ request_stripe_object(
123
+ method: :get,
124
+ path: "/v1/identity/verification_sessions",
125
+ params: filters,
126
+ opts: opts
127
+ )
128
+ end
129
+
130
+ # Updates a VerificationSession object.
131
+ #
132
+ # When the session status is requires_input, you can use this method to update the
133
+ # verification check and options.
134
+ def self.update(id, params = {}, opts = {})
135
+ request_stripe_object(
136
+ method: :post,
137
+ path: format("/v1/identity/verification_sessions/%<id>s", { id: CGI.escape(id) }),
138
+ params: params,
139
+ opts: opts
140
+ )
141
+ end
103
142
  end
104
143
  end
105
144
  end
@@ -40,30 +40,9 @@ module Stripe
40
40
  extend Stripe::APIOperations::List
41
41
  extend Stripe::APIOperations::Search
42
42
  include Stripe::APIOperations::Save
43
- extend Stripe::APIOperations::NestedResource
44
43
 
45
44
  OBJECT_NAME = "invoice"
46
45
 
47
- nested_resource_class_methods :payment, operations: %i[retrieve list]
48
-
49
- # Attaches a PaymentIntent to the invoice, adding it to the list of payments.
50
- # When the PaymentIntent's status changes to succeeded, the payment is credited
51
- # to the invoice, increasing its amount_paid. When the invoice is fully paid, the
52
- # invoice's status becomes paid.
53
- #
54
- # If the PaymentIntent's status is already succeeded when it is attached, it is
55
- # credited to the invoice immediately.
56
- #
57
- # Related guide: [Create an invoice payment](https://stripe.com/docs/invoicing/payments/create)
58
- def attach_payment_intent(params = {}, opts = {})
59
- request_stripe_object(
60
- method: :post,
61
- path: format("/v1/invoices/%<invoice>s/attach_payment_intent", { invoice: CGI.escape(self["id"]) }),
62
- params: params,
63
- opts: opts
64
- )
65
- end
66
-
67
46
  # Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method.
68
47
  def finalize_invoice(params = {}, opts = {})
69
48
  request_stripe_object(
@@ -116,38 +95,6 @@ module Stripe
116
95
  )
117
96
  end
118
97
 
119
- # Attaches a PaymentIntent to the invoice, adding it to the list of payments.
120
- # When the PaymentIntent's status changes to succeeded, the payment is credited
121
- # to the invoice, increasing its amount_paid. When the invoice is fully paid, the
122
- # invoice's status becomes paid.
123
- #
124
- # If the PaymentIntent's status is already succeeded when it is attached, it is
125
- # credited to the invoice immediately.
126
- #
127
- # Related guide: [Create an invoice payment](https://stripe.com/docs/invoicing/payments/create)
128
- def self.attach_payment_intent(invoice, params = {}, opts = {})
129
- request_stripe_object(
130
- method: :post,
131
- path: format("/v1/invoices/%<invoice>s/attach_payment_intent", { invoice: CGI.escape(invoice) }),
132
- params: params,
133
- opts: opts
134
- )
135
- end
136
-
137
- # 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.
138
- #
139
- # 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.
140
- #
141
- # 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 a proration_date parameter when doing the actual subscription update. The value passed in should be the same as the subscription_proration_date returned on the upcoming invoice resource. 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_proration_date on the upcoming invoice resource.
142
- def self.create_preview(params = {}, opts = {})
143
- request_stripe_object(
144
- method: :post,
145
- path: "/v1/invoices/create_preview",
146
- params: params,
147
- opts: opts
148
- )
149
- end
150
-
151
98
  # Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method.
152
99
  def self.finalize_invoice(invoice, params = {}, opts = {})
153
100
  request_stripe_object(
@@ -219,6 +166,36 @@ module Stripe
219
166
  )
220
167
  end
221
168
 
169
+ # 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.
170
+ def self.create(params = {}, opts = {})
171
+ request_stripe_object(method: :post, path: "/v1/invoices", params: params, opts: opts)
172
+ end
173
+
174
+ # 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).
175
+ def self.delete(id, params = {}, opts = {})
176
+ request_stripe_object(
177
+ method: :delete,
178
+ path: format("/v1/invoices/%<id>s", { id: CGI.escape(id) }),
179
+ params: params,
180
+ opts: opts
181
+ )
182
+ end
183
+
184
+ # 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).
185
+ def delete(params = {}, opts = {})
186
+ request_stripe_object(
187
+ method: :delete,
188
+ path: format("/v1/invoices/%<invoice>s", { invoice: CGI.escape(self["id"]) }),
189
+ params: params,
190
+ opts: opts
191
+ )
192
+ end
193
+
194
+ # You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first.
195
+ def self.list(filters = {}, opts = {})
196
+ request_stripe_object(method: :get, path: "/v1/invoices", params: filters, opts: opts)
197
+ end
198
+
222
199
  def self.search(params = {}, opts = {})
223
200
  request_stripe_object(method: :get, path: "/v1/invoices/search", params: params, opts: opts)
224
201
  end
@@ -226,5 +203,20 @@ module Stripe
226
203
  def self.search_auto_paging_each(params = {}, opts = {}, &blk)
227
204
  search(params, opts).auto_paging_each(&blk)
228
205
  end
206
+
207
+ # Draft invoices are fully editable. Once an invoice is [finalized](https://stripe.com/docs/billing/invoices/workflow#finalized),
208
+ # monetary values, as well as collection_method, become uneditable.
209
+ #
210
+ # If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on,
211
+ # sending reminders for, or [automatically reconciling](https://stripe.com/docs/billing/invoices/reconciliation) invoices, pass
212
+ # auto_advance=false.
213
+ def self.update(id, params = {}, opts = {})
214
+ request_stripe_object(
215
+ method: :post,
216
+ path: format("/v1/invoices/%<id>s", { id: CGI.escape(id) }),
217
+ params: params,
218
+ opts: opts
219
+ )
220
+ end
229
221
  end
230
222
  end
@@ -20,5 +20,45 @@ module Stripe
20
20
  include Stripe::APIOperations::Save
21
21
 
22
22
  OBJECT_NAME = "invoiceitem"
23
+
24
+ # Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is specified, the item will be on the next invoice created for the customer specified.
25
+ def self.create(params = {}, opts = {})
26
+ request_stripe_object(method: :post, path: "/v1/invoiceitems", params: params, opts: opts)
27
+ end
28
+
29
+ # Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice.
30
+ def self.delete(id, params = {}, opts = {})
31
+ request_stripe_object(
32
+ method: :delete,
33
+ path: format("/v1/invoiceitems/%<id>s", { id: CGI.escape(id) }),
34
+ params: params,
35
+ opts: opts
36
+ )
37
+ end
38
+
39
+ # Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice.
40
+ def delete(params = {}, opts = {})
41
+ request_stripe_object(
42
+ method: :delete,
43
+ path: format("/v1/invoiceitems/%<invoiceitem>s", { invoiceitem: CGI.escape(self["id"]) }),
44
+ params: params,
45
+ opts: opts
46
+ )
47
+ end
48
+
49
+ # Returns a list of your invoice items. Invoice items are returned sorted by creation date, with the most recently created invoice items appearing first.
50
+ def self.list(filters = {}, opts = {})
51
+ request_stripe_object(method: :get, path: "/v1/invoiceitems", params: filters, opts: opts)
52
+ end
53
+
54
+ # Updates the amount or description of an invoice item on an upcoming invoice. Updating an invoice item is only possible before the invoice it's attached to is closed.
55
+ def self.update(id, params = {}, opts = {})
56
+ request_stripe_object(
57
+ method: :post,
58
+ path: format("/v1/invoiceitems/%<id>s", { id: CGI.escape(id) }),
59
+ params: params,
60
+ opts: opts
61
+ )
62
+ end
23
63
  end
24
64
  end
@@ -58,6 +58,26 @@ module Stripe
58
58
  )
59
59
  end
60
60
 
61
+ # Returns a list of Issuing Authorization objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
62
+ def self.list(filters = {}, opts = {})
63
+ request_stripe_object(
64
+ method: :get,
65
+ path: "/v1/issuing/authorizations",
66
+ params: filters,
67
+ opts: opts
68
+ )
69
+ end
70
+
71
+ # Updates the specified Issuing Authorization object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
72
+ def self.update(id, params = {}, opts = {})
73
+ request_stripe_object(
74
+ method: :post,
75
+ path: format("/v1/issuing/authorizations/%<id>s", { id: CGI.escape(id) }),
76
+ params: params,
77
+ opts: opts
78
+ )
79
+ end
80
+
61
81
  def test_helpers
62
82
  TestHelpers.new(self)
63
83
  end
@@ -11,6 +11,26 @@ module Stripe
11
11
 
12
12
  OBJECT_NAME = "issuing.card"
13
13
 
14
+ # Creates an Issuing Card object.
15
+ def self.create(params = {}, opts = {})
16
+ request_stripe_object(method: :post, path: "/v1/issuing/cards", params: params, opts: opts)
17
+ end
18
+
19
+ # Returns a list of Issuing Card objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
20
+ def self.list(filters = {}, opts = {})
21
+ request_stripe_object(method: :get, path: "/v1/issuing/cards", params: filters, opts: opts)
22
+ end
23
+
24
+ # Updates the specified Issuing Card object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
25
+ def self.update(id, params = {}, opts = {})
26
+ request_stripe_object(
27
+ method: :post,
28
+ path: format("/v1/issuing/cards/%<id>s", { id: CGI.escape(id) }),
29
+ params: params,
30
+ opts: opts
31
+ )
32
+ end
33
+
14
34
  def test_helpers
15
35
  TestHelpers.new(self)
16
36
  end
@@ -12,6 +12,36 @@ module Stripe
12
12
  include Stripe::APIOperations::Save
13
13
 
14
14
  OBJECT_NAME = "issuing.cardholder"
15
+
16
+ # Creates a new Issuing Cardholder object that can be issued cards.
17
+ def self.create(params = {}, opts = {})
18
+ request_stripe_object(
19
+ method: :post,
20
+ path: "/v1/issuing/cardholders",
21
+ params: params,
22
+ opts: opts
23
+ )
24
+ end
25
+
26
+ # Returns a list of Issuing Cardholder objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
27
+ def self.list(filters = {}, opts = {})
28
+ request_stripe_object(
29
+ method: :get,
30
+ path: "/v1/issuing/cardholders",
31
+ params: filters,
32
+ opts: opts
33
+ )
34
+ end
35
+
36
+ # Updates the specified Issuing Cardholder object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
37
+ def self.update(id, params = {}, opts = {})
38
+ request_stripe_object(
39
+ method: :post,
40
+ path: format("/v1/issuing/cardholders/%<id>s", { id: CGI.escape(id) }),
41
+ params: params,
42
+ opts: opts
43
+ )
44
+ end
15
45
  end
16
46
  end
17
47
  end
@@ -32,6 +32,36 @@ module Stripe
32
32
  opts: opts
33
33
  )
34
34
  end
35
+
36
+ # Creates an Issuing Dispute object. Individual pieces of evidence within the evidence object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements.
37
+ def self.create(params = {}, opts = {})
38
+ request_stripe_object(
39
+ method: :post,
40
+ path: "/v1/issuing/disputes",
41
+ params: params,
42
+ opts: opts
43
+ )
44
+ end
45
+
46
+ # Returns a list of Issuing Dispute objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
47
+ def self.list(filters = {}, opts = {})
48
+ request_stripe_object(
49
+ method: :get,
50
+ path: "/v1/issuing/disputes",
51
+ params: filters,
52
+ opts: opts
53
+ )
54
+ end
55
+
56
+ # Updates the specified Issuing Dispute object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Properties on the evidence object can be unset by passing in an empty string.
57
+ def self.update(id, params = {}, opts = {})
58
+ request_stripe_object(
59
+ method: :post,
60
+ path: format("/v1/issuing/disputes/%<id>s", { id: CGI.escape(id) }),
61
+ params: params,
62
+ opts: opts
63
+ )
64
+ end
35
65
  end
36
66
  end
37
67
  end
@@ -9,6 +9,21 @@ module Stripe
9
9
  include Stripe::APIOperations::Save
10
10
 
11
11
  OBJECT_NAME = "issuing.token"
12
+
13
+ # Lists all Issuing Token objects for a given card.
14
+ def self.list(filters = {}, opts = {})
15
+ request_stripe_object(method: :get, path: "/v1/issuing/tokens", params: filters, opts: opts)
16
+ end
17
+
18
+ # Attempts to update the specified Issuing Token object to the status specified.
19
+ def self.update(id, params = {}, opts = {})
20
+ request_stripe_object(
21
+ method: :post,
22
+ path: format("/v1/issuing/tokens/%<id>s", { id: CGI.escape(id) }),
23
+ params: params,
24
+ opts: opts
25
+ )
26
+ end
12
27
  end
13
28
  end
14
29
  end
@@ -14,6 +14,26 @@ module Stripe
14
14
 
15
15
  OBJECT_NAME = "issuing.transaction"
16
16
 
17
+ # Returns a list of Issuing Transaction objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
18
+ def self.list(filters = {}, opts = {})
19
+ request_stripe_object(
20
+ method: :get,
21
+ path: "/v1/issuing/transactions",
22
+ params: filters,
23
+ opts: opts
24
+ )
25
+ end
26
+
27
+ # Updates the specified Issuing Transaction object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
28
+ def self.update(id, params = {}, opts = {})
29
+ request_stripe_object(
30
+ method: :post,
31
+ path: format("/v1/issuing/transactions/%<id>s", { id: CGI.escape(id) }),
32
+ params: params,
33
+ opts: opts
34
+ )
35
+ end
36
+
17
37
  def test_helpers
18
38
  TestHelpers.new(self)
19
39
  end
@@ -247,6 +247,25 @@ module Stripe
247
247
  )
248
248
  end
249
249
 
250
+ # Creates a PaymentIntent object.
251
+ #
252
+ # After the PaymentIntent is created, attach a payment method and [confirm](https://stripe.com/docs/api/payment_intents/confirm)
253
+ # to continue the payment. Learn more about <a href="/docs/payments/payment-intents">the available payment flows
254
+ # with the Payment Intents API.
255
+ #
256
+ # When you use confirm=true during creation, it's equivalent to creating
257
+ # and confirming the PaymentIntent in the same call. You can use any parameters
258
+ # available in the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) when you supply
259
+ # confirm=true.
260
+ def self.create(params = {}, opts = {})
261
+ request_stripe_object(method: :post, path: "/v1/payment_intents", params: params, opts: opts)
262
+ end
263
+
264
+ # Returns a list of PaymentIntents.
265
+ def self.list(filters = {}, opts = {})
266
+ request_stripe_object(method: :get, path: "/v1/payment_intents", params: filters, opts: opts)
267
+ end
268
+
250
269
  def self.search(params = {}, opts = {})
251
270
  request_stripe_object(
252
271
  method: :get,
@@ -259,5 +278,21 @@ module Stripe
259
278
  def self.search_auto_paging_each(params = {}, opts = {}, &blk)
260
279
  search(params, opts).auto_paging_each(&blk)
261
280
  end
281
+
282
+ # Updates properties on a PaymentIntent object without confirming.
283
+ #
284
+ # Depending on which properties you update, you might need to confirm the
285
+ # PaymentIntent again. For example, updating the payment_method
286
+ # always requires you to confirm the PaymentIntent again. If you prefer to
287
+ # update and confirm at the same time, we recommend updating properties through
288
+ # the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) instead.
289
+ def self.update(id, params = {}, opts = {})
290
+ request_stripe_object(
291
+ method: :post,
292
+ path: format("/v1/payment_intents/%<id>s", { id: CGI.escape(id) }),
293
+ params: params,
294
+ opts: opts
295
+ )
296
+ end
262
297
  end
263
298
  end
@@ -33,5 +33,25 @@ module Stripe
33
33
  opts: opts
34
34
  )
35
35
  end
36
+
37
+ # Creates a payment link.
38
+ def self.create(params = {}, opts = {})
39
+ request_stripe_object(method: :post, path: "/v1/payment_links", params: params, opts: opts)
40
+ end
41
+
42
+ # Returns a list of your payment links.
43
+ def self.list(filters = {}, opts = {})
44
+ request_stripe_object(method: :get, path: "/v1/payment_links", params: filters, opts: opts)
45
+ end
46
+
47
+ # Updates a payment link.
48
+ def self.update(id, params = {}, opts = {})
49
+ request_stripe_object(
50
+ method: :post,
51
+ path: format("/v1/payment_links/%<id>s", { id: CGI.escape(id) }),
52
+ params: params,
53
+ opts: opts
54
+ )
55
+ end
36
56
  end
37
57
  end