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
@@ -10,7 +10,6 @@ module Stripe
10
10
  # account has started to go through Connect Onboarding. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions),
11
11
  # some properties are only returned for Custom accounts. Learn about the differences [between accounts](https://stripe.com/docs/connect/accounts).
12
12
  class Account < APIResource
13
- extend Gem::Deprecate
14
13
  extend Stripe::APIOperations::Create
15
14
  include Stripe::APIOperations::Delete
16
15
  extend Stripe::APIOperations::List
@@ -195,5 +194,66 @@ module Stripe
195
194
  end
196
195
  update_hash
197
196
  end
197
+
198
+ # With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users.
199
+ # To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings).
200
+ #
201
+ # If you've already collected information for your connected accounts, you [can prefill that information](https://stripe.com/docs/connect/best-practices#onboarding) when
202
+ # creating the account. Connect Onboarding won't ask for the prefilled information during account onboarding.
203
+ # You can prefill any information on the account.
204
+ def self.create(params = {}, opts = {})
205
+ request_stripe_object(method: :post, path: "/v1/accounts", params: params, opts: opts)
206
+ end
207
+
208
+ # With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage.
209
+ #
210
+ # 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.
211
+ #
212
+ # If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead.
213
+ def self.delete(id, params = {}, opts = {})
214
+ request_stripe_object(
215
+ method: :delete,
216
+ path: format("/v1/accounts/%<id>s", { id: CGI.escape(id) }),
217
+ params: params,
218
+ opts: opts
219
+ )
220
+ end
221
+
222
+ # With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage.
223
+ #
224
+ # 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.
225
+ #
226
+ # If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead.
227
+ def delete(params = {}, opts = {})
228
+ request_stripe_object(
229
+ method: :delete,
230
+ path: format("/v1/accounts/%<account>s", { account: CGI.escape(self["id"]) }),
231
+ params: params,
232
+ opts: opts
233
+ )
234
+ end
235
+
236
+ # 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.
237
+ def self.list(filters = {}, opts = {})
238
+ request_stripe_object(method: :get, path: "/v1/accounts", params: filters, opts: opts)
239
+ end
240
+
241
+ # Updates a [connected account](https://stripe.com/docs/connect/accounts) by setting the values of the parameters passed. Any parameters not provided are
242
+ # left unchanged.
243
+ #
244
+ # For Custom accounts, you can update any information on the account. For other accounts, you can update all information until that
245
+ # 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),
246
+ # some properties can only be changed or updated for Custom accounts.
247
+ #
248
+ # To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account). Refer to our
249
+ # [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts.
250
+ def self.update(id, params = {}, opts = {})
251
+ request_stripe_object(
252
+ method: :post,
253
+ path: format("/v1/accounts/%<id>s", { id: CGI.escape(id) }),
254
+ params: params,
255
+ opts: opts
256
+ )
257
+ end
198
258
  end
199
259
  end
@@ -10,5 +10,10 @@ module Stripe
10
10
  extend Stripe::APIOperations::Create
11
11
 
12
12
  OBJECT_NAME = "account_link"
13
+
14
+ # Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow.
15
+ def self.create(params = {}, opts = {})
16
+ request_stripe_object(method: :post, path: "/v1/account_links", params: params, opts: opts)
17
+ end
13
18
  end
14
19
  end
@@ -13,5 +13,10 @@ module Stripe
13
13
  extend Stripe::APIOperations::Create
14
14
 
15
15
  OBJECT_NAME = "account_session"
16
+
17
+ # Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access.
18
+ def self.create(params = {}, opts = {})
19
+ request_stripe_object(method: :post, path: "/v1/account_sessions", params: params, opts: opts)
20
+ end
16
21
  end
17
22
  end
@@ -13,5 +13,45 @@ module Stripe
13
13
  def self.resource_url
14
14
  "/v1/apple_pay/domains"
15
15
  end
