stripe 10.1.0 → 12.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +215 -21
  3. data/Gemfile +6 -5
  4. data/Makefile +8 -1
  5. data/OPENAPI_VERSION +1 -1
  6. data/README.md +46 -14
  7. data/Rakefile +7 -5
  8. data/VERSION +1 -1
  9. data/{bin → exe}/stripe-console +1 -1
  10. data/lib/stripe/api_operations/nested_resource.rb +22 -2
  11. data/lib/stripe/api_operations/request.rb +22 -18
  12. data/lib/stripe/api_operations/save.rb +7 -9
  13. data/lib/stripe/api_operations/search.rb +5 -0
  14. data/lib/stripe/api_operations/singleton_save.rb +86 -0
  15. data/lib/stripe/api_resource.rb +13 -4
  16. data/lib/stripe/api_resource_test_helpers.rb +7 -3
  17. data/lib/stripe/api_version.rb +1 -1
  18. data/lib/stripe/connection_manager.rb +4 -6
  19. data/lib/stripe/errors.rb +3 -11
  20. data/lib/stripe/instrumentation.rb +5 -21
  21. data/lib/stripe/list_object.rb +3 -0
  22. data/lib/stripe/multipart_encoder.rb +7 -7
  23. data/lib/stripe/oauth.rb +6 -6
  24. data/lib/stripe/object_types.rb +135 -116
  25. data/lib/stripe/resources/account.rb +103 -25
  26. data/lib/stripe/resources/account_link.rb +8 -0
  27. data/lib/stripe/resources/account_session.rb +8 -0
  28. data/lib/stripe/resources/alipay_account.rb +1 -1
  29. data/lib/stripe/resources/apple_pay_domain.rb +43 -0
  30. data/lib/stripe/resources/application_fee.rb +8 -0
  31. data/lib/stripe/resources/application_fee_refund.rb +4 -2
  32. data/lib/stripe/resources/apps/secret.rb +15 -0
  33. data/lib/stripe/resources/balance.rb +3 -0
  34. data/lib/stripe/resources/balance_transaction.rb +15 -0
  35. data/lib/stripe/resources/bank_account.rb +49 -7
  36. data/lib/stripe/resources/billing/alert.rb +87 -0
  37. data/lib/stripe/resources/billing/meter.rb +83 -0
  38. data/lib/stripe/resources/billing/meter_event.rb +27 -0
  39. data/lib/stripe/resources/billing/meter_event_adjustment.rb +26 -0
  40. data/lib/stripe/resources/billing/meter_event_summary.rb +15 -0
  41. data/lib/stripe/resources/billing_portal/configuration.rb +33 -0
  42. data/lib/stripe/resources/billing_portal/session.rb +14 -1
  43. data/lib/stripe/resources/capability.rb +4 -2
  44. data/lib/stripe/resources/card.rb +28 -0
  45. data/lib/stripe/resources/cash_balance.rb +3 -0
  46. data/lib/stripe/resources/charge.rb +39 -1
  47. data/lib/stripe/resources/checkout/session.rb +47 -5
  48. data/lib/stripe/resources/climate/order.rb +67 -0
  49. data/lib/stripe/resources/climate/product.rb +27 -0
  50. data/lib/stripe/resources/climate/supplier.rb +26 -0
  51. data/lib/stripe/resources/confirmation_token.rb +39 -0
  52. data/lib/stripe/resources/country_spec.rb +8 -0
  53. data/lib/stripe/resources/coupon.rb +45 -0
  54. data/lib/stripe/resources/credit_note.rb +47 -7
  55. data/lib/stripe/resources/credit_note_line_item.rb +3 -0
  56. data/lib/stripe/resources/customer.rb +89 -26
  57. data/lib/stripe/resources/customer_balance_transaction.rb +3 -1
  58. data/lib/stripe/resources/customer_cash_balance_transaction.rb +3 -2
  59. data/lib/stripe/resources/customer_session.rb +29 -0
  60. data/lib/stripe/resources/discount.rb +3 -0
  61. data/lib/stripe/resources/dispute.rb +26 -0
  62. data/lib/stripe/resources/entitlements/active_entitlement.rb +26 -0
  63. data/lib/stripe/resources/entitlements/feature.rb +49 -0
  64. data/lib/stripe/resources/ephemeral_key.rb +23 -0
  65. data/lib/stripe/resources/event.rb +11 -3
  66. data/lib/stripe/resources/exchange_rate.rb +8 -0
  67. data/lib/stripe/resources/file.rb +29 -16
  68. data/lib/stripe/resources/file_link.rb +23 -0
  69. data/lib/stripe/resources/financial_connections/account.rb +66 -7
  70. data/lib/stripe/resources/financial_connections/account_owner.rb +3 -0
  71. data/lib/stripe/resources/financial_connections/account_ownership.rb +3 -0
  72. data/lib/stripe/resources/financial_connections/session.rb +13 -0
  73. data/lib/stripe/resources/financial_connections/transaction.rb +26 -0
  74. data/lib/stripe/resources/forwarding/request.rb +52 -0
  75. data/lib/stripe/resources/funding_instructions.rb +3 -0
  76. data/lib/stripe/resources/identity/verification_report.rb +14 -1
  77. data/lib/stripe/resources/identity/verification_session.rb +90 -4
  78. data/lib/stripe/resources/invoice.rb +170 -17
  79. data/lib/stripe/resources/invoice_item.rb +43 -0
  80. data/lib/stripe/resources/invoice_line_item.rb +21 -0
  81. data/lib/stripe/resources/invoice_rendering_template.rb +63 -0
  82. data/lib/stripe/resources/issuing/authorization.rb +88 -14
  83. data/lib/stripe/resources/issuing/card.rb +50 -16
  84. data/lib/stripe/resources/issuing/cardholder.rb +33 -0
  85. data/lib/stripe/resources/issuing/dispute.rb +35 -0
  86. data/lib/stripe/resources/issuing/personalization_design.rb +119 -0
  87. data/lib/stripe/resources/issuing/physical_bundle.rb +26 -0
  88. data/lib/stripe/resources/issuing/token.rb +18 -0
  89. data/lib/stripe/resources/issuing/transaction.rb +30 -0
  90. data/lib/stripe/resources/line_item.rb +3 -0
  91. data/lib/stripe/resources/login_link.rb +4 -1
  92. data/lib/stripe/resources/mandate.rb +3 -0
  93. data/lib/stripe/resources/payment_intent.rb +190 -25
  94. data/lib/stripe/resources/payment_link.rb +25 -0
  95. data/lib/stripe/resources/payment_method.rb +57 -4
  96. data/lib/stripe/resources/payment_method_configuration.rb +33 -0
  97. data/lib/stripe/resources/payment_method_domain.rb +46 -1
  98. data/lib/stripe/resources/payout.rb +39 -4
  99. data/lib/stripe/resources/person.rb +5 -4
  100. data/lib/stripe/resources/plan.rb +43 -0
  101. data/lib/stripe/resources/price.rb +24 -1
  102. data/lib/stripe/resources/product.rb +47 -1
  103. data/lib/stripe/resources/product_feature.rb +13 -0
  104. data/lib/stripe/resources/promotion_code.rb +23 -0
  105. data/lib/stripe/resources/quote.rb +67 -32
  106. data/lib/stripe/resources/radar/early_fraud_warning.rb +13 -0
  107. data/lib/stripe/resources/radar/value_list.rb +53 -0
  108. data/lib/stripe/resources/radar/value_list_item.rb +43 -0
  109. data/lib/stripe/resources/refund.rb +46 -0
  110. data/lib/stripe/resources/reporting/report_run.rb +23 -0
  111. data/lib/stripe/resources/reporting/report_type.rb +13 -0
  112. data/lib/stripe/resources/reversal.rb +5 -3
  113. data/lib/stripe/resources/review.rb +10 -0
  114. data/lib/stripe/resources/setup_attempt.rb +8 -0
  115. data/lib/stripe/resources/setup_intent.rb +72 -10
  116. data/lib/stripe/resources/shipping_rate.rb +23 -0
  117. data/lib/stripe/resources/sigma/scheduled_query_run.rb +13 -0
  118. data/lib/stripe/resources/source.rb +23 -1
  119. data/lib/stripe/resources/source_transaction.rb +3 -0
  120. data/lib/stripe/resources/subscription.rb +81 -13
  121. data/lib/stripe/resources/subscription_item.rb +54 -1
  122. data/lib/stripe/resources/subscription_schedule.rb +41 -4
  123. data/lib/stripe/resources/tax/calculation.rb +15 -0
  124. data/lib/stripe/resources/tax/calculation_line_item.rb +3 -0
  125. data/lib/stripe/resources/tax/registration.rb +35 -0
  126. data/lib/stripe/resources/tax/settings.rb +4 -2
  127. data/lib/stripe/resources/tax/transaction.rb +15 -8
  128. data/lib/stripe/resources/tax/transaction_line_item.rb +3 -0
  129. data/lib/stripe/resources/tax_code.rb +8 -0
  130. data/lib/stripe/resources/tax_id.rb +30 -12
  131. data/lib/stripe/resources/tax_rate.rb +23 -0
  132. data/lib/stripe/resources/terminal/configuration.rb +53 -0
  133. data/lib/stripe/resources/terminal/connection_token.rb +13 -0
  134. data/lib/stripe/resources/terminal/location.rb +54 -0
  135. data/lib/stripe/resources/terminal/reader.rb +80 -12
  136. data/lib/stripe/resources/test_helpers/test_clock.rb +45 -0
  137. data/lib/stripe/resources/token.rb +10 -1
  138. data/lib/stripe/resources/topup.rb +25 -0
  139. data/lib/stripe/resources/transfer.rb +26 -1
  140. data/lib/stripe/resources/treasury/credit_reversal.rb +23 -0
  141. data/lib/stripe/resources/treasury/debit_reversal.rb +23 -0
  142. data/lib/stripe/resources/treasury/financial_account.rb +42 -5
  143. data/lib/stripe/resources/treasury/financial_account_features.rb +3 -0
  144. data/lib/stripe/resources/treasury/inbound_transfer.rb +47 -11
  145. data/lib/stripe/resources/treasury/outbound_payment.rb +64 -8
  146. data/lib/stripe/resources/treasury/outbound_transfer.rb +64 -8
  147. data/lib/stripe/resources/treasury/received_credit.rb +17 -0
  148. data/lib/stripe/resources/treasury/received_debit.rb +17 -0
  149. data/lib/stripe/resources/treasury/transaction.rb +13 -0
  150. data/lib/stripe/resources/treasury/transaction_entry.rb +13 -0
  151. data/lib/stripe/resources/usage_record.rb +5 -0
  152. data/lib/stripe/resources/usage_record_summary.rb +3 -0
  153. data/lib/stripe/resources/webhook_endpoint.rb +55 -2
  154. data/lib/stripe/resources.rb +18 -0
  155. data/lib/stripe/search_result_object.rb +4 -1
  156. data/lib/stripe/singleton_api_resource.rb +20 -3
  157. data/lib/stripe/stripe_client.rb +61 -63
  158. data/lib/stripe/stripe_configuration.rb +13 -29
  159. data/lib/stripe/stripe_object.rb +23 -21
  160. data/lib/stripe/stripe_response.rb +1 -3
  161. data/lib/stripe/util.rb +13 -15
  162. data/lib/stripe/version.rb +1 -1
  163. data/lib/stripe.rb +26 -0
  164. data/stripe.gemspec +7 -4
  165. metadata +25 -5
