stripe 10.11.0 → 10.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -9
  3. data/OPENAPI_VERSION +1 -1
  4. data/VERSION +1 -1
  5. data/lib/stripe/object_types.rb +6 -5
  6. data/lib/stripe/resources/account.rb +70 -70
  7. data/lib/stripe/resources/apple_pay_domain.rb +4 -4
  8. data/lib/stripe/resources/apps/secret.rb +5 -5
  9. data/lib/stripe/resources/charge.rb +1 -1
  10. data/lib/stripe/resources/checkout/session.rb +21 -21
  11. data/lib/stripe/resources/credit_note.rb +35 -35
  12. data/lib/stripe/resources/customer.rb +58 -58
  13. data/lib/stripe/resources/ephemeral_key.rb +9 -9
  14. data/lib/stripe/resources/file.rb +5 -5
  15. data/lib/stripe/resources/financial_connections/account.rb +34 -34
  16. data/lib/stripe/resources/identity/verification_session.rb +38 -38
  17. data/lib/stripe/resources/invoice.rb +72 -72
  18. data/lib/stripe/resources/issuing/authorization.rb +32 -32
  19. data/lib/stripe/resources/issuing/card.rb +22 -22
  20. data/lib/stripe/resources/issuing/dispute.rb +16 -16
  21. data/lib/stripe/resources/issuing/personalization_design.rb +119 -0
  22. data/lib/stripe/resources/issuing/physical_bundle.rb +26 -0
  23. data/lib/stripe/resources/payment_intent.rb +100 -100
  24. data/lib/stripe/resources/payment_link.rb +10 -10
  25. data/lib/stripe/resources/payment_method.rb +17 -17
  26. data/lib/stripe/resources/payment_method_domain.rb +29 -29
  27. data/lib/stripe/resources/payout.rb +22 -22
  28. data/lib/stripe/resources/quote.rb +51 -51
  29. data/lib/stripe/resources/setup_intent.rb +32 -32
  30. data/lib/stripe/resources/sigma/scheduled_query_run.rb +4 -4
  31. data/lib/stripe/resources/source.rb +18 -18
  32. data/lib/stripe/resources/subscription.rb +36 -36
  33. data/lib/stripe/resources/subscription_item.rb +1 -1
  34. data/lib/stripe/resources/subscription_schedule.rb +19 -19
  35. data/lib/stripe/resources/tax/calculation.rb +10 -10
  36. data/lib/stripe/resources/tax/settings.rb +0 -1
  37. data/lib/stripe/resources/tax/transaction.rb +10 -10
  38. data/lib/stripe/resources/terminal/reader.rb +46 -46
  39. data/lib/stripe/resources/transfer.rb +1 -1
  40. data/lib/stripe/resources/treasury/financial_account.rb +25 -25
  41. data/lib/stripe/resources/treasury/inbound_transfer.rb +14 -14
  42. data/lib/stripe/resources/treasury/outbound_payment.rb +14 -14
  43. data/lib/stripe/resources/treasury/outbound_transfer.rb +14 -14
  44. data/lib/stripe/resources/treasury/transaction_entry.rb +4 -4
  45. data/lib/stripe/resources.rb +2 -0
  46. data/lib/stripe/version.rb +1 -1
  47. metadata +4 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 28c08ac3bb74417f42f5d45630f1efdad13075deec60589cea4c8b88c8db9a3b
4
- data.tar.gz: 1b2560d8edde07beba5f2534efc3f7ca3009cdd4b431d10539d5e6542ef2a58f
3
+ metadata.gz: 9e52a05420bec18e9240d0d9c32a9d71021d6d3ca55a29ddcc131f1a1f6c7729
4
+ data.tar.gz: a16df9ff4b6fa6b4ecbf0c85aa981f3e6a79554a57999ad05d22ae92ae292df5
5
5
  SHA512:
6
- metadata.gz: 86ec1cc29d4876d59b00854f73d6a7e10c19bcb91bd5b708dd943e2e36d16c07d74b8766fc47093a584926257f37d4c150c716c0ac73e4b3820311b250a942ec
7
- data.tar.gz: 51ae5ff315ca40fdfab8eae78945ffea6f96d06a41d7cabfb5bf3c3b437534cf5ca9a9a437c3ec87d46c39f7d8aed4698beb88ca16ca84ac64ea6d480eb9e82a
6
+ metadata.gz: 680a5346daf24fbff0ce55bfa9a2e6c4b8dd91a495ff40307ed40f60b2453b7928eebd17b0e1a15e08be67fb3e1d30ae648b5c02ab953642b70efaa5fb53186e
7
+ data.tar.gz: 1f3c9cd397e61df0e7a355fdb05b8f5fb6fd90d5df77c2c5ee5f3093ae08808dd82bd598203f5c6019cf76e0724cddcbb2200a1c6ad6722508800e32fa86a5c2
data/CHANGELOG.md CHANGED
@@ -1,17 +1,18 @@
1
1
  # Changelog
2
- ## 10.11.0 - 2024-02-29
3
- * [#1348](https://github.com/stripe/stripe-ruby/pull/1348) Use sorbet gem instead of sorbet-static
4
- * [#1342](https://github.com/stripe/stripe-ruby/pull/1342) Update generated code
5
- * Add `list_refunds` and `retrieve_refund` methods on resource `Charge`.
6
- * [#1345](https://github.com/stripe/stripe-ruby/pull/1345) Update README to use add_beta_version
7
-
8
- ## 10.11.0 - 2024-02-29
9
- * [#1348](https://github.com/stripe/stripe-ruby/pull/1348) Use sorbet gem instead of sorbet-static
2
+ ## 10.12.0 - 2024-03-14
3
+ * [#1359](https://github.com/stripe/stripe-ruby/pull/1359) Update generated code
4
+ * Add support for new resources `Issuing.PersonalizationDesign` and `Issuing.PhysicalBundle`
5
+ * Add support for `create`, `list`, `retrieve`, and `update` methods on resource `PersonalizationDesign`
6
+ * Add support for `list` and `retrieve` methods on resource `PhysicalBundle`
7
+ * [#1354](https://github.com/stripe/stripe-ruby/pull/1354) Refactor after SDK based generation pattern
8
+ * [#1347](https://github.com/stripe/stripe-ruby/pull/1347) Reorder methods with lexographical sort
9
+ * [#1355](https://github.com/stripe/stripe-ruby/pull/1355) Disable Metrics/ClassLength
10
+ * [#1351](https://github.com/stripe/stripe-ruby/pull/1351) Update CHANGELOG.md
10
11
 
11
12
  ## 10.11.0 - 2024-02-29
12
13
  * [#1348](https://github.com/stripe/stripe-ruby/pull/1348) Use sorbet gem instead of sorbet-static
13
14
  * [#1342](https://github.com/stripe/stripe-ruby/pull/1342) Update generated code
14
- * Add `list_refunds` and `retrieve_refund` methods on resource `Charge`
15
+ * Add `list_refunds` and `retrieve_refund` methods on resource `Charge`.
15
16
  * [#1345](https://github.com/stripe/stripe-ruby/pull/1345) Update README to use add_beta_version
16
17
 
17
18
  ## 10.10.0 - 2024-02-22
data/OPENAPI_VERSION CHANGED
@@ -1 +1 @@
1
- v841
1
+ v878
data/VERSION CHANGED
@@ -1 +1 @@
1
- 10.11.0
1
+ 10.12.0
@@ -1,4 +1,3 @@
1
- # File generated from our OpenAPI spec
2
1
  # frozen_string_literal: true
3
2
 
4
3
  # rubocop:disable Metrics/MethodLength
@@ -11,9 +10,9 @@ module Stripe
11
10
  # data structures
12
11
  ListObject.object_name => ListObject,
13
12
  SearchResultObject.object_name => SearchResultObject,
14
-
15
- # business objects
16
13
  File.object_name_alt => File,
14
+
15
+ # The beginning of the section generated from our OpenAPI spec
17
16
  Account.object_name => Account,
18
17
  AccountLink.object_name => AccountLink,
19
18
  AccountSession.object_name => AccountSession,
@@ -51,8 +50,7 @@ module Stripe
51
50
  FileLink.object_name => FileLink,
52
51
  FinancialConnections::Account.object_name => FinancialConnections::Account,
53
52
  FinancialConnections::AccountOwner.object_name => FinancialConnections::AccountOwner,
54
- FinancialConnections::AccountOwnership.object_name =>
55
- FinancialConnections::AccountOwnership,
53
+ FinancialConnections::AccountOwnership.object_name => FinancialConnections::AccountOwnership,
56
54
  FinancialConnections::Session.object_name => FinancialConnections::Session,
57
55
  FinancialConnections::Transaction.object_name => FinancialConnections::Transaction,
58
56
  FundingInstructions.object_name => FundingInstructions,
@@ -65,6 +63,8 @@ module Stripe
65
63
  Issuing::Card.object_name => Issuing::Card,
66
64
  Issuing::Cardholder.object_name => Issuing::Cardholder,
67
65
  Issuing::Dispute.object_name => Issuing::Dispute,
66
+ Issuing::PersonalizationDesign.object_name => Issuing::PersonalizationDesign,
67
+ Issuing::PhysicalBundle.object_name => Issuing::PhysicalBundle,
68
68
  Issuing::Token.object_name => Issuing::Token,
69
69
  Issuing::Transaction.object_name => Issuing::Transaction,
70
70
  LineItem.object_name => LineItem,
@@ -130,6 +130,7 @@ module Stripe
130
130
  UsageRecord.object_name => UsageRecord,
131
131
  UsageRecordSummary.object_name => UsageRecordSummary,
132
132
  WebhookEndpoint.object_name => WebhookEndpoint,
133
+ # The end of the section generated from our OpenAPI spec
133
134
  }
134
135
  end
135
136
  end
@@ -13,8 +13,8 @@ module Stripe
13
13
  extend Stripe::APIOperations::Create
14
14
  include Stripe::APIOperations::Delete
15
15
  extend Stripe::APIOperations::List
16
- include Stripe::APIOperations::Save
17
16
  extend Stripe::APIOperations::NestedResource
17
+ include Stripe::APIOperations::Save
18
18
 
19
19
  OBJECT_NAME = "account"
20
20
  def self.object_name
@@ -29,6 +29,49 @@ module Stripe
29
29
  nested_resource_class_methods :login_link, operations: %i[create]
30
30
  nested_resource_class_methods :person, operations: %i[create retrieve update delete list]
31
31
 
32
+ # With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users.
33
+ # To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings).
34
+ #
35
+ # If you've already collected information for your connected accounts, you [can prefill that information](https://stripe.com/docs/connect/best-practices#onboarding) when
36
+ # creating the account. Connect Onboarding won't ask for the prefilled information during account onboarding.
37
+ # You can prefill any information on the account.
38
+ def self.create(params = {}, opts = {})
39
+ request_stripe_object(method: :post, path: "/v1/accounts", params: params, opts: opts)
40
+ end
41
+
42
+ # With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage.
43
+ #
44
+ # Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero.
45
+ #
46
+ # If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead.
47
+ def self.delete(id, params = {}, opts = {})
48
+ request_stripe_object(
49
+ method: :delete,
50
+ path: format("/v1/accounts/%<id>s", { id: CGI.escape(id) }),
51
+ params: params,
52
+ opts: opts
53
+ )
54
+ end
55
+
56
+ # With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage.
57
+ #
58
+ # Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero.
59
+ #
60
+ # If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead.
61
+ def delete(params = {}, opts = {})
62
+ request_stripe_object(
63
+ method: :delete,
64
+ path: format("/v1/accounts/%<account>s", { account: CGI.escape(self["id"]) }),
65
+ params: params,
66
+ opts: opts
67
+ )
68
+ end
69
+
70
+ # Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). If you're not a platform, the list is empty.
71
+ def self.list(filters = {}, opts = {})
72
+ request_stripe_object(method: :get, path: "/v1/accounts", params: filters, opts: opts)
73
+ end
74
+
32
75
  # Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first.
33
76
  def persons(params = {}, opts = {})
34
77
  request_stripe_object(
@@ -39,6 +82,16 @@ module Stripe
39
82
  )
40
83
  end
41
84
 
85
+ # Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first.
86
+ def self.persons(account, params = {}, opts = {})
87
+ request_stripe_object(
88
+ method: :get,
89
+ path: format("/v1/accounts/%<account>s/persons", { account: CGI.escape(account) }),
90
+ params: params,
91
+ opts: opts
92
+ )
93
+ end
94
+
42
95
  # With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious.
43
96
  #
44
97
  # Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero.
@@ -51,23 +104,31 @@ module Stripe
51
104
  )
52
105
  end
53
106
 
54
- # Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first.
55
- def self.persons(account, params = {}, opts = {})
107
+ # With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious.
108
+ #
109
+ # Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero.
110
+ def self.reject(account, params = {}, opts = {})
56
111
  request_stripe_object(
57
- method: :get,
58
- path: format("/v1/accounts/%<account>s/persons", { account: CGI.escape(account) }),
112
+ method: :post,
113
+ path: format("/v1/accounts/%<account>s/reject", { account: CGI.escape(account) }),
59
114
  params: params,
60
115
  opts: opts
61
116
  )
62
117
  end
63
118
 
64
- # With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious.
119
+ # Updates a [connected account](https://stripe.com/docs/connect/accounts) by setting the values of the parameters passed. Any parameters not provided are
120
+ # left unchanged.
65
121
  #
66
- # Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero.
67
- def self.reject(account, params = {}, opts = {})
122
+ # For Custom accounts, you can update any information on the account. For other accounts, you can update all information until that
123
+ # account has started to go through Connect Onboarding. Once you create an [Account Link or <a href="/docs/api/account_sessions">Account Session](https://stripe.com/docs/api/account_links),
124
+ # some properties can only be changed or updated for Custom accounts.
125
+ #
126
+ # To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account). Refer to our
127
+ # [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts.
128
+ def self.update(id, params = {}, opts = {})
68
129
  request_stripe_object(
69
130
  method: :post,
70
- path: format("/v1/accounts/%<account>s/reject", { account: CGI.escape(account) }),
131
+ path: format("/v1/accounts/%<id>s", { id: CGI.escape(id) }),
71
132
  params: params,
72
133
  opts: opts
73
134
  )
@@ -196,66 +257,5 @@ module Stripe
196
257
  end
197
258
  update_hash
198
259
  end
199
-
200
- # With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users.
201
- # To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings).
202
- #
203
- # If you've already collected information for your connected accounts, you [can prefill that information](https://stripe.com/docs/connect/best-practices#onboarding) when
204
- # creating the account. Connect Onboarding won't ask for the prefilled information during account onboarding.
205
- # You can prefill any information on the account.
206
- def self.create(params = {}, opts = {})
207
- request_stripe_object(method: :post, path: "/v1/accounts", params: params, opts: opts)
208
- end
209
-
210
- # With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage.
211
- #
212
- # Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero.
213
- #
214
- # If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead.
215
- def self.delete(id, params = {}, opts = {})
216
- request_stripe_object(
217
- method: :delete,
218
- path: format("/v1/accounts/%<id>s", { id: CGI.escape(id) }),
219
- params: params,
220
- opts: opts
221
- )
222
- end
223
-
224
- # With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage.
225
- #
226
- # Accounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero.
227
- #
228
- # If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead.
229
- def delete(params = {}, opts = {})
230
- request_stripe_object(
231
- method: :delete,
232
- path: format("/v1/accounts/%<account>s", { account: CGI.escape(self["id"]) }),
233
- params: params,
234
- opts: opts
235
- )
236
- end
237
-
238
- # Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). If you're not a platform, the list is empty.
239
- def self.list(filters = {}, opts = {})
240
- request_stripe_object(method: :get, path: "/v1/accounts", params: filters, opts: opts)
241
- end
242
-
243
- # Updates a [connected account](https://stripe.com/docs/connect/accounts) by setting the values of the parameters passed. Any parameters not provided are
244
- # left unchanged.
245
- #
246
- # For Custom accounts, you can update any information on the account. For other accounts, you can update all information until that
247
- # account has started to go through Connect Onboarding. Once you create an [Account Link or <a href="/docs/api/account_sessions">Account Session](https://stripe.com/docs/api/account_links),
248
- # some properties can only be changed or updated for Custom accounts.
249
- #
250
- # To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account). Refer to our
251
- # [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts.
252
- def self.update(id, params = {}, opts = {})
253
- request_stripe_object(
254
- method: :post,
255
- path: format("/v1/accounts/%<id>s", { id: CGI.escape(id) }),
256
- params: params,
257
- opts: opts
258
- )
259
- end
260
260
  end
261
261
  end
@@ -13,10 +13,6 @@ module Stripe
13
13
  "apple_pay_domain"
14
14
  end
15
15
 
16
- def self.resource_url
17
- "/v1/apple_pay/domains"
18
- end
19
-
20
16
  # Create an apple pay domain.
21
17
  def self.create(params = {}, opts = {})
22
18
  request_stripe_object(
@@ -56,5 +52,9 @@ module Stripe
56
52
  opts: opts
57
53
  )
58
54
  end
55
+
56
+ def self.resource_url
57
+ "/v1/apple_pay/domains"
58
+ end
59
59
  end
60
60
  end
@@ -21,6 +21,11 @@ module Stripe
21
21
  "apps.secret"
22
22
  end
23
23
 
24
+ # Create or replace a secret in the secret store.
25
+ def self.create(params = {}, opts = {})
26
+ request_stripe_object(method: :post, path: "/v1/apps/secrets", params: params, opts: opts)
27
+ end
28
+
24
29
  # Deletes a secret from the secret store by name and scope.
25
30
  def self.delete_where(params = {}, opts = {})
26
31
  request_stripe_object(
@@ -41,11 +46,6 @@ module Stripe
41
46
  )
42
47
  end
43
48
 
44
- # Create or replace a secret in the secret store.
45
- def self.create(params = {}, opts = {})
46
- request_stripe_object(method: :post, path: "/v1/apps/secrets", params: params, opts: opts)
47
- end
48
-
49
49
  # List all secrets stored on the given scope.
50
50
  def self.list(filters = {}, opts = {})
51
51
  request_stripe_object(method: :get, path: "/v1/apps/secrets", params: filters, opts: opts)
@@ -9,9 +9,9 @@ module Stripe
9
9
  class Charge < APIResource
10
10
  extend Stripe::APIOperations::Create
11
11
  extend Stripe::APIOperations::List
12
+ extend Stripe::APIOperations::NestedResource
12
13
  extend Stripe::APIOperations::Search
13
14
  include Stripe::APIOperations::Save
14
- extend Stripe::APIOperations::NestedResource
15
15
 
16
16
  OBJECT_NAME = "charge"
17
17
  def self.object_name
@@ -26,23 +26,23 @@ module Stripe
26
26
  "checkout.session"
27
27
  end
28
28
 
29
- # A Session can be expired when it is in one of these statuses: open
30
- #
31
- # After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired.
32
- def expire(params = {}, opts = {})
29
+ # Creates a Session object.
30
+ def self.create(params = {}, opts = {})
33
31
  request_stripe_object(
34
32
  method: :post,
35
- path: format("/v1/checkout/sessions/%<session>s/expire", { session: CGI.escape(self["id"]) }),
33
+ path: "/v1/checkout/sessions",
36
34
  params: params,
37
35
  opts: opts
38
36
  )
39
37
  end
40
38
 
41
- # When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
42
- def list_line_items(params = {}, opts = {})
39
+ # A Session can be expired when it is in one of these statuses: open
40
+ #
41
+ # After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired.
42
+ def expire(params = {}, opts = {})
43
43
  request_stripe_object(
44
- method: :get,
45
- path: format("/v1/checkout/sessions/%<session>s/line_items", { session: CGI.escape(self["id"]) }),
44
+ method: :post,
45
+ path: format("/v1/checkout/sessions/%<session>s/expire", { session: CGI.escape(self["id"]) }),
46
46
  params: params,
47
47
  opts: opts
48
48
  )
@@ -60,32 +60,32 @@ module Stripe
60
60
  )
61
61
  end
62
62
 
63
- # When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
64
- def self.list_line_items(session, params = {}, opts = {})
63
+ # Returns a list of Checkout Sessions.
64
+ def self.list(filters = {}, opts = {})
65
65
  request_stripe_object(
66
66
  method: :get,
67
- path: format("/v1/checkout/sessions/%<session>s/line_items", { session: CGI.escape(session) }),
68
- params: params,
67
+ path: "/v1/checkout/sessions",
68
+ params: filters,
69
69
  opts: opts
70
70
  )
71
71
  end
72
72
 
73
- # Creates a Session object.
74
- def self.create(params = {}, opts = {})
73
+ # When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
74
+ def list_line_items(params = {}, opts = {})
75
75
  request_stripe_object(
76
- method: :post,
77
- path: "/v1/checkout/sessions",
76
+ method: :get,
77
+ path: format("/v1/checkout/sessions/%<session>s/line_items", { session: CGI.escape(self["id"]) }),
78
78
  params: params,
79
79
  opts: opts
80
80
  )
81
81
  end
82
82
 
83
- # Returns a list of Checkout Sessions.
84
- def self.list(filters = {}, opts = {})
83
+ # When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
84
+ def self.list_line_items(session, params = {}, opts = {})
85
85
  request_stripe_object(
86
86
  method: :get,
87
- path: "/v1/checkout/sessions",
88
- params: filters,
87
+ path: format("/v1/checkout/sessions/%<session>s/line_items", { session: CGI.escape(session) }),
88
+ params: params,
89
89
  opts: opts
90
90
  )
91
91
  end
@@ -15,14 +15,27 @@ module Stripe
15
15
  "credit_note"
16
16
  end
17
17
 
18
- # Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding).
19
- def void_credit_note(params = {}, opts = {})
20
- request_stripe_object(
21
- method: :post,
22
- path: format("/v1/credit_notes/%<id>s/void", { id: CGI.escape(self["id"]) }),
23
- params: params,
24
- opts: opts
25
- )
18
+ # Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces
19
+ # its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result
20
+ # in any combination of the following:
21
+ #
22
+ #
23
+ # Refund: create a new refund (using refund_amount) or link an existing refund (using refund).
24
+ # Customer balance credit: credit the customer's balance (using credit_amount) which will be automatically applied to their next invoice when it's finalized.
25
+ # Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using out_of_band_amount).
26
+ #
27
+ #
28
+ # For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total.
29
+ #
30
+ # You may issue multiple credit notes for an invoice. Each credit note will increment the invoice's pre_payment_credit_notes_amount
31
+ # or post_payment_credit_notes_amount depending on its status at the time of credit note creation.
32
+ def self.create(params = {}, opts = {})
33
+ request_stripe_object(method: :post, path: "/v1/credit_notes", params: params, opts: opts)
34
+ end
35
+
36
+ # Returns a list of credit notes.
37
+ def self.list(filters = {}, opts = {})
38
+ request_stripe_object(method: :get, path: "/v1/credit_notes", params: filters, opts: opts)
26
39
  end
27
40
 
28
41
  # When retrieving a credit note preview, you'll get a lines property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items.
@@ -45,44 +58,31 @@ module Stripe
45
58
  )
46
59
  end
47
60
 
48
- # Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding).
49
- def self.void_credit_note(id, params = {}, opts = {})
61
+ # Updates an existing credit note.
62
+ def self.update(id, params = {}, opts = {})
50
63
  request_stripe_object(
51
64
  method: :post,
52
- path: format("/v1/credit_notes/%<id>s/void", { id: CGI.escape(id) }),
65
+ path: format("/v1/credit_notes/%<id>s", { id: CGI.escape(id) }),
53
66
  params: params,
54
67
  opts: opts
55
68
  )
56
69
  end
57
70
 
58
- # Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces
59
- # its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result
60
- # in any combination of the following:
61
- #
62
- #
63
- # Refund: create a new refund (using refund_amount) or link an existing refund (using refund).
64
- # Customer balance credit: credit the customer's balance (using credit_amount) which will be automatically applied to their next invoice when it's finalized.
65
- # Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using out_of_band_amount).
66
- #
67
- #
68
- # For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total.
69
- #
70
- # You may issue multiple credit notes for an invoice. Each credit note will increment the invoice's pre_payment_credit_notes_amount
71
- # or post_payment_credit_notes_amount depending on its status at the time of credit note creation.
72
- def self.create(params = {}, opts = {})
73
- request_stripe_object(method: :post, path: "/v1/credit_notes", params: params, opts: opts)
74
- end
75
-
76
- # Returns a list of credit notes.
77
- def self.list(filters = {}, opts = {})
78
- request_stripe_object(method: :get, path: "/v1/credit_notes", params: filters, opts: opts)
71
+ # Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding).
72
+ def void_credit_note(params = {}, opts = {})
73
+ request_stripe_object(
74
+ method: :post,
75
+ path: format("/v1/credit_notes/%<id>s/void", { id: CGI.escape(self["id"]) }),
76
+ params: params,
77
+ opts: opts
78
+ )
79
79
  end
80
80
 
81
- # Updates an existing credit note.
82
- def self.update(id, params = {}, opts = {})
81
+ # Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding).
82
+ def self.void_credit_note(id, params = {}, opts = {})
83
83
  request_stripe_object(
84
84
  method: :post,
85
- path: format("/v1/credit_notes/%<id>s", { id: CGI.escape(id) }),
85
+ path: format("/v1/credit_notes/%<id>s/void", { id: CGI.escape(id) }),
86
86
  params: params,
87
87
  opts: opts
88
88
  )