16
+
17
+ # Create an apple pay domain.
18
+ def self.create(params = {}, opts = {})
19
+ request_stripe_object(
20
+ method: :post,
21
+ path: "/v1/apple_pay/domains",
22
+ params: params,
23
+ opts: opts
24
+ )
25
+ end
26
+
27
+ # Delete an apple pay domain.
28
+ def self.delete(id, params = {}, opts = {})
29
+ request_stripe_object(
30
+ method: :delete,
31
+ path: format("/v1/apple_pay/domains/%<id>s", { id: CGI.escape(id) }),
32
+ params: params,
33
+ opts: opts
34
+ )
35
+ end
36
+
37
+ # Delete an apple pay domain.
38
+ def delete(params = {}, opts = {})
39
+ request_stripe_object(
40
+ method: :delete,
41
+ path: format("/v1/apple_pay/domains/%<domain>s", { domain: CGI.escape(self["id"]) }),
42
+ params: params,
43
+ opts: opts
44
+ )
45
+ end
46
+
47
+ # List apple pay domains.
48
+ def self.list(filters = {}, opts = {})
49
+ request_stripe_object(
50
+ method: :get,
51
+ path: "/v1/apple_pay/domains",
52
+ params: filters,
53
+ opts: opts
54
+ )
55
+ end
16
56
  end
17
57
  end
@@ -9,5 +9,10 @@ module Stripe
9
9
  OBJECT_NAME = "application_fee"
10
10
 
11
11
  nested_resource_class_methods :refund, operations: %i[create retrieve update list]
12
+
13
+ # Returns a list of application fees you've previously collected. The application fees are returned in sorted order, with the most recent fees appearing first.
14
+ def self.list(filters = {}, opts = {})
15
+ request_stripe_object(method: :get, path: "/v1/application_fees", params: filters, opts: opts)
16
+ end
12
17
  end
13
18
  end
@@ -37,6 +37,16 @@ module Stripe
37
37
  opts: opts
38
38
  )
39
39
  end
40
+
41
+ # Create or replace a secret in the secret store.
42
+ def self.create(params = {}, opts = {})
43
+ request_stripe_object(method: :post, path: "/v1/apps/secrets", params: params, opts: opts)
44
+ end
45
+
46
+ # List all secrets stored on the given scope.
47
+ def self.list(filters = {}, opts = {})
48
+ request_stripe_object(method: :get, path: "/v1/apps/secrets", params: filters, opts: opts)
49
+ end
40
50
  end
41
51
  end
42
52
  end
@@ -10,5 +10,17 @@ module Stripe
10
10
  extend Stripe::APIOperations::List
11
11
 
12
12
  OBJECT_NAME = "balance_transaction"
13
+
14
+ # Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first.
15
+ #
16
+ # Note that this endpoint was previously called “Balance history” and used the path /v1/balance/history.
17
+ def self.list(filters = {}, opts = {})
18
+ request_stripe_object(
19
+ method: :get,
20
+ path: "/v1/balance_transactions",
21
+ params: filters,
22
+ opts: opts
23
+ )
24
+ end
13
25
  end
14
26
  end
@@ -46,5 +46,32 @@ module Stripe
46
46
  "or `Account.retrieve_external_account('account_id', " \
47
47
  "'bank_account_id')`"
48
48
  end
49
+
50
+ def self.delete(id, params = {}, opts = {})
51
+ request_stripe_object(
52
+ method: :delete,
53
+ path: "#{resource_url}/#{id}",
54
+ params: params,
55
+ opts: opts
56
+ )
57
+ end
58
+
59
+ def delete(params = {}, opts = {})
60
+ request_stripe_object(
61
+ method: :delete,
62
+ path: resource_url.to_s,
63
+ params: params,
64
+ opts: opts
65
+ )
66
+ end
67
+
68
+ def self.list(filters = {}, opts = {})
69
+ request_stripe_object(
70
+ method: :delete,
71
+ path: resource_url.to_s,
72
+ params: filters,
73
+ opts: opts
74
+ )
75
+ end
49
76
  end
50
77
  end
@@ -10,6 +10,36 @@ module Stripe
10
10
  include Stripe::APIOperations::Save
11
11
 
12
12
  OBJECT_NAME = "billing_portal.configuration"
13
+
14
+ # Creates a configuration that describes the functionality and behavior of a PortalSession
15
+ def self.create(params = {}, opts = {})
16
+ request_stripe_object(
17
+ method: :post,
18
+ path: "/v1/billing_portal/configurations",
19
+ params: params,
20
+ opts: opts
21
+ )
22
+ end
23
+
24
+ # Returns a list of configurations that describe the functionality of the customer portal.
25
+ def self.list(filters = {}, opts = {})
26
+ request_stripe_object(
27
+ method: :get,
28
+ path: "/v1/billing_portal/configurations",
29
+ params: filters,
30
+ opts: opts
31
+ )
32
+ end
33
+
34
+ # Updates a configuration that describes the functionality of the customer portal.
35
+ def self.update(id, params = {}, opts = {})
36
+ request_stripe_object(
37
+ method: :post,
38
+ path: format("/v1/billing_portal/configurations/%<id>s", { id: CGI.escape(id) }),
39
+ params: params,
40
+ opts: opts
41
+ )
42
+ end
13
43
  end