@@ -0,0 +1,26 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Entitlements
6
+ # An active entitlement describes access to a feature for a customer.
7
+ class ActiveEntitlement < APIResource
8
+ extend Stripe::APIOperations::List
9
+
10
+ OBJECT_NAME = "entitlements.active_entitlement"
11
+ def self.object_name
12
+ "entitlements.active_entitlement"
13
+ end
14
+
15
+ # Retrieve a list of active entitlements for a customer
16
+ def self.list(filters = {}, opts = {})
17
+ request_stripe_object(
18
+ method: :get,
19
+ path: "/v1/entitlements/active_entitlements",
20
+ params: filters,
21
+ opts: opts
22
+ )
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,49 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Entitlements
6
+ # A feature represents a monetizable ability or functionality in your system.
7
+ # Features can be assigned to products, and when those products are purchased, Stripe will create an entitlement to the feature for the purchasing customer.
8
+ class Feature < APIResource
9
+ extend Stripe::APIOperations::Create
10
+ extend Stripe::APIOperations::List
11
+ include Stripe::APIOperations::Save
12
+
13
+ OBJECT_NAME = "entitlements.feature"
14
+ def self.object_name
15
+ "entitlements.feature"
16
+ end
17
+
18
+ # Creates a feature
19
+ def self.create(params = {}, opts = {})
20
+ request_stripe_object(
21
+ method: :post,
22
+ path: "/v1/entitlements/features",
23
+ params: params,
24
+ opts: opts
25
+ )
26
+ end
27
+
28
+ # Retrieve a list of features
29
+ def self.list(filters = {}, opts = {})
30
+ request_stripe_object(
31
+ method: :get,
32
+ path: "/v1/entitlements/features",
33
+ params: filters,
34
+ opts: opts
35
+ )
36
+ end
37
+
38
+ # Update a feature's metadata or permanently deactivate it.
39
+ def self.update(id, params = {}, opts = {})
40
+ request_stripe_object(
41
+ method: :post,
42
+ path: format("/v1/entitlements/features/%<id>s", { id: CGI.escape(id) }),
43
+ params: params,
44
+ opts: opts
45
+ )
46
+ end
47
+ end
48
+ end
49
+ end
@@ -7,6 +7,29 @@ module Stripe
7
7
  include Stripe::APIOperations::Delete
