stripe 10.11.0 → 10.12.0.pre.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +292 -48
  3. data/OPENAPI_VERSION +1 -1
  4. data/README.md +11 -0
  5. data/VERSION +1 -1
  6. data/lib/stripe/api_operations/request.rb +2 -1
  7. data/lib/stripe/api_version.rb +1 -0
  8. data/lib/stripe/object_types.rb +22 -0
  9. data/lib/stripe/request_signing_authenticator.rb +79 -0
  10. data/lib/stripe/resources/account.rb +69 -69
  11. data/lib/stripe/resources/account_notice.rb +32 -0
  12. data/lib/stripe/resources/apple_pay_domain.rb +4 -4
  13. data/lib/stripe/resources/apps/secret.rb +5 -5
  14. data/lib/stripe/resources/capital/financing_offer.rb +49 -0
  15. data/lib/stripe/resources/capital/financing_summary.rb +15 -0
  16. data/lib/stripe/resources/capital/financing_transaction.rb +27 -0
  17. data/lib/stripe/resources/checkout/session.rb +21 -21
  18. data/lib/stripe/resources/confirmation_token.rb +16 -0
  19. data/lib/stripe/resources/credit_note.rb +35 -35
  20. data/lib/stripe/resources/customer.rb +66 -55
  21. data/lib/stripe/resources/customer_entitlement.rb +12 -0
  22. data/lib/stripe/resources/customer_entitlement_summary.rb +12 -0
  23. data/lib/stripe/resources/entitlements/feature.rb +38 -0
  24. data/lib/stripe/resources/ephemeral_key.rb +9 -9
  25. data/lib/stripe/resources/file.rb +5 -5
  26. data/lib/stripe/resources/financial_connections/account.rb +37 -34
  27. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +14 -0
  28. data/lib/stripe/resources/gift_cards/card.rb +59 -0
  29. data/lib/stripe/resources/gift_cards/transaction.rb +93 -0
  30. data/lib/stripe/resources/identity/verification_session.rb +38 -38
  31. data/lib/stripe/resources/invoice.rb +113 -60
  32. data/lib/stripe/resources/invoice_payment.rb +12 -0
  33. data/lib/stripe/resources/issuing/authorization.rb +8 -8
  34. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +88 -0
  35. data/lib/stripe/resources/issuing/dispute.rb +16 -16
  36. data/lib/stripe/resources/issuing/personalization_design.rb +119 -0
  37. data/lib/stripe/resources/issuing/physical_bundle.rb +26 -0
  38. data/lib/stripe/resources/margin.rb +37 -0
  39. data/lib/stripe/resources/order.rb +120 -0
  40. data/lib/stripe/resources/payment_intent.rb +150 -100
  41. data/lib/stripe/resources/payment_link.rb +10 -10
  42. data/lib/stripe/resources/payment_method.rb +17 -17
  43. data/lib/stripe/resources/payment_method_domain.rb +29 -29
  44. data/lib/stripe/resources/payout.rb +22 -22
  45. data/lib/stripe/resources/quote.rb +136 -32
  46. data/lib/stripe/resources/quote_phase.rb +39 -0
  47. data/lib/stripe/resources/quote_preview_invoice.rb +43 -0
  48. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +11 -0
  49. data/lib/stripe/resources/setup_intent.rb +32 -32
  50. data/lib/stripe/resources/sigma/scheduled_query_run.rb +4 -4
  51. data/lib/stripe/resources/source.rb +17 -17
  52. data/lib/stripe/resources/subscription.rb +36 -36
  53. data/lib/stripe/resources/subscription_schedule.rb +31 -11
  54. data/lib/stripe/resources/tax/calculation.rb +10 -10
  55. data/lib/stripe/resources/tax/form.rb +49 -0
  56. data/lib/stripe/resources/tax/transaction.rb +10 -10
  57. data/lib/stripe/resources/terminal/reader.rb +101 -41
  58. data/lib/stripe/resources/treasury/financial_account.rb +25 -25
  59. data/lib/stripe/resources/treasury/transaction_entry.rb +4 -4
  60. data/lib/stripe/resources.rb +21 -0
  61. data/lib/stripe/stripe_client.rb +62 -28
  62. data/lib/stripe/stripe_configuration.rb +2 -1
  63. data/lib/stripe/util.rb +8 -1
  64. data/lib/stripe/version.rb +1 -1
  65. data/lib/stripe.rb +54 -0
  66. metadata +25 -3
@@ -16,6 +16,7 @@ module Stripe
16
16
  File.object_name_alt => File,
17
17
  Account.object_name => Account,
18
18
  AccountLink.object_name => AccountLink,