14
44
  end
15
45
  end
@@ -21,6 +21,16 @@ module Stripe
21
21
  extend Stripe::APIOperations::Create
22
22
 
23
23
  OBJECT_NAME = "billing_portal.session"
24
+
25
+ # Creates a session of the customer portal.
26
+ def self.create(params = {}, opts = {})
27
+ request_stripe_object(
28
+ method: :post,
29
+ path: "/v1/billing_portal/sessions",
30
+ params: params,
31
+ opts: opts
32
+ )
33
+ end
24
34
  end
25
35
  end
26
36
  end
@@ -37,5 +37,32 @@ module Stripe
37
37
  "'customer_id', 'card_id')` or " \
38
38
  "`Account.retrieve_external_account('account_id', 'card_id')`"
39
39
  end
40
+
41
+ def self.delete(id, params = {}, opts = {})
42
+ request_stripe_object(
43
+ method: :delete,
44
+ path: "#{resource_url}/#{id}",
45
+ params: params,
46
+ opts: opts
47
+ )
48
+ end
49
+
50
+ def delete(params = {}, opts = {})
51
+ request_stripe_object(
52
+ method: :delete,
53
+ path: resource_url.to_s,
54
+ params: params,
55
+ opts: opts
56
+ )
57
+ end
58
+
59
+ def self.list(filters = {}, opts = {})
60
+ request_stripe_object(
61
+ method: :delete,
62
+ path: resource_url.to_s,
63
+ params: filters,
64
+ opts: opts
65
+ )
66
+ end
40
67
  end
41
68
  end
@@ -42,6 +42,18 @@ module Stripe
42
42
  )
43
43
  end
44
44
 
45
+ # This method is no longer recommended—use the [Payment Intents API](https://stripe.com/docs/api/payment_intents)
46
+ # to initiate a new payment instead. Confirmation of the PaymentIntent creates the Charge
47
+ # object used to request payment.
48
+ def self.create(params = {}, opts = {})
49
+ request_stripe_object(method: :post, path: "/v1/charges", params: params, opts: opts)
50
+ end
51
+
52
+ # Returns a list of charges you've previously created. The charges are returned in sorted order, with the most recent charges appearing first.
53
+ def self.list(filters = {}, opts = {})
54
+ request_stripe_object(method: :get, path: "/v1/charges", params: filters, opts: opts)
55
+ end
56
+
45
57
  def self.search(params = {}, opts = {})
46
58
  request_stripe_object(method: :get, path: "/v1/charges/search", params: params, opts: opts)
47
59
  end
@@ -49,5 +61,15 @@ module Stripe
49
61
  def self.search_auto_paging_each(params = {}, opts = {}, &blk)
50
62
  search(params, opts).auto_paging_each(&blk)
51
63
  end
64
+
65
+ # Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
66
+ def self.update(id, params = {}, opts = {})
67
+ request_stripe_object(
68
+ method: :post,
69
+ path: format("/v1/charges/%<id>s", { id: CGI.escape(id) }),
70
+ params: params,
71
+ opts: opts
72
+ )
73
+ end
52
74
  end
53
75
  end
@@ -66,6 +66,26 @@ module Stripe
66
66
  opts: opts
67
67
  )
68
68
  end
69
+
70
+ # Creates a Session object.
71
+ def self.create(params = {}, opts = {})
72
+ request_stripe_object(
73
+ method: :post,
74
+ path: "/v1/checkout/sessions",
75
+ params: params,
76
+ opts: opts
77
+ )
78
+ end
79
+
80
+ # Returns a list of Checkout Sessions.
81
+ def self.list(filters = {}, opts = {})
82
+ request_stripe_object(
83
+ method: :get,
84
+ path: "/v1/checkout/sessions",
85
+ params: filters,
86
+ opts: opts
87
+ )
88
+ end
69
89
  end
70
90
  end
71
91
  end
@@ -37,6 +37,28 @@ module Stripe
37
37
  opts: opts
38
38
  )
39
39
  end