8
8
 
9
9
  OBJECT_NAME = "ephemeral_key"
10
+ def self.object_name
11
+ "ephemeral_key"
12
+ end
13
+
14
+ # Invalidates a short-lived API key for a given resource.
15
+ def self.delete(id, params = {}, opts = {})
16
+ request_stripe_object(
17
+ method: :delete,
18
+ path: format("/v1/ephemeral_keys/%<id>s", { id: CGI.escape(id) }),
19
+ params: params,
20
+ opts: opts
21
+ )
22
+ end
23
+
24
+ # Invalidates a short-lived API key for a given resource.
25
+ def delete(params = {}, opts = {})
26
+ request_stripe_object(
27
+ method: :delete,
28
+ path: format("/v1/ephemeral_keys/%<key>s", { key: CGI.escape(self["id"]) }),
29
+ params: params,
30
+ opts: opts
31
+ )
32
+ end
10
33
 
11
34
  def self.create(params = {}, opts = {})
12
35
  opts = Util.normalize_opts(opts)
@@ -23,10 +23,10 @@ module Stripe
23
23
  # `Event` objects directly to an endpoint on your server. You can manage
24
24
  # webhooks in your
25
25
  # [account settings](https://dashboard.stripe.com/account/webhooks). Learn how
26
- # to [listen for events]
27
- # (/docs/webhooks) so that your integration can automatically trigger reactions.
26
+ # to [listen for events](https://docs.stripe.com/webhooks)
27
+ # so that your integration can automatically trigger reactions.
28
28
  #