19
+ AccountNotice.object_name => AccountNotice,
19
20
  AccountSession.object_name => AccountSession,
20
21
  ApplePayDomain.object_name => ApplePayDomain,
21
22
  ApplicationFee.object_name => ApplicationFee,
@@ -27,6 +28,9 @@ module Stripe
27
28
  BillingPortal::Configuration.object_name => BillingPortal::Configuration,
28
29
  BillingPortal::Session.object_name => BillingPortal::Session,
29
30
  Capability.object_name => Capability,
31
+ Capital::FinancingOffer.object_name => Capital::FinancingOffer,
32
+ Capital::FinancingSummary.object_name => Capital::FinancingSummary,
33
+ Capital::FinancingTransaction.object_name => Capital::FinancingTransaction,
30
34
  Card.object_name => Card,
31
35
  CashBalance.object_name => CashBalance,
32
36
  Charge.object_name => Charge,
@@ -34,6 +38,7 @@ module Stripe
34
38
  Climate::Order.object_name => Climate::Order,
35
39
  Climate::Product.object_name => Climate::Product,
36
40
  Climate::Supplier.object_name => Climate::Supplier,
41
+ ConfirmationToken.object_name => ConfirmationToken,
37
42
  CountrySpec.object_name => CountrySpec,
38
43
  Coupon.object_name => Coupon,
39
44
  CreditNote.object_name => CreditNote,
@@ -41,35 +46,48 @@ module Stripe
41
46
  Customer.object_name => Customer,
42
47
  CustomerBalanceTransaction.object_name => CustomerBalanceTransaction,
43
48
  CustomerCashBalanceTransaction.object_name => CustomerCashBalanceTransaction,
49
+ CustomerEntitlement.object_name => CustomerEntitlement,
50
+ CustomerEntitlementSummary.object_name => CustomerEntitlementSummary,
44
51
  CustomerSession.object_name => CustomerSession,
45
52
  Discount.object_name => Discount,
46
53
  Dispute.object_name => Dispute,
54
+ Entitlements::Feature.object_name => Entitlements::Feature,
47
55
  EphemeralKey.object_name => EphemeralKey,
48
56
  Event.object_name => Event,
49
57
  ExchangeRate.object_name => ExchangeRate,
50
58
  File.object_name => File,
51
59
  FileLink.object_name => FileLink,
52
60
  FinancialConnections::Account.object_name => FinancialConnections::Account,
61
+ FinancialConnections::AccountInferredBalance.object_name =>
62
+ FinancialConnections::AccountInferredBalance,
53
63
  FinancialConnections::AccountOwner.object_name => FinancialConnections::AccountOwner,
54
64
  FinancialConnections::AccountOwnership.object_name =>
55
65
  FinancialConnections::AccountOwnership,
56
66
  FinancialConnections::Session.object_name => FinancialConnections::Session,
57
67
  FinancialConnections::Transaction.object_name => FinancialConnections::Transaction,
58
68
  FundingInstructions.object_name => FundingInstructions,
69
+ GiftCards::Card.object_name => GiftCards::Card,
70
+ GiftCards::Transaction.object_name => GiftCards::Transaction,
59
71
  Identity::VerificationReport.object_name => Identity::VerificationReport,
60
72
  Identity::VerificationSession.object_name => Identity::VerificationSession,
61
73
  Invoice.object_name => Invoice,
62
74
  InvoiceItem.object_name => InvoiceItem,
63
75
  InvoiceLineItem.object_name => InvoiceLineItem,
76
+ InvoicePayment.object_name => InvoicePayment,
64
77
  Issuing::Authorization.object_name => Issuing::Authorization,
65
78
  Issuing::Card.object_name => Issuing::Card,
66
79
  Issuing::Cardholder.object_name => Issuing::Cardholder,
80
+ Issuing::CreditUnderwritingRecord.object_name => Issuing::CreditUnderwritingRecord,
67
81
  Issuing::Dispute.object_name => Issuing::Dispute,
82
+ Issuing::PersonalizationDesign.object_name => Issuing::PersonalizationDesign,
83
+ Issuing::PhysicalBundle.object_name => Issuing::PhysicalBundle,
68
84
  Issuing::Token.object_name => Issuing::Token,
69
85
  Issuing::Transaction.object_name => Issuing::Transaction,
70
86
  LineItem.object_name => LineItem,
71
87
  LoginLink.object_name => LoginLink,
72
88
  Mandate.object_name => Mandate,
89
+ Margin.object_name => Margin,
90
+ Order.object_name => Order,
73
91
  PaymentIntent.object_name => PaymentIntent,
74
92
  PaymentLink.object_name => PaymentLink,
75
93
  PaymentMethod.object_name => PaymentMethod,