40
+
41
+ # Creates a Climate order object for a given Climate product. The order will be processed immediately
42
+ # after creation and payment will be deducted your Stripe balance.
43
+ def self.create(params = {}, opts = {})
44
+ request_stripe_object(method: :post, path: "/v1/climate/orders", params: params, opts: opts)
45
+ end
46
+
47
+ # Lists all Climate order objects. The orders are returned sorted by creation date, with the
48
+ # most recently created orders appearing first.
49
+ def self.list(filters = {}, opts = {})
50
+ request_stripe_object(method: :get, path: "/v1/climate/orders", params: filters, opts: opts)
51
+ end
52
+
53
+ # Updates the specified order by setting the values of the parameters passed.
54
+ def self.update(id, params = {}, opts = {})
55
+ request_stripe_object(
56
+ method: :post,
57
+ path: format("/v1/climate/orders/%<id>s", { id: CGI.escape(id) }),
58
+ params: params,
59
+ opts: opts
60
+ )
61
+ end
40
62
  end
41
63
  end
42
64
  end
@@ -9,6 +9,16 @@ module Stripe
9
9
  extend Stripe::APIOperations::List
10
10
 
11
11
  OBJECT_NAME = "climate.product"
12
+
13
+ # Lists all available Climate product objects.
14
+ def self.list(filters = {}, opts = {})
15
+ request_stripe_object(
16
+ method: :get,
17
+ path: "/v1/climate/products",
18
+ params: filters,
19
+ opts: opts
20
+ )
21
+ end
12
22
  end
13
23
  end
14
24
  end
@@ -8,6 +8,16 @@ module Stripe
8
8
  extend Stripe::APIOperations::List
9
9
 
10
10
  OBJECT_NAME = "climate.supplier"
11
+
12
+ # Lists all available Climate supplier objects.
13
+ def self.list(filters = {}, opts = {})
14
+ request_stripe_object(
15
+ method: :get,
16
+ path: "/v1/climate/suppliers",
17
+ params: filters,
18
+ opts: opts
19
+ )
20
+ end
11
21
  end
12
22
  end
13
23
  end
@@ -12,5 +12,10 @@ module Stripe
12
12
  extend Stripe::APIOperations::List
13
13
 
14
14
  OBJECT_NAME = "country_spec"
15
+
16
+ # Lists all Country Spec objects available in the API.
17
+ def self.list(filters = {}, opts = {})
18
+ request_stripe_object(method: :get, path: "/v1/country_specs", params: filters, opts: opts)
19
+ end
15
20
  end
16
21
  end
@@ -12,5 +12,47 @@ module Stripe
12
12
  include Stripe::APIOperations::Save
13
13
 
14
14
  OBJECT_NAME = "coupon"
15
+
16
+ # You can create coupons easily via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly.
17
+ #
18
+ # A coupon has either a percent_off or an amount_off and currency. If you set an amount_off, that amount will be subtracted from any invoice's subtotal. For example, an invoice with a subtotal of 100 will have a final total of 0 if a coupon with an amount_off of 200 is applied to it and an invoice with a subtotal of 300 will have a final total of 100 if a coupon with an amount_off of 200 is applied to it.
19
+ def self.create(params = {}, opts = {})
20
+ request_stripe_object(method: :post, path: "/v1/coupons", params: params, opts: opts)
21
+ end
22
+
23
+ # You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API.
24
+ def self.delete(id, params = {}, opts = {})
25
+ request_stripe_object(
26
+ method: :delete,
27
+ path: format("/v1/coupons/%<id>s", { id: CGI.escape(id) }),
28
+ params: params,
29
+ opts: opts
30
+ )
31
+ end
32
+
33
+ # You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API.
34
+ def delete(params = {}, opts = {})
35
+ request_stripe_object(
36
+ method: :delete,
37
+ path: format("/v1/coupons/%<coupon>s", { coupon: CGI.escape(self["id"]) }),
38
+ params: params,
39
+ opts: opts
40
+ )
41
+ end
42
+
43
+ # Returns a list of your coupons.
44
+ def self.list(filters = {}, opts = {})
45
+ request_stripe_object(method: :get, path: "/v1/coupons", params: filters, opts: opts)
46
+ end
47
+
48
+ # Updates the metadata of a coupon. Other coupon details (currency, duration, amount_off) are, by design, not editable.
49
+ def self.update(id, params = {}, opts = {})
50
+ request_stripe_object(
51
+ method: :post,
52
+ path: format("/v1/coupons/%<id>s", { id: CGI.escape(id) }),
53
+ params: params,
54
+ opts: opts
55
+ )
56
+ end
15
57
  end
16
58
  end
@@ -51,5 +51,38 @@ module Stripe
51
51
  opts: opts
52
52
  )
53
53
  end