29
- # When using [Connect](https://stripe.com/docs/connect), you can also receive event notifications
29
+ # When using [Connect](https://docs.stripe.com/connect), you can also receive event notifications
30
30
  # that occur in connected accounts. For these events, there's an
31
31
  # additional `account` attribute in the received `Event` object.
32
32
  #
@@ -36,5 +36,13 @@ module Stripe
36
36
  extend Stripe::APIOperations::List
37
37
 
38
38
  OBJECT_NAME = "event"
39
+ def self.object_name
40
+ "event"
41
+ end
42
+
43
+ # List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://docs.stripe.com/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header).
44
+ def self.list(filters = {}, opts = {})
45
+ request_stripe_object(method: :get, path: "/v1/events", params: filters, opts: opts)
46
+ end
39
47
  end
40
48
  end
@@ -32,5 +32,13 @@ module Stripe
32
32
  extend Stripe::APIOperations::List
33
33
 
34
34
  OBJECT_NAME = "exchange_rate"
35
+ def self.object_name
36
+ "exchange_rate"
37
+ end
38
+
39
+ # Returns a list of objects that contain the rates at which foreign currencies are converted to one another. Only shows the currencies for which Stripe supports.
40
+ def self.list(filters = {}, opts = {})
41
+ request_stripe_object(method: :get, path: "/v1/exchange_rates", params: filters, opts: opts)
42
+ end
35
43
  end
36
44
  end
@@ -5,7 +5,7 @@ module Stripe
5
5
  # This object represents files hosted on Stripe's servers. You can upload
6
6
  # files with the [create file](https://stripe.com/docs/api#create_file) request
7
7
  # (for example, when uploading dispute evidence). Stripe also
8
- # creates files independetly (for example, the results of a [Sigma scheduled
8
+ # creates files independently (for example, the results of a [Sigma scheduled
9
9
  # query](https://stripe.com/docs/api#scheduled_queries)).
10
10
  #
11
11
  # Related guide: [File upload guide](https://stripe.com/docs/file-upload)
@@ -14,30 +14,43 @@ module Stripe
14
14
  extend Stripe::APIOperations::List
15
15
 
16
16
  OBJECT_NAME = "file"
17
+ def self.object_name
18
+ "file"
19
+ end
20
+
21
+ # To upload a file to Stripe, you need to send a request of type multipart/form-data. Include the file you want to upload in the request, and the parameters for creating a file.
22
+ #
23
+ # All of Stripe's officially supported Client libraries support sending multipart/form-data.
24
+ def self.create(params = {}, opts = {})
25
+ config = opts[:client]&.config || Stripe.config
26
+ upload_base = config.uploads_base
27
+ opts = { api_base: upload_base }.merge(Util.normalize_opts(opts))
28
+
29
+ if params[:file] && !params[:file].is_a?(String) && !params[:file].respond_to?(:read)
30
+ raise ArgumentError, "file must respond to `#read`"
31
+ end
32
+
33
+ opts = { content_type: MultipartEncoder::MULTIPART_FORM_DATA }.merge(Util.normalize_opts(opts))
34
+
35
+ request_stripe_object(method: :post, path: "/v1/files", params: params, opts: opts)
36
+ end
37
+
38
+ # Returns a list of the files that your account has access to. Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top.
39
+ def self.list(filters = {}, opts = {})
40
+ request_stripe_object(method: :get, path: "/v1/files", params: filters, opts: opts)
41
+ end
17
42
 
