stripe 10.8.0.pre.beta.1 → 10.9.0.pre.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/Gemfile +1 -1
  4. data/OPENAPI_VERSION +1 -1
  5. data/VERSION +1 -1
  6. data/lib/stripe/resources/account.rb +61 -1
  7. data/lib/stripe/resources/account_link.rb +5 -0
  8. data/lib/stripe/resources/account_notice.rb +15 -0
  9. data/lib/stripe/resources/account_session.rb +5 -0
  10. data/lib/stripe/resources/apple_pay_domain.rb +40 -0
  11. data/lib/stripe/resources/application_fee.rb +5 -0
  12. data/lib/stripe/resources/apps/secret.rb +10 -0
  13. data/lib/stripe/resources/balance_transaction.rb +12 -0
  14. data/lib/stripe/resources/bank_account.rb +27 -0
  15. data/lib/stripe/resources/billing_portal/configuration.rb +30 -0
  16. data/lib/stripe/resources/billing_portal/session.rb +10 -0
  17. data/lib/stripe/resources/capital/financing_offer.rb +10 -0
  18. data/lib/stripe/resources/capital/financing_transaction.rb +11 -0
  19. data/lib/stripe/resources/card.rb +27 -0
  20. data/lib/stripe/resources/charge.rb +22 -0
  21. data/lib/stripe/resources/checkout/session.rb +20 -0
  22. data/lib/stripe/resources/climate/order.rb +22 -0
  23. data/lib/stripe/resources/climate/product.rb +10 -0
  24. data/lib/stripe/resources/climate/supplier.rb +10 -0
  25. data/lib/stripe/resources/country_spec.rb +5 -0
  26. data/lib/stripe/resources/coupon.rb +42 -0
  27. data/lib/stripe/resources/credit_note.rb +33 -0
  28. data/lib/stripe/resources/customer.rb +42 -0
  29. data/lib/stripe/resources/customer_session.rb +10 -0
  30. data/lib/stripe/resources/dispute.rb +17 -0
  31. data/lib/stripe/resources/entitlements/event.rb +10 -0
  32. data/lib/stripe/resources/entitlements/feature.rb +20 -0
  33. data/lib/stripe/resources/ephemeral_key.rb +20 -0
  34. data/lib/stripe/resources/event.rb +5 -0
  35. data/lib/stripe/resources/exchange_rate.rb +5 -0
  36. data/lib/stripe/resources/file.rb +5 -0
  37. data/lib/stripe/resources/file_link.rb +20 -0
  38. data/lib/stripe/resources/financial_connections/account.rb +10 -0
  39. data/lib/stripe/resources/financial_connections/session.rb +10 -0
  40. data/lib/stripe/resources/financial_connections/transaction.rb +10 -0
  41. data/lib/stripe/resources/gift_cards/card.rb +30 -0
  42. data/lib/stripe/resources/gift_cards/transaction.rb +30 -0
  43. data/lib/stripe/resources/identity/verification_report.rb +10 -0
  44. data/lib/stripe/resources/identity/verification_session.rb +39 -0
  45. data/lib/stripe/resources/invoice.rb +45 -0
  46. data/lib/stripe/resources/invoice_item.rb +40 -0
  47. data/lib/stripe/resources/issuing/authorization.rb +20 -0
  48. data/lib/stripe/resources/issuing/card.rb +20 -0
  49. data/lib/stripe/resources/issuing/cardholder.rb +30 -0
  50. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +10 -0
  51. data/lib/stripe/resources/issuing/dispute.rb +30 -0
  52. data/lib/stripe/resources/issuing/personalization_design.rb +30 -0
  53. data/lib/stripe/resources/issuing/physical_bundle.rb +10 -0
  54. data/lib/stripe/resources/issuing/token.rb +15 -0
  55. data/lib/stripe/resources/issuing/transaction.rb +20 -0
  56. data/lib/stripe/resources/margin.rb +20 -0
  57. data/lib/stripe/resources/order.rb +20 -0
  58. data/lib/stripe/resources/payment_intent.rb +35 -0
  59. data/lib/stripe/resources/payment_link.rb +20 -0
  60. data/lib/stripe/resources/payment_method.rb +22 -0
  61. data/lib/stripe/resources/payment_method_configuration.rb +30 -0
  62. data/lib/stripe/resources/payment_method_domain.rb +30 -0
  63. data/lib/stripe/resources/payout.rb +24 -0
  64. data/lib/stripe/resources/plan.rb +40 -0
  65. data/lib/stripe/resources/price.rb +20 -0
  66. data/lib/stripe/resources/product.rb +40 -0
  67. data/lib/stripe/resources/promotion_code.rb +20 -0
  68. data/lib/stripe/resources/quote.rb +20 -0
  69. data/lib/stripe/resources/quote_phase.rb +5 -0
  70. data/lib/stripe/resources/radar/early_fraud_warning.rb +10 -0
  71. data/lib/stripe/resources/radar/value_list.rb +50 -0
  72. data/lib/stripe/resources/radar/value_list_item.rb +40 -0
  73. data/lib/stripe/resources/refund.rb +36 -0
  74. data/lib/stripe/resources/reporting/report_run.rb +20 -0
  75. data/lib/stripe/resources/reporting/report_type.rb +10 -0
  76. data/lib/stripe/resources/review.rb +5 -0
  77. data/lib/stripe/resources/setup_attempt.rb +5 -0
  78. data/lib/stripe/resources/setup_intent.rb +23 -0
  79. data/lib/stripe/resources/shipping_rate.rb +20 -0
  80. data/lib/stripe/resources/sigma/scheduled_query_run.rb +10 -0
  81. data/lib/stripe/resources/source.rb +17 -0
  82. data/lib/stripe/resources/subscription.rb +46 -0
  83. data/lib/stripe/resources/subscription_item.rb +50 -0
  84. data/lib/stripe/resources/subscription_schedule.rb +30 -0
  85. data/lib/stripe/resources/tax/calculation.rb +10 -0
  86. data/lib/stripe/resources/tax/form.rb +5 -0
  87. data/lib/stripe/resources/tax/registration.rb +32 -0
  88. data/lib/stripe/resources/tax_code.rb +5 -0
  89. data/lib/stripe/resources/tax_id.rb +20 -0
  90. data/lib/stripe/resources/tax_rate.rb +20 -0
  91. data/lib/stripe/resources/terminal/configuration.rb +50 -0
  92. data/lib/stripe/resources/terminal/connection_token.rb +10 -0
  93. data/lib/stripe/resources/terminal/location.rb +51 -0
  94. data/lib/stripe/resources/terminal/reader.rb +50 -0
  95. data/lib/stripe/resources/test_helpers/test_clock.rb +40 -0
  96. data/lib/stripe/resources/token.rb +6 -0
  97. data/lib/stripe/resources/topup.rb +20 -0
  98. data/lib/stripe/resources/transfer.rb +22 -0
  99. data/lib/stripe/resources/treasury/credit_reversal.rb +20 -0
  100. data/lib/stripe/resources/treasury/debit_reversal.rb +20 -0
  101. data/lib/stripe/resources/treasury/financial_account.rb +30 -0
  102. data/lib/stripe/resources/treasury/inbound_transfer.rb +20 -0
  103. data/lib/stripe/resources/treasury/outbound_payment.rb +20 -0
  104. data/lib/stripe/resources/treasury/outbound_transfer.rb +20 -0
  105. data/lib/stripe/resources/treasury/received_credit.rb +10 -0
  106. data/lib/stripe/resources/treasury/received_debit.rb +10 -0
  107. data/lib/stripe/resources/treasury/transaction.rb +10 -0
  108. data/lib/stripe/resources/treasury/transaction_entry.rb +10 -0
  109. data/lib/stripe/resources/webhook_endpoint.rb +50 -0
  110. data/lib/stripe/search_result_object.rb +1 -1
  111. data/lib/stripe/version.rb +1 -1
  112. metadata +2 -2