54
+
55
+ # Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces
56
+ # its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result
57
+ # in any combination of the following:
58
+ #
59
+ #
60
+ # Refund: create a new refund (using refund_amount) or link an existing refund (using refund).
61
+ # Customer balance credit: credit the customer's balance (using credit_amount) which will be automatically applied to their next invoice when it's finalized.
62
+ # Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using out_of_band_amount).
63
+ #
64
+ #
65
+ # For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total.
66
+ #
67
+ # You may issue multiple credit notes for an invoice. Each credit note will increment the invoice's pre_payment_credit_notes_amount
68
+ # or post_payment_credit_notes_amount depending on its status at the time of credit note creation.
69
+ def self.create(params = {}, opts = {})
70
+ request_stripe_object(method: :post, path: "/v1/credit_notes", params: params, opts: opts)
71
+ end
72
+
73
+ # Returns a list of credit notes.
74
+ def self.list(filters = {}, opts = {})
75
+ request_stripe_object(method: :get, path: "/v1/credit_notes", params: filters, opts: opts)
76
+ end
77
+
78
+ # Updates an existing credit note.
79
+ def self.update(id, params = {}, opts = {})
80
+ request_stripe_object(
81
+ method: :post,
82
+ path: format("/v1/credit_notes/%<id>s", { id: CGI.escape(id) }),
83
+ params: params,
84
+ opts: opts
85
+ )
86
+ end
54
87
  end
55
88
  end
@@ -17,7 +17,6 @@ module Stripe
17
17
 
18
18
  nested_resource_class_methods :balance_transaction, operations: %i[create retrieve update list]
19
19
  nested_resource_class_methods :cash_balance_transaction, operations: %i[retrieve list]
20
- nested_resource_class_methods :entitlement, operations: %i[list]
21
20
  nested_resource_class_methods :tax_id, operations: %i[create retrieve delete list]
22
21
 
23
22
  # Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new
@@ -114,6 +113,36 @@ module Stripe
114
113
  alias detach_source delete_source
115
114
  end
116
115
 
116
+ # Creates a new customer object.
117
+ def self.create(params = {}, opts = {})
118
+ request_stripe_object(method: :post, path: "/v1/customers", params: params, opts: opts)
119
+ end
120
+
121
+ # Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer.
122
+ def self.delete(id, params = {}, opts = {})
123
+ request_stripe_object(
124
+ method: :delete,
125
+ path: format("/v1/customers/%<id>s", { id: CGI.escape(id) }),
126
+ params: params,
127
+ opts: opts
128
+ )
129
+ end
130
+
131
+ # Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer.
132
+ def delete(params = {}, opts = {})
133
+ request_stripe_object(
134
+ method: :delete,
135
+ path: format("/v1/customers/%<customer>s", { customer: CGI.escape(self["id"]) }),
136
+ params: params,
137
+ opts: opts
138
+ )
139
+ end
140
+
141
+ # Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first.
142
+ def self.list(filters = {}, opts = {})
143
+ request_stripe_object(method: :get, path: "/v1/customers", params: filters, opts: opts)
144
+ end
145
+
117
146
  def self.search(params = {}, opts = {})
118
147
  request_stripe_object(method: :get, path: "/v1/customers/search", params: params, opts: opts)
119
148
  end
@@ -122,6 +151,18 @@ module Stripe
122
151
  search(params, opts).auto_paging_each(&blk)
123
152
  end
124
153
 
154
+ # 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.
155
+ #
156
+ # This request accepts mostly the same arguments as the customer creation call.
157
+ def self.update(id, params = {}, opts = {})
158
+ request_stripe_object(
159
+ method: :post,
160
+ path: format("/v1/customers/%<id>s", { id: CGI.escape(id) }),
161
+ params: params,
162
+ opts: opts
163
+ )
164
+ end
165
+
125
166
  # Retrieves a customer's cash balance.
126
167
  def self.retrieve_cash_balance(customer, params = {}, opts = {})
127
168
  request_stripe_object(
@@ -142,16 +183,6 @@ module Stripe
142
183
  )
143
184
  end
144
185
 
145
- # Retrieve the entitlement summary for a customer
146
- def self.retrieve_entitlement_summary(customer, params = {}, opts = {})
147
- request_stripe_object(
148
- method: :get,
149
- path: format("/v1/customers/%<customer>s/entitlement_summary", { customer: CGI.escape(customer) }),
150
- params: params,
151
- opts: opts
152
- )
153
- end
154
-
155
186
  def test_helpers
156
187
  TestHelpers.new(self)
157
188
  end
@@ -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