18
43
  # This resource can have two different object names. In latter API
19
44
  # versions, only `file` is used, but since stripe-ruby may be used with
20
45
  # any API version, we need to support deserializing the older
21
46
  # `file_upload` object into the same class.
22
47
  OBJECT_NAME_ALT = "file_upload"
48
+ def self.object_name_alt
49
+ "file_upload"
50
+ end
23
51
 
24
52
  def self.resource_url
25
53
  "/v1/files"
26
54
  end
27
-
28
- def self.create(params = {}, opts = {})
29
- if params[:file] && !params[:file].is_a?(String)
30
- unless params[:file].respond_to?(:read)
31
- raise ArgumentError, "file must respond to `#read`"
32
- end
33
- end
34
-
35
- config = opts[:client]&.config || Stripe.config
36
- opts = {
37
- api_base: config.uploads_base,
38
- content_type: MultipartEncoder::MULTIPART_FORM_DATA,
39
- }.merge(Util.normalize_opts(opts))
40
- super
41
- end
42
55
  end
43
56
  end
@@ -11,5 +11,28 @@ module Stripe
11
11
  include Stripe::APIOperations::Save
12
12
 
13
13
  OBJECT_NAME = "file_link"
14
+ def self.object_name
15
+ "file_link"
16
+ end
17
+
18
+ # Creates a new file link object.
19
+ def self.create(params = {}, opts = {})
20
+ request_stripe_object(method: :post, path: "/v1/file_links", params: params, opts: opts)
21
+ end
22
+
23
+ # Returns a list of file links.
24
+ def self.list(filters = {}, opts = {})
25
+ request_stripe_object(method: :get, path: "/v1/file_links", params: filters, opts: opts)
26
+ end
27
+
28
+ # Updates an existing file link object. Expired links can no longer be updated.
29
+ def self.update(id, params = {}, opts = {})
30
+ request_stripe_object(
31
+ method: :post,
32
+ path: format("/v1/file_links/%<id>s", { id: CGI.escape(id) }),
33
+ params: params,
34
+ opts: opts
35
+ )
36
+ end
14
37
  end
15
38
  end
@@ -8,7 +8,11 @@ module Stripe
8
8
  extend Stripe::APIOperations::List
9
9
 
10
10
  OBJECT_NAME = "financial_connections.account"
11
+ def self.object_name
12
+ "financial_connections.account"
13
+ end
11
14
 
15
+ # Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions).
12
16
  def disconnect(params = {}, opts = {})
13
17
  request_stripe_object(
14
18
  method: :post,
@@ -18,6 +22,27 @@ module Stripe
18
22
  )
19
23
  end
20
24
 
25
+ # Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions).
26
+ def self.disconnect(account, params = {}, opts = {})
27
+ request_stripe_object(
28
+ method: :post,
29
+ path: format("/v1/financial_connections/accounts/%<account>s/disconnect", { account: CGI.escape(account) }),
30
+ params: params,
31
+ opts: opts
32
+ )
33
+ end
34
+
35
+ # Returns a list of Financial Connections Account objects.
36
+ def self.list(filters = {}, opts = {})
37
+ request_stripe_object(
38
+ method: :get,
39
+ path: "/v1/financial_connections/accounts",
40
+ params: filters,
41
+ opts: opts
42
+ )
43
+ end
44
+
45
+ # Lists all owners for a given Account
21
46
  def list_owners(params = {}, opts = {})
22
47
  request_stripe_object(
23
48
  method: :get,
@@ -27,6 +52,17 @@ module Stripe
27
52
  )
28
53
  end
29
54
 
55
+ # Lists all owners for a given Account
56
+ def self.list_owners(account, params = {}, opts = {})
57
+ request_stripe_object(
58
+ method: :get,
59
+ path: format("/v1/financial_connections/accounts/%<account>s/owners", { account: CGI.escape(account) }),
60
+ params: params,
61
+ opts: opts
62
+ )
63
+ end
64
+
65
+ # Refreshes the data associated with a Financial Connections Account.
30
66
  def refresh_account(params = {}, opts = {})