@@ -114,6 +114,36 @@ module Stripe
114
114
  alias detach_source delete_source
115
115
  end
116
116
 
117
+ # Creates a new customer object.
118
+ def self.create(params = {}, opts = {})
119
+ request_stripe_object(method: :post, path: "/v1/customers", params: params, opts: opts)
120
+ end
121
+
122
+ # Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer.
123
+ def self.delete(id, params = {}, opts = {})
124
+ request_stripe_object(
125
+ method: :delete,
126
+ path: format("/v1/customers/%<id>s", { id: CGI.escape(id) }),
127
+ params: params,
128
+ opts: opts
129
+ )
130
+ end
131
+
132
+ # Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer.
133
+ def delete(params = {}, opts = {})
134
+ request_stripe_object(
135
+ method: :delete,
136
+ path: format("/v1/customers/%<customer>s", { customer: CGI.escape(self["id"]) }),
137
+ params: params,
138
+ opts: opts
139
+ )
140
+ end
141
+
142
+ # Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first.
143
+ def self.list(filters = {}, opts = {})
144
+ request_stripe_object(method: :get, path: "/v1/customers", params: filters, opts: opts)
145
+ end
146
+
117
147
  def self.search(params = {}, opts = {})
118
148
  request_stripe_object(method: :get, path: "/v1/customers/search", params: params, opts: opts)
119
149
  end