@@ -82,6 +100,9 @@ module Stripe
82
100
  Product.object_name => Product,
83
101
  PromotionCode.object_name => PromotionCode,
84
102
  Quote.object_name => Quote,
103
+ QuotePhase.object_name => QuotePhase,
104
+ QuotePreviewInvoice.object_name => QuotePreviewInvoice,
105
+ QuotePreviewSubscriptionSchedule.object_name => QuotePreviewSubscriptionSchedule,
85
106
  Radar::EarlyFraudWarning.object_name => Radar::EarlyFraudWarning,
86
107
  Radar::ValueList.object_name => Radar::ValueList,
87
108
  Radar::ValueListItem.object_name => Radar::ValueListItem,
@@ -101,6 +122,7 @@ module Stripe
101
122
  SubscriptionSchedule.object_name => SubscriptionSchedule,
102
123
  Tax::Calculation.object_name => Tax::Calculation,
103
124
  Tax::CalculationLineItem.object_name => Tax::CalculationLineItem,
125
+ Tax::Form.object_name => Tax::Form,
104
126
  Tax::Registration.object_name => Tax::Registration,
105
127
  Tax::Settings.object_name => Tax::Settings,
106
128
  Tax::Transaction.object_name => Tax::Transaction,
@@ -0,0 +1,79 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ class RequestSigningAuthenticator
5
+ AUTHORIZATION_HEADER_NAME = "Authorization"
6
+ CONTENT_TYPE_HEADER_NAME = "Content-Type"
7
+ STRIPE_CONTEXT_HEADER_NAME = "Stripe-Context"
8
+ STRIPE_ACCOUNT_HEADER_NAME = "Stripe-Account"
9
+ CONTENT_DIGEST_HEADER_NAME = "Content-Digest"
10
+ SIGNATURE_INPUT_HEADER_NAME = "Signature-Input"
11
+ SIGNATURE_HEADER_NAME = "Signature"
12
+
13
+ attr_reader :auth_token, :sign_lambda
14
+
15
+ def initialize(auth_token, sign_lambda)
16
+ raise ArgumentError, "auth_token must be a string" unless auth_token.is_a?(String)
17
+ raise ArgumentError, "sign_lambda must be a lambda" unless sign_lambda.is_a?(Proc)
18
+
19
+ @auth_token = auth_token
20
+ @sign_lambda = sign_lambda
21
+ end
22
+
23
+ def authenticate(method, headers, body)
24
+ covered_headers = [CONTENT_TYPE_HEADER_NAME,
25
+ CONTENT_DIGEST_HEADER_NAME,
26
+ STRIPE_CONTEXT_HEADER_NAME,
27
+ STRIPE_ACCOUNT_HEADER_NAME,
28
+ AUTHORIZATION_HEADER_NAME,]
29
+
30
+ headers[AUTHORIZATION_HEADER_NAME] = "STRIPE-V2-SIG #{auth_token}"
31
+
32
+ if method == :get
33
+ covered_headers -= [CONTENT_TYPE_HEADER_NAME,
34
+ CONTENT_DIGEST_HEADER_NAME,]
35
+ else
36
+ content = body || ""
37
+ headers[CONTENT_DIGEST_HEADER_NAME] =
38
+ %(sha-256=:#{content_digest(content)}:)
39
+ end
40
+
41
+ covered_headers_formatted = covered_headers
42
+ .map { |string| %("#{string.downcase}") }
43
+ .join(" ")
44
+
45
+ signature_input = "(#{covered_headers_formatted});created=#{created_time}"
46
+
47
+ inputs = covered_headers
48
+ .map { |header| %("#{header.downcase}": #{headers[header]}) }
49
+ .join("\n")
50
+
51
+ signature_base = %(#{inputs}\n"@signature-params": #{signature_input})
52
+ .encode(Encoding::UTF_8)
53
+
54
+ headers[SIGNATURE_INPUT_HEADER_NAME] = "sig1=#{signature_input}"
55
+
56
+ headers[SIGNATURE_HEADER_NAME] =
57
+ "sig1=:#{encoded_signature(signature_base)}:"
58
+ end
59
+
60
+ private def sign(signature_base)
61
+ @sign_lambda.call(signature_base)
62
+ end
63
+
64
+ private def encoded_signature(signature_base)
65
+ Base64.strict_encode64(sign(signature_base))
66
+ rescue StandardError
67
+ raise AuthenticationError, "Encountered '#{e.message} (#{e.class})' " \
68
+ "when calculating request signature."
69
+ end
70
+
71
+ private def content_digest(content)
72
+ Base64.strict_encode64(OpenSSL::Digest.new("SHA256").digest(content))
73
+ end
74
+
75
+ private def created_time
76
+ Time.now.to_i
77
+ end
78
+ end
79
+ end
@@ -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
@@ -0,0 +1,32 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ # A notice to a Connected account. Notice can be sent by Stripe on your behalf or you can opt to send the notices yourself.
6
+ #
7
+ # See the [guide to send notices](https://stripe.com/docs/issuing/compliance-us/issuing-regulated-customer-notices) to your connected accounts.
8
+ class AccountNotice < APIResource
9
+ extend Stripe::APIOperations::List
10
+ include Stripe::APIOperations::Save
11
+
12
+ OBJECT_NAME = "account_notice"
13
+ def self.object_name
14
+ "account_notice"
15
+ end
16
+
17
+ # Retrieves a list of AccountNotice 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(method: :get, path: "/v1/account_notices", params: filters, opts: opts)
20
+ end
21
+
22
+ # Updates an AccountNotice object.
23
+ def self.update(id, params = {}, opts = {})
24
+ request_stripe_object(
25
+ method: :post,
26
+ path: format("/v1/account_notices/%<id>s", { id: CGI.escape(id) }),
27
+ params: params,
28
+ opts: opts
29
+ )
30
+ end
31
+ end
32
+ 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)
@@ -0,0 +1,49 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Capital
6
+ # This is an object representing an offer of financing from
7
+ # Stripe Capital to a Connect subaccount.
8
+ class FinancingOffer < APIResource
9
+ extend Stripe::APIOperations::List
10
+
11
+ OBJECT_NAME = "capital.financing_offer"
12
+ def self.object_name
13
+ "capital.financing_offer"
14
+ end
15
+
16
+ # Retrieves the financing offers available for Connected accounts that belong to your platform.
17
+ def self.list(filters = {}, opts = {})
18
+ request_stripe_object(
19
+ method: :get,
20
+ path: "/v1/capital/financing_offers",
21
+ params: filters,
22
+ opts: opts
23
+ )
24
+ end
25
+
26
+ # Acknowledges that platform has received and delivered the financing_offer to
27
+ # the intended merchant recipient.
28
+ def mark_delivered(params = {}, opts = {})
29
+ request_stripe_object(
30
+ method: :post,
31
+ path: format("/v1/capital/financing_offers/%<financing_offer>s/mark_delivered", { financing_offer: CGI.escape(self["id"]) }),
32
+ params: params,
33
+ opts: opts
34
+ )
35
+ end
36
+
37
+ # Acknowledges that platform has received and delivered the financing_offer to
38
+ # the intended merchant recipient.
39
+ def self.mark_delivered(financing_offer, params = {}, opts = {})
40
+ request_stripe_object(
41
+ method: :post,
42
+ path: format("/v1/capital/financing_offers/%<financing_offer>s/mark_delivered", { financing_offer: CGI.escape(financing_offer) }),
43
+ params: params,
44
+ opts: opts
45
+ )
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,15 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Capital
6
+ # A financing object describes an account's current financing state. Used by Connect
7
+ # platforms to read the state of Capital offered to their connected accounts.
8
+ class FinancingSummary < SingletonAPIResource
9
+ OBJECT_NAME = "capital.financing_summary"
10
+ def self.object_name
11
+ "capital.financing_summary"
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,27 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Capital
6
+ # This is an object representing the details of a transaction on a Capital financing object.
7
+ class FinancingTransaction < APIResource
8
+ extend Stripe::APIOperations::List
9
+
10
+ OBJECT_NAME = "capital.financing_transaction"
11
+ def self.object_name
12
+ "capital.financing_transaction"
13
+ end
14
+
15
+ # Returns a list of financing transactions. The transactions are returned in sorted order,
16
+ # with the most recent transactions appearing first.
17
+ def self.list(filters = {}, opts = {})
18
+ request_stripe_object(
19
+ method: :get,
20
+ path: "/v1/capital/financing_transactions",
21
+ params: filters,
22
+ opts: opts
23
+ )
24
+ end
25
+ end
26
+ end
27
+ end
@@ -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
@@ -0,0 +1,16 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ # ConfirmationTokens help transport client side data collected by Stripe JS over
6
+ # to your server for confirming a PaymentIntent or SetupIntent. If the confirmation
7
+ # is successful, values present on the ConfirmationToken are written onto the Intent.
8
+ #
9
+ # To learn more or request access, visit the related guided: [Finalize payments on the server using Confirmation Tokens](https://stripe.com/docs/payments/finalize-payments-on-the-server-confirmation-tokens).
10
+ class ConfirmationToken < APIResource
11
+ OBJECT_NAME = "confirmation_token"
12
+ def self.object_name
13
+ "confirmation_token"
14
+ end
15
+ end
16
+ end