31
67
  request_stripe_object(
32
68
  method: :post,
@@ -36,28 +72,51 @@ module Stripe
36
72
  )
37
73
  end
38
74
 
39
- def self.disconnect(account, params = {}, opts = {})
75
+ # Refreshes the data associated with a Financial Connections Account.
76
+ def self.refresh_account(account, params = {}, opts = {})
40
77
  request_stripe_object(
41
78
  method: :post,
42
- path: format("/v1/financial_connections/accounts/%<account>s/disconnect", { account: CGI.escape(account) }),
79
+ path: format("/v1/financial_connections/accounts/%<account>s/refresh", { account: CGI.escape(account) }),
43
80
  params: params,
44
81
  opts: opts
45
82
  )
46
83
  end
47
84
 
48
- def self.list_owners(account, params = {}, opts = {})
85
+ # Subscribes to periodic refreshes of data associated with a Financial Connections Account.
86
+ def subscribe(params = {}, opts = {})
49
87
  request_stripe_object(
50
- method: :get,
51
- path: format("/v1/financial_connections/accounts/%<account>s/owners", { account: CGI.escape(account) }),
88
+ method: :post,
89
+ path: format("/v1/financial_connections/accounts/%<account>s/subscribe", { account: CGI.escape(self["id"]) }),
52
90
  params: params,
53
91
  opts: opts
54
92
  )
55
93
  end
56
94
 
57
- def self.refresh_account(account, params = {}, opts = {})
95
+ # Subscribes to periodic refreshes of data associated with a Financial Connections Account.
96
+ def self.subscribe(account, params = {}, opts = {})
58
97
  request_stripe_object(
59
98
  method: :post,
60
- path: format("/v1/financial_connections/accounts/%<account>s/refresh", { account: CGI.escape(account) }),
99
+ path: format("/v1/financial_connections/accounts/%<account>s/subscribe", { account: CGI.escape(account) }),
100
+ params: params,
101
+ opts: opts
102
+ )
103
+ end
104
+
105
+ # Unsubscribes from periodic refreshes of data associated with a Financial Connections Account.
106
+ def unsubscribe(params = {}, opts = {})
107
+ request_stripe_object(
108
+ method: :post,
109
+ path: format("/v1/financial_connections/accounts/%<account>s/unsubscribe", { account: CGI.escape(self["id"]) }),
110
+ params: params,
111
+ opts: opts
112
+ )
113
+ end
114
+
115
+ # Unsubscribes from periodic refreshes of data associated with a Financial Connections Account.
116
+ def self.unsubscribe(account, params = {}, opts = {})
117
+ request_stripe_object(
118
+ method: :post,
119
+ path: format("/v1/financial_connections/accounts/%<account>s/unsubscribe", { account: CGI.escape(account) }),
61
120
  params: params,
62
121
  opts: opts
63
122
  )
@@ -6,6 +6,9 @@ module Stripe
6
6
  # Describes an owner of an account.
7
7
  class AccountOwner < StripeObject
8
8
  OBJECT_NAME = "financial_connections.account_owner"
9
+ def self.object_name
10
+ "financial_connections.account_owner"
11
+ end
9
12
  end
10
13
  end
11
14
  end
@@ -6,6 +6,9 @@ module Stripe
6
6
  # Describes a snapshot of the owners of an account at a particular point in time.
7
7
  class AccountOwnership < StripeObject
8
8
  OBJECT_NAME = "financial_connections.account_ownership"
9
+ def self.object_name
10
+ "financial_connections.account_ownership"
11
+ end
9
12
  end
10
13
  end
11
14
  end
@@ -8,6 +8,19 @@ module Stripe
8
8
  extend Stripe::APIOperations::Create
9
9
 
10
10
  OBJECT_NAME = "financial_connections.session"
11
+ def self.object_name
12
+ "financial_connections.session"
13
+ end
14
+
15
+ # To launch the Financial Connections authorization flow, create a Session. The session's client_secret can be used to launch the flow using Stripe.js.
16
+ def self.create(params = {}, opts = {})
17
+ request_stripe_object(
18
+ method: :post,
19
+ path: "/v1/financial_connections/sessions",
20
+ params: params,
21
+ opts: opts
22
+ )
23
+ end
11
24
  end
12
25
  end
13
26
  end