@@ -122,6 +152,18 @@ module Stripe
122
152
  search(params, opts).auto_paging_each(&blk)
123
153
  end
124
154
 
155
+ # Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer's active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer's current subscriptions, if the subscription bills automatically and is in the past_due state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior.
156
+ #
157
+ # This request accepts mostly the same arguments as the customer creation call.
158
+ def self.update(id, params = {}, opts = {})
159
+ request_stripe_object(
160
+ method: :post,
161
+ path: format("/v1/customers/%<id>s", { id: CGI.escape(id) }),
162
+ params: params,
163
+ opts: opts
164
+ )
165
+ end
166
+
125
167
  # Retrieves a customer's cash balance.
126
168
  def self.retrieve_cash_balance(customer, params = {}, opts = {})
127
169
  request_stripe_object(
@@ -8,5 +8,15 @@ module Stripe
8
8
  extend Stripe::APIOperations::Create
9
9
 
10
10
  OBJECT_NAME = "customer_session"
11
+
12
+ # Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.
13
+ def self.create(params = {}, opts = {})
14
+ request_stripe_object(
15
+ method: :post,
16
+ path: "/v1/customer_sessions",
17
+ params: params,
18
+ opts: opts
19
+ )
20
+ end
11
21
  end
12
22
  end
@@ -36,5 +36,22 @@ module Stripe
36
36
  opts: opts
37
37
  )
38
38
  end
39
+
40
+ # Returns a list of your disputes.
41
+ def self.list(filters = {}, opts = {})
42
+ request_stripe_object(method: :get, path: "/v1/disputes", params: filters, opts: opts)
43
+ end
44
+
45
+ # When you get a dispute, contacting your customer is always the best first step. If that doesn't work, you can submit evidence to help us resolve the dispute in your favor. You can do this in your [dashboard](https://dashboard.stripe.com/disputes), but if you prefer, you can use the API to submit evidence programmatically.
46
+ #
47
+ # Depending on your dispute type, different evidence fields will give you a better chance of winning your dispute. To figure out which evidence fields to provide, see our [guide to dispute types](https://stripe.com/docs/disputes/categories).
48
+ def self.update(id, params = {}, opts = {})
49
+ request_stripe_object(
50
+ method: :post,
51
+ path: format("/v1/disputes/%<id>s", { id: CGI.escape(id) }),
52
+ params: params,
53
+ opts: opts
54
+ )
55
+ end
39
56
  end
40
57
  end
@@ -8,6 +8,16 @@ module Stripe
8
8
  extend Stripe::APIOperations::Create
9
9
 
10
10
  OBJECT_NAME = "entitlements.event"
11
+
12
+ # Create an entitlement event manually, outside of the entitlement events automatically created by Stripe lifecycle events.
13
+ def self.create(params = {}, opts = {})
14
+ request_stripe_object(
15
+ method: :post,
16
+ path: "/v1/entitlements/events",
17
+ params: params,
18
+ opts: opts
19
+ )
20
+ end
11
21
  end
12
22
  end
13
23
  end
@@ -10,6 +10,26 @@ module Stripe
10
10
  extend Stripe::APIOperations::List
11
11
 
12
12
  OBJECT_NAME = "entitlements.feature"
13
+
14
+ # Creates a feature
15
+ def self.create(params = {}, opts = {})
16
+ request_stripe_object(
17
+ method: :post,
18
+ path: "/v1/entitlements/features",
19
+ params: params,
20
+ opts: opts
21
+ )
22
+ end
23
+
24
+ # Retrieve a list of features
25
+ def self.list(filters = {}, opts = {})
26
+ request_stripe_object(
27
+ method: :get,
28
+ path: "/v1/entitlements/features",
29
+ params: filters,
30
+ opts: opts
31
+ )
32
+ end
13
33
  end
14
34
  end
15
35
  end
@@ -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
@@ -111,6 +111,16 @@ module Stripe
111
111
  opts: opts
112
112
  )
113
113
  end
114
+
115
+ # Returns a list of Financial Connections Account objects.
116
+ def self.list(filters = {}, opts = {})
117
+ request_stripe_object(
118
+ method: :get,
119
+ path: "/v1/financial_connections/accounts",
120
+ params: filters,
121
+ opts: opts
122
+ )
123
+ end
114
124
  end
115
125
  end
116
126
  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
@@ -21,6 +21,36 @@ module Stripe
21
21
  opts: opts
22
22
  )
23
23
  end