@@ -0,0 +1,26 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module FinancialConnections
6
+ # A Transaction represents a real transaction that affects a Financial Connections Account balance.
7
+ class Transaction < APIResource
8
+ extend Stripe::APIOperations::List
9
+
10
+ OBJECT_NAME = "financial_connections.transaction"
11
+ def self.object_name
12
+ "financial_connections.transaction"
13
+ end
14
+
15
+ # Returns a list of Financial Connections Transaction objects.
16
+ def self.list(filters = {}, opts = {})
17
+ request_stripe_object(
18
+ method: :get,
19
+ path: "/v1/financial_connections/transactions",
20
+ params: filters,
21
+ opts: opts
22
+ )
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,52 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Forwarding
6
+ # Instructs Stripe to make a request on your behalf using the destination URL. The destination URL
7
+ # is activated by Stripe at the time of onboarding. Stripe verifies requests with your credentials
8
+ # provided during onboarding, and injects card details from the payment_method into the request.
9
+ #
10
+ # Stripe redacts all sensitive fields and headers, including authentication credentials and card numbers,
11
+ # before storing the request and response data in the forwarding Request object, which are subject to a
12
+ # 30-day retention period.
13
+ #
14
+ # You can provide a Stripe idempotency key to make sure that requests with the same key result in only one
15
+ # outbound request. The Stripe idempotency key provided should be unique and different from any idempotency
16
+ # keys provided on the underlying third-party request.
17
+ #
18
+ # Forwarding Requests are synchronous requests that return a response or time out according to
19
+ # Stripe's limits.
20
+ #
21
+ # Related guide: [Forward card details to third-party API endpoints](https://docs.stripe.com/payments/forwarding).
22
+ class Request < APIResource
23
+ extend Stripe::APIOperations::Create
24
+ extend Stripe::APIOperations::List
25
+
26
+ OBJECT_NAME = "forwarding.request"
27
+ def self.object_name
28
+ "forwarding.request"
29
+ end
30
+
31
+ # Creates a ForwardingRequest object.
32
+ def self.create(params = {}, opts = {})
33
+ request_stripe_object(
34
+ method: :post,
35
+ path: "/v1/forwarding/requests",
36
+ params: params,
37
+ opts: opts
38
+ )
39
+ end
40
+
41
+ # Lists all ForwardingRequest objects.
42
+ def self.list(filters = {}, opts = {})
43
+ request_stripe_object(
44
+ method: :get,
45
+ path: "/v1/forwarding/requests",
46
+ params: filters,
47
+ opts: opts
48
+ )
49
+ end
50
+ end
51
+ end
52
+ end
@@ -9,6 +9,9 @@ module Stripe
9
9
  # Related guide: [Customer balance funding instructions](https://stripe.com/docs/payments/customer-balance/funding-instructions)
10
10
  class FundingInstructions < APIResource
11
11
  OBJECT_NAME = "funding_instructions"
12
+ def self.object_name
13
+ "funding_instructions"
14
+ end
12
15
 
13
16
  def resource_url
14
17
  if !respond_to?(:customer) || customer.nil?
@@ -13,11 +13,24 @@ module Stripe
13
13
  # API. To configure and create VerificationReports, use the
14
14
  # [VerificationSession](https://stripe.com/docs/api/identity/verification_sessions) API.
15
15
  #
16
- # Related guides: [Accessing verification results](https://stripe.com/docs/identity/verification-sessions#results).
16
+ # Related guide: [Accessing verification results](https://stripe.com/docs/identity/verification-sessions#results).
17
17
  class VerificationReport < APIResource
18
18
  extend Stripe::APIOperations::List
19
19
 
20
20
  OBJECT_NAME = "identity.verification_report"
21
+ def self.object_name
22
+ "identity.verification_report"
23
+ end
24
+
25
+ # List all verification reports.
26
+ def self.list(filters = {}, opts = {})
27
+ request_stripe_object(
28
+ method: :get,
29
+ path: "/v1/identity/verification_reports",
30
+ params: filters,
31
+ opts: opts
32
+ )
33
+ end
21
34
  end
22
35
  end
23
36
  end
@@ -20,7 +20,13 @@ module Stripe
20
20
  include Stripe::APIOperations::Save
21
21
 
22
22
  OBJECT_NAME = "identity.verification_session"
23
+ def self.object_name
24
+ "identity.verification_session"
25
+ end
23
26
 
27
+ # A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work).
28
+ #
29
+ # Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel).
24
30
  def cancel(params = {}, opts = {})
25
31
  request_stripe_object(
26
32
  method: :post,
@@ -30,24 +36,91 @@ module Stripe
30
36
  )
31
37
  end
32
38
 
33
- def redact(params = {}, opts = {})
39
+ # A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work).
40
+ #
41
+ # Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel).
42
+ def self.cancel(session, params = {}, opts = {})
34
43
  request_stripe_object(
35
44
  method: :post,
36
- path: format("/v1/identity/verification_sessions/%<session>s/redact", { session: CGI.escape(self["id"]) }),
45
+ path: format("/v1/identity/verification_sessions/%<session>s/cancel", { session: CGI.escape(session) }),
37
46
  params: params,
38
47
  opts: opts
39
48
  )
40
49
  end
41
50
 
42
- def self.cancel(session, params = {}, opts = {})
51
+ # Creates a VerificationSession object.
52
+ #
53
+ # After the VerificationSession is created, display a verification modal using the session client_secret or send your users to the session's url.
54
+ #
55
+ # If your API key is in test mode, verification checks won't actually process, though everything else will occur as if in live mode.
56
+ #
57
+ # Related guide: [Verify your users' identity documents](https://stripe.com/docs/identity/verify-identity-documents)
58
+ def self.create(params = {}, opts = {})
43
59
  request_stripe_object(
44
60
  method: :post,
45
- path: format("/v1/identity/verification_sessions/%<session>s/cancel", { session: CGI.escape(session) }),
61
+ path: "/v1/identity/verification_sessions",
62
+ params: params,
63
+ opts: opts
64
+ )
65
+ end
66
+
67
+ # Returns a list of VerificationSessions
68
+ def self.list(filters = {}, opts = {})
69
+ request_stripe_object(
70
+ method: :get,
71
+ path: "/v1/identity/verification_sessions",
72
+ params: filters,
73
+ opts: opts
74
+ )
75
+ end
76
+
77
+ # Redact a VerificationSession to remove all collected information from Stripe. This will redact
78
+ # the VerificationSession and all objects related to it, including VerificationReports, Events,
79
+ # request logs, etc.
80
+ #
81
+ # A VerificationSession object can be redacted when it is in requires_input or verified
82
+ # [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action
83
+ # state will automatically cancel it.
84
+ #
85
+ # The redaction process may take up to four days. When the redaction process is in progress, the
86
+ # VerificationSession's redaction.status field will be set to processing; when the process is
87
+ # finished, it will change to redacted and an identity.verification_session.redacted event
88
+ # will be emitted.
89
+ #
90
+ # Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the
91
+ # fields that contain personal data will be replaced by the string [redacted] or a similar
92
+ # placeholder. The metadata field will also be erased. Redacted objects cannot be updated or
93
+ # used for any purpose.
94
+ #
95
+ # [Learn more](https://stripe.com/docs/identity/verification-sessions#redact).
96
+ def redact(params = {}, opts = {})
97
+ request_stripe_object(
98
+ method: :post,
99
+ path: format("/v1/identity/verification_sessions/%<session>s/redact", { session: CGI.escape(self["id"]) }),
46
100
  params: params,
47
101
  opts: opts
48
102
  )
49
103
  end
50
104
 
105
+ # Redact a VerificationSession to remove all collected information from Stripe. This will redact
106
+ # the VerificationSession and all objects related to it, including VerificationReports, Events,
107
+ # request logs, etc.
108
+ #
109
+ # A VerificationSession object can be redacted when it is in requires_input or verified
110
+ # [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action
111
+ # state will automatically cancel it.
112
+ #
113
+ # The redaction process may take up to four days. When the redaction process is in progress, the
114
+ # VerificationSession's redaction.status field will be set to processing; when the process is
115
+ # finished, it will change to redacted and an identity.verification_session.redacted event
116
+ # will be emitted.
117
+ #
118
+ # Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the
119
+ # fields that contain personal data will be replaced by the string [redacted] or a similar
120
+ # placeholder. The metadata field will also be erased. Redacted objects cannot be updated or
121
+ # used for any purpose.
122
+ #
123
+ # [Learn more](https://stripe.com/docs/identity/verification-sessions#redact).
51
124
  def self.redact(session, params = {}, opts = {})
52
125
  request_stripe_object(
53
126
  method: :post,
@@ -56,6 +129,19 @@ module Stripe
56
129
  opts: opts
57
130
  )
58
131
  end
132
+
133
+ # Updates a VerificationSession object.
134
+ #
135
+ # When the session status is requires_input, you can use this method to update the
136
+ # verification check and options.
137
+ def self.update(id, params = {}, opts = {})
138
+ request_stripe_object(
139
+ method: :post,
140
+ path: format("/v1/identity/verification_sessions/%<id>s", { id: CGI.escape(id) }),
141
+ params: params,
142
+ opts: opts
143
+ )
144
+ end
59
145
  end
60
146
  end
61
147
  end