24
+
25
+ # Creates a new gift card object.
26
+ def self.create(params = {}, opts = {})
27
+ request_stripe_object(
28
+ method: :post,
29
+ path: "/v1/gift_cards/cards",
30
+ params: params,
31
+ opts: opts
32
+ )
33
+ end
34
+
35
+ # List gift cards for an account
36
+ def self.list(filters = {}, opts = {})
37
+ request_stripe_object(
38
+ method: :get,
39
+ path: "/v1/gift_cards/cards",
40
+ params: filters,
41
+ opts: opts
42
+ )
43
+ end
44
+
45
+ # Update a gift card
46
+ def self.update(id, params = {}, opts = {})
47
+ request_stripe_object(
48
+ method: :post,
49
+ path: format("/v1/gift_cards/cards/%<id>s", { id: CGI.escape(id) }),
50
+ params: params,
51
+ opts: opts
52
+ )
53
+ end
24
54
  end
25
55
  end
26
56
  end
@@ -55,6 +55,36 @@ module Stripe
55
55
  opts: opts
56
56
  )
57
57
  end
58
+
59
+ # Create a gift card transaction
60
+ def self.create(params = {}, opts = {})
61
+ request_stripe_object(
62
+ method: :post,
63
+ path: "/v1/gift_cards/transactions",
64
+ params: params,
65
+ opts: opts
66
+ )
67
+ end
68
+
69
+ # List gift card transactions for a gift card
70
+ def self.list(filters = {}, opts = {})
71
+ request_stripe_object(
72
+ method: :get,
73
+ path: "/v1/gift_cards/transactions",
74
+ params: filters,
75
+ opts: opts
76
+ )
77
+ end
78
+
79
+ # Update a gift card transaction
80
+ def self.update(id, params = {}, opts = {})
81
+ request_stripe_object(
82
+ method: :post,
83
+ path: format("/v1/gift_cards/transactions/%<id>s", { id: CGI.escape(id) }),
84
+ params: params,
85
+ opts: opts
86
+ )
87
+ end
58
88
  end
59
89
  end
60
90
  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
@@ -219,6 +219,36 @@ module Stripe
219
219
  )
220
220
  end
221
221
 
222
+ # 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.
223
+ def self.create(params = {}, opts = {})
224
+ request_stripe_object(method: :post, path: "/v1/invoices", params: params, opts: opts)
225
+ end
226
+
227
+ # 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).
228
+ def self.delete(id, params = {}, opts = {})
229
+ request_stripe_object(
230
+ method: :delete,
231
+ path: format("/v1/invoices/%<id>s", { id: CGI.escape(id) }),
232
+ params: params,
233
+ opts: opts
234
+ )
235
+ end
236
+
237
+ # 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).
238
+ def delete(params = {}, opts = {})
239
+ request_stripe_object(
240
+ method: :delete,
241
+ path: format("/v1/invoices/%<invoice>s", { invoice: CGI.escape(self["id"]) }),
242
+ params: params,
243
+ opts: opts
244
+ )
245
+ end
246
+
247
+ # 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.
248
+ def self.list(filters = {}, opts = {})
249
+ request_stripe_object(method: :get, path: "/v1/invoices", params: filters, opts: opts)
250
+ end
251
+
222
252
  def self.search(params = {}, opts = {})
223
253
  request_stripe_object(method: :get, path: "/v1/invoices/search", params: params, opts: opts)
224
254
  end
@@ -226,5 +256,20 @@ module Stripe
226
256
  def self.search_auto_paging_each(params = {}, opts = {}, &blk)
227
257
  search(params, opts).auto_paging_each(&blk)
228
258
  end
259
+
260
+ # Draft invoices are fully editable. Once an invoice is [finalized](https://stripe.com/docs/billing/invoices/workflow#finalized),
261
+ # monetary values, as well as collection_method, become uneditable.
262
+ #
263
+ # If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on,
264
+ # sending reminders for, or [automatically reconciling](https://stripe.com/docs/billing/invoices/reconciliation) invoices, pass
265
+ # auto_advance=false.
266
+ def self.update(id, params = {}, opts = {})
267
+ request_stripe_object(
268
+ method: :post,
269
+ path: format("/v1/invoices/%<id>s", { id: CGI.escape(id) }),
270
+ params: params,
271
+ opts: opts
272
+ )
273
+ end
229
274
  end
230
275
  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
@@ -70,6 +70,16 @@ module Stripe
70
70
  opts: opts
71
71
  )
72
72
  end
73
+
74
+ # Retrieves a list of CreditUnderwritingRecord objects. The objects are sorted in descending order by creation date, with the most-recently-created object appearing first.
75
+ def self.list(filters = {}, opts = {})
76
+ request_stripe_object(
77
+ method: :get,
78
+ path: "/v1/issuing/credit_underwriting_records",
79
+ params: filters,
80
+ opts: opts
81
+ )
82
+ end
73
83
  end
74
84
  end
75
85
  end