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
@@ -77,5 +77,27 @@ module Stripe
77
77
  opts: opts
78
78
  )
79
79
  end
80
+
81
+ # Creates a PaymentMethod object. Read the [Stripe.js reference](https://stripe.com/docs/stripe-js/reference#stripe-create-payment-method) to learn how to create PaymentMethods via Stripe.js.
82
+ #
83
+ # Instead of creating a PaymentMethod directly, we recommend using the [PaymentIntents API to accept a payment immediately or the <a href="/docs/payments/save-and-reuse">SetupIntent](https://stripe.com/docs/payments/accept-a-payment) API to collect payment method details ahead of a future payment.
84
+ def self.create(params = {}, opts = {})
85
+ request_stripe_object(method: :post, path: "/v1/payment_methods", params: params, opts: opts)
86
+ end
87
+
88
+ # Returns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the [List a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer_list) API instead.
89
+ def self.list(filters = {}, opts = {})
90
+ request_stripe_object(method: :get, path: "/v1/payment_methods", params: filters, opts: opts)
91
+ end
92
+
93
+ # Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated.
94
+ def self.update(id, params = {}, opts = {})
95
+ request_stripe_object(
96
+ method: :post,
97
+ path: format("/v1/payment_methods/%<id>s", { id: CGI.escape(id) }),
98
+ params: params,
99
+ opts: opts
100
+ )
101
+ end
80
102
  end
81
103
  end
@@ -22,5 +22,35 @@ module Stripe
22
22
  include Stripe::APIOperations::Save
23
23
 
24
24
  OBJECT_NAME = "payment_method_configuration"
25
+
26
+ # Creates a payment method configuration
27
+ def self.create(params = {}, opts = {})
28
+ request_stripe_object(
29
+ method: :post,
30
+ path: "/v1/payment_method_configurations",
31
+ params: params,
32
+ opts: opts
33
+ )
34
+ end
35
+
36
+ # List payment method configurations
37
+ def self.list(filters = {}, opts = {})
38
+ request_stripe_object(
39
+ method: :get,
40
+ path: "/v1/payment_method_configurations",
41
+ params: filters,
42
+ opts: opts
43
+ )
44
+ end
45
+
46
+ # Update payment method configuration
47
+ def self.update(id, params = {}, opts = {})
48
+ request_stripe_object(
49
+ method: :post,
50
+ path: format("/v1/payment_method_configurations/%<id>s", { id: CGI.escape(id) }),
51
+ params: params,
52
+ opts: opts
53
+ )
54
+ end
25
55
  end
26
56
  end
@@ -42,5 +42,35 @@ module Stripe
42
42
  opts: opts
43
43
  )
44
44
  end
45
+
46
+ # Creates a payment method domain.
47
+ def self.create(params = {}, opts = {})
48
+ request_stripe_object(
49
+ method: :post,
50
+ path: "/v1/payment_method_domains",
51
+ params: params,
52
+ opts: opts
53
+ )
54
+ end
55
+
56
+ # Lists the details of existing payment method domains.
57
+ def self.list(filters = {}, opts = {})
58
+ request_stripe_object(
59
+ method: :get,
60
+ path: "/v1/payment_method_domains",
61
+ params: filters,
62
+ opts: opts
63
+ )
64
+ end
65
+
66
+ # Updates an existing payment method domain.
67
+ def self.update(id, params = {}, opts = {})
68
+ request_stripe_object(
69
+ method: :post,
70
+ path: format("/v1/payment_method_domains/%<id>s", { id: CGI.escape(id) }),
71
+ params: params,
72
+ opts: opts
73
+ )
74
+ end
45
75
  end
46
76
  end
@@ -60,5 +60,29 @@ module Stripe
60
60
  opts: opts
61
61
  )
62
62
  end
63
+
64
+ # To send funds to your own bank account, create a new payout object. Your [Stripe balance](https://stripe.com/docs/api#balance) must cover the payout amount. If it doesn't, you receive an “Insufficient Funds” error.
65
+ #
66
+ # If your API key is in test mode, money won't actually be sent, though every other action occurs as if you're in live mode.
67
+ #
68
+ # If you create a manual payout on a Stripe account that uses multiple payment source types, you need to specify the source type balance that the payout draws from. The [balance object](https://stripe.com/docs/api#balance_object) details available and pending amounts by source type.
69
+ def self.create(params = {}, opts = {})
70
+ request_stripe_object(method: :post, path: "/v1/payouts", params: params, opts: opts)
71
+ end
72
+
73
+ # Returns a list of existing payouts sent to third-party bank accounts or payouts that Stripe sent to you. The payouts return in sorted order, with the most recently created payouts appearing first.
74
+ def self.list(filters = {}, opts = {})
75
+ request_stripe_object(method: :get, path: "/v1/payouts", params: filters, opts: opts)
76
+ end
77
+
78
+ # Updates the specified payout by setting the values of the parameters you pass. We don't change parameters that you don't provide. This request only accepts the metadata as arguments.
79
+ def self.update(id, params = {}, opts = {})
80
+ request_stripe_object(
81
+ method: :post,
82
+ path: format("/v1/payouts/%<id>s", { id: CGI.escape(id) }),
83
+ params: params,
84
+ opts: opts
85
+ )
86
+ end
63
87
  end
64
88
  end
@@ -17,5 +17,45 @@ module Stripe
17
17
  include Stripe::APIOperations::Save
18
18
 
19
19
  OBJECT_NAME = "plan"
20
+
21
+ # You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration.
22
+ def self.create(params = {}, opts = {})
23
+ request_stripe_object(method: :post, path: "/v1/plans", params: params, opts: opts)
24
+ end
25
+
26
+ # Deleting plans means new subscribers can't be added. Existing subscribers aren't affected.
27
+ def self.delete(id, params = {}, opts = {})
28
+ request_stripe_object(
29
+ method: :delete,
30
+ path: format("/v1/plans/%<id>s", { id: CGI.escape(id) }),
31
+ params: params,
32
+ opts: opts
33
+ )
34
+ end
35
+
36
+ # Deleting plans means new subscribers can't be added. Existing subscribers aren't affected.
37
+ def delete(params = {}, opts = {})
38
+ request_stripe_object(
39
+ method: :delete,
40
+ path: format("/v1/plans/%<plan>s", { plan: CGI.escape(self["id"]) }),
41
+ params: params,
42
+ opts: opts
43
+ )
44
+ end
45
+
46
+ # Returns a list of your plans.
47
+ def self.list(filters = {}, opts = {})
48
+ request_stripe_object(method: :get, path: "/v1/plans", params: filters, opts: opts)
49
+ end
50
+
51
+ # Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan's ID, amount, currency, or billing cycle.
52
+ def self.update(id, params = {}, opts = {})
53
+ request_stripe_object(
54
+ method: :post,
55
+ path: format("/v1/plans/%<id>s", { id: CGI.escape(id) }),
56
+ params: params,
57
+ opts: opts
58
+ )
59
+ end
20
60
  end
21
61
  end
@@ -16,6 +16,16 @@ module Stripe
16
16
 
17
17
  OBJECT_NAME = "price"
18
18
 
19
+ # Creates a new price for an existing product. The price can be recurring or one-time.
20
+ def self.create(params = {}, opts = {})
21
+ request_stripe_object(method: :post, path: "/v1/prices", params: params, opts: opts)
22
+ end
23
+
24
+ # Returns a list of your active prices, excluding [inline prices](https://stripe.com/docs/products-prices/pricing-models#inline-pricing). For the list of inactive prices, set active to false.
25
+ def self.list(filters = {}, opts = {})
26
+ request_stripe_object(method: :get, path: "/v1/prices", params: filters, opts: opts)
27
+ end
28
+
19
29
  def self.search(params = {}, opts = {})
20
30
  request_stripe_object(method: :get, path: "/v1/prices/search", params: params, opts: opts)
21
31
  end
@@ -23,5 +33,15 @@ module Stripe
23
33
  def self.search_auto_paging_each(params = {}, opts = {}, &blk)
24
34
  search(params, opts).auto_paging_each(&blk)
25
35
  end
36
+
37
+ # Updates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged.
38
+ def self.update(id, params = {}, opts = {})
39
+ request_stripe_object(
40
+ method: :post,
41
+ path: format("/v1/prices/%<id>s", { id: CGI.escape(id) }),
42
+ params: params,
43
+ opts: opts
44
+ )
45
+ end
26
46
  end
27
47
  end
@@ -19,6 +19,36 @@ module Stripe
19
19
 
20
20
  OBJECT_NAME = "product"
21
21
 
22
+ # Creates a new product object.
23
+ def self.create(params = {}, opts = {})
24
+ request_stripe_object(method: :post, path: "/v1/products", params: params, opts: opts)
25
+ end
26
+
27
+ # Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it.
28
+ def self.delete(id, params = {}, opts = {})
29
+ request_stripe_object(
30
+ method: :delete,
31
+ path: format("/v1/products/%<id>s", { id: CGI.escape(id) }),
32
+ params: params,
33
+ opts: opts
34
+ )
35
+ end
36
+
37
+ # Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it.
38
+ def delete(params = {}, opts = {})
39
+ request_stripe_object(
40
+ method: :delete,
41
+ path: format("/v1/products/%<id>s", { id: CGI.escape(self["id"]) }),
42
+ params: params,
43
+ opts: opts
44
+ )
45
+ end
46
+
47
+ # Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first.
48
+ def self.list(filters = {}, opts = {})
49
+ request_stripe_object(method: :get, path: "/v1/products", params: filters, opts: opts)
50
+ end
51
+
22
52
  def self.search(params = {}, opts = {})
23
53
  request_stripe_object(method: :get, path: "/v1/products/search", params: params, opts: opts)
24
54
  end
@@ -26,5 +56,15 @@ module Stripe
26
56
  def self.search_auto_paging_each(params = {}, opts = {}, &blk)
27
57
  search(params, opts).auto_paging_each(&blk)
28
58
  end
59
+
60
+ # Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
61
+ def self.update(id, params = {}, opts = {})
62
+ request_stripe_object(
63
+ method: :post,
64
+ path: format("/v1/products/%<id>s", { id: CGI.escape(id) }),
65
+ params: params,
66
+ opts: opts
67
+ )
68
+ end
29
69
  end
30
70
  end
@@ -10,5 +10,25 @@ module Stripe
10
10
  include Stripe::APIOperations::Save
11
11
 
12
12
  OBJECT_NAME = "promotion_code"
13
+
14
+ # A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date.
15
+ def self.create(params = {}, opts = {})
16
+ request_stripe_object(method: :post, path: "/v1/promotion_codes", params: params, opts: opts)
17
+ end
18
+
19
+ # Returns a list of your promotion codes.
20
+ def self.list(filters = {}, opts = {})
21
+ request_stripe_object(method: :get, path: "/v1/promotion_codes", params: filters, opts: opts)
22
+ end
23
+
24
+ # Updates the specified promotion code by setting the values of the parameters passed. Most fields are, by design, not editable.
25
+ def self.update(id, params = {}, opts = {})
26
+ request_stripe_object(
27
+ method: :post,
28
+ path: format("/v1/promotion_codes/%<id>s", { id: CGI.escape(id) }),
29
+ params: params,
30
+ opts: opts
31
+ )
32
+ end
13
33
  end
14
34
  end
@@ -8,13 +8,9 @@ module Stripe
8
8
  extend Stripe::APIOperations::Create
9
9
  extend Stripe::APIOperations::List
10
10
  include Stripe::APIOperations::Save
11
- extend Stripe::APIOperations::NestedResource
12
11
 
13
12
  OBJECT_NAME = "quote"
14
13
 
15
- nested_resource_class_methods :preview_invoice, operations: %i[list]
16
- nested_resource_class_methods :preview_subscription_schedule, operations: %i[list]
17
-
18
14
  # Accepts the specified quote.
19
15
  def accept(params = {}, opts = {})
20
16
  request_stripe_object(
@@ -65,46 +61,6 @@ module Stripe
65
61
  )
66
62
  end
67
63
 
68
- # Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
69
- def list_lines(params = {}, opts = {})
70
- request_stripe_object(
71
- method: :get,
72
- path: format("/v1/quotes/%<quote>s/lines", { quote: CGI.escape(self["id"]) }),
73
- params: params,
74
- opts: opts
75
- )
76
- end
77
-
78
- # Preview the invoice line items that would be generated by accepting the quote.
79
- def list_preview_invoice_lines(preview_invoice, params = {}, opts = {})
80
- request_stripe_object(
81
- method: :get,
82
- path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(self["id"]), preview_invoice: CGI.escape(preview_invoice) }),
83
- params: params,
84
- opts: opts
85
- )
86
- end
87
-
88
- # Converts a stale quote to draft.
89
- def mark_draft(params = {}, opts = {})
90
- request_stripe_object(
91
- method: :post,
92
- path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(self["id"]) }),
93
- params: params,
94
- opts: opts
95
- )
96
- end
97
-
98
- # Converts a draft or open quote to stale.
99
- def mark_stale(params = {}, opts = {})
100
- request_stripe_object(
101
- method: :post,
102
- path: format("/v1/quotes/%<quote>s/mark_stale", { quote: CGI.escape(self["id"]) }),
103
- params: params,
104
- opts: opts
105
- )
106
- end
107
-
108
64
  # Download the PDF for a finalized quote
109
65
  def pdf(params = {}, opts = {}, &read_body_chunk_block)
110
66
  config = opts[:client]&.config || Stripe.config
@@ -118,16 +74,6 @@ module Stripe
118
74
  )
119
75
  end
120
76
 
121
- # Recompute the upcoming invoice estimate for the quote.
122
- def reestimate(params = {}, opts = {})
123
- request_stripe_object(
124
- method: :post,
125
- path: format("/v1/quotes/%<quote>s/reestimate", { quote: CGI.escape(self["id"]) }),
126
- params: params,
127
- opts: opts
128
- )
129
- end
130
-
131
77
  # Accepts the specified quote.
132
78
  def self.accept(quote, params = {}, opts = {})
133
79
  request_stripe_object(
@@ -178,46 +124,6 @@ module Stripe
178
124
  )
179
125
  end
180
126
 
181
- # Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
182
- def self.list_lines(quote, params = {}, opts = {})
183
- request_stripe_object(
184
- method: :get,
185
- path: format("/v1/quotes/%<quote>s/lines", { quote: CGI.escape(quote) }),
186
- params: params,
187
- opts: opts
188
- )
189
- end
190
-
191
- # Preview the invoice line items that would be generated by accepting the quote.
192
- def self.list_preview_invoice_lines(quote, preview_invoice, params = {}, opts = {})
193
- request_stripe_object(
194
- method: :get,
195
- path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(quote), preview_invoice: CGI.escape(preview_invoice) }),
196
- params: params,
197
- opts: opts
198
- )
199
- end
200
-
201
- # Converts a stale quote to draft.
202
- def self.mark_draft(quote, params = {}, opts = {})
203
- request_stripe_object(
204
- method: :post,
205
- path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(quote) }),
206
- params: params,
207
- opts: opts
208
- )
209
- end
210
-
211
- # Converts a draft or open quote to stale.
212
- def self.mark_stale(quote, params = {}, opts = {})
213
- request_stripe_object(
214
- method: :post,
215
- path: format("/v1/quotes/%<quote>s/mark_stale", { quote: CGI.escape(quote) }),
216
- params: params,
217
- opts: opts
218
- )
219
- end
220
-
221
127
  # Download the PDF for a finalized quote
222
128
  def self.pdf(quote, params = {}, opts = {}, &read_body_chunk_block)
223
129
  config = opts[:client]&.config || Stripe.config
@@ -231,11 +137,21 @@ module Stripe
231
137
  )
232
138
  end
233
139
 
234
- # Recompute the upcoming invoice estimate for the quote.
235
- def self.reestimate(quote, params = {}, opts = {})
140
+ # A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the [quote template](https://dashboard.stripe.com/settings/billing/quote).
141
+ def self.create(params = {}, opts = {})
142
+ request_stripe_object(method: :post, path: "/v1/quotes", params: params, opts: opts)
143
+ end
144
+
145
+ # Returns a list of your quotes.
146
+ def self.list(filters = {}, opts = {})
147
+ request_stripe_object(method: :get, path: "/v1/quotes", params: filters, opts: opts)
148
+ end
149
+
150
+ # A quote models prices and services for a customer.
151
+ def self.update(id, params = {}, opts = {})
236
152
  request_stripe_object(
237
153
  method: :post,
238
- path: format("/v1/quotes/%<quote>s/reestimate", { quote: CGI.escape(quote) }),
154
+ path: format("/v1/quotes/%<id>s", { id: CGI.escape(id) }),
239
155
  params: params,
240
156
  opts: opts
241
157
  )
@@ -11,6 +11,16 @@ module Stripe
11
11
  extend Stripe::APIOperations::List
12
12
 
13
13
  OBJECT_NAME = "radar.early_fraud_warning"
14
+
15
+ # Returns a list of early fraud warnings.
16
+ def self.list(filters = {}, opts = {})
17
+ request_stripe_object(
18
+ method: :get,
19
+ path: "/v1/radar/early_fraud_warnings",
20
+ params: filters,
21
+ opts: opts
22
+ )
23
+ end
14
24
  end
15
25
  end
16
26
  end
@@ -13,6 +13,56 @@ module Stripe
13
13
  include Stripe::APIOperations::Save
14
14
 
15
15
  OBJECT_NAME = "radar.value_list"
16
+
17
+ # Creates a new ValueList object, which can then be referenced in rules.
18
+ def self.create(params = {}, opts = {})
19
+ request_stripe_object(
20
+ method: :post,
21
+ path: "/v1/radar/value_lists",
22
+ params: params,
23
+ opts: opts
24
+ )
25
+ end
26
+
27
+ # Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules.
28
+ def self.delete(id, params = {}, opts = {})
29
+ request_stripe_object(
30
+ method: :delete,
31
+ path: format("/v1/radar/value_lists/%<id>s", { id: CGI.escape(id) }),
32
+ params: params,
33
+ opts: opts
34
+ )
35
+ end
36
+
37
+ # Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules.
38
+ def delete(params = {}, opts = {})
39
+ request_stripe_object(
40
+ method: :delete,
41
+ path: format("/v1/radar/value_lists/%<value_list>s", { value_list: CGI.escape(self["id"]) }),
42
+ params: params,
43
+ opts: opts
44
+ )
45
+ end
46
+
47
+ # Returns a list of ValueList objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
48
+ def self.list(filters = {}, opts = {})
49
+ request_stripe_object(
50
+ method: :get,
51
+ path: "/v1/radar/value_lists",
52
+ params: filters,
53
+ opts: opts
54
+ )
55
+ end
56
+
57
+ # Updates a ValueList object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Note that item_type is immutable.
58
+ def self.update(id, params = {}, opts = {})
59
+ request_stripe_object(
60
+ method: :post,
61
+ path: format("/v1/radar/value_lists/%<id>s", { id: CGI.escape(id) }),
62
+ params: params,
63
+ opts: opts
64
+ )
65
+ end
16
66
  end
17
67
  end
18
68
  end
@@ -12,6 +12,46 @@ module Stripe
12
12
  extend Stripe::APIOperations::List
13
13
 
14
14
  OBJECT_NAME = "radar.value_list_item"
15
+
16
+ # Creates a new ValueListItem object, which is added to the specified parent value list.
17
+ def self.create(params = {}, opts = {})
18
+ request_stripe_object(
19
+ method: :post,
20
+ path: "/v1/radar/value_list_items",
21
+ params: params,
22
+ opts: opts
23
+ )
24
+ end
25
+
26
+ # Deletes a ValueListItem object, removing it from its parent value list.
27
+ def self.delete(id, params = {}, opts = {})
28
+ request_stripe_object(
29
+ method: :delete,
30
+ path: format("/v1/radar/value_list_items/%<id>s", { id: CGI.escape(id) }),
31
+ params: params,
32
+ opts: opts
33
+ )
34
+ end
35
+
36
+ # Deletes a ValueListItem object, removing it from its parent value list.
37
+ def delete(params = {}, opts = {})
38
+ request_stripe_object(
39
+ method: :delete,
40
+ path: format("/v1/radar/value_list_items/%<item>s", { item: CGI.escape(self["id"]) }),
41
+ params: params,
42
+ opts: opts
43
+ )
44
+ end
45
+
46
+ # Returns a list of ValueListItem objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
47
+ def self.list(filters = {}, opts = {})
48
+ request_stripe_object(
49
+ method: :get,
50
+ path: "/v1/radar/value_list_items",
51
+ params: filters,
52
+ opts: opts
53
+ )
54
+ end
15
55
  end
16
56
  end
17
57
  end
@@ -38,6 +38,42 @@ module Stripe
38
38
  )
39
39
  end
40
40
 
41
+ def self.list(filters = {}, opts = {})
42
+ request_stripe_object(
43
+ method: :get,
44
+ path: format("/v1/refunds"),
45
+ params: filters,
46
+ opts: opts
47
+ )
48
+ end
49
+
50
+ # When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it.
51
+ #
52
+ # Creating a new refund will refund a charge that has previously been created but not yet refunded.
53
+ # Funds will be refunded to the credit or debit card that was originally charged.
54
+ #
55
+ # You can optionally refund only part of a charge.
56
+ # You can do so multiple times, until the entire charge has been refunded.
57
+ #
58
+ # Once entirely refunded, a charge can't be refunded again.
59
+ # This method will raise an error when called on an already-refunded charge,
60
+ # or when trying to refund more money than is left on a charge.
61
+ def self.create(params = {}, opts = {})
62
+ request_stripe_object(method: :post, path: "/v1/refunds", params: params, opts: opts)
63
+ end
64
+
65
+ # Updates the refund that you specify by setting the values of the passed parameters. Any parameters that you don't provide remain unchanged.
66
+ #
67
+ # This request only accepts metadata as an argument.
68
+ def self.update(id, params = {}, opts = {})
69
+ request_stripe_object(
70
+ method: :post,
71
+ path: format("/v1/refunds/%<id>s", { id: CGI.escape(id) }),
72
+ params: params,
73
+ opts: opts
74
+ )
75
+ end
76
+
41
77
  def test_helpers
42
78
  TestHelpers.new(self)
43
79
  end
@@ -16,6 +16,26 @@ module Stripe
16
16
  extend Stripe::APIOperations::List
17
17
 
18
18
  OBJECT_NAME = "reporting.report_run"
19
+
20
+ # Creates a new object and begin running the report. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).)
21
+ def self.create(params = {}, opts = {})
22
+ request_stripe_object(
23
+ method: :post,
24
+ path: "/v1/reporting/report_runs",
25
+ params: params,
26
+ opts: opts
27
+ )
28
+ end
29
+
30
+ # Returns a list of Report Runs, with the most recent appearing first.
31
+ def self.list(filters = {}, opts = {})
32
+ request_stripe_object(
33
+ method: :get,
34
+ path: "/v1/reporting/report_runs",
35
+ params: filters,
36
+ opts: opts
37
+ )
38
+ end
19
39
  end
20
40
  end
21
41
  end
@@ -15,6 +15,16 @@ module Stripe
15
15
  extend Stripe::APIOperations::List
16
16
 
17
17
  OBJECT_NAME = "reporting.report_type"
18
+
19
+ # Returns a full list of Report Types.
20
+ def self.list(filters = {}, opts = {})
21
+ request_stripe_object(
22
+ method: :get,
23
+ path: "/v1/reporting/report_types",
24
+ params: filters,
25
+ opts: opts
26
+ )
27
+ end
18
28
  end
19
29
  end
20
30
  end
@@ -30,5 +30,10 @@ module Stripe
30
30
  opts: opts
31
31
  )
32
32
  end
33
+
34
+ # Returns a list of Review objects that have open set to true. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
35
+ def self.list(filters = {}, opts = {})
36
+ request_stripe_object(method: :get, path: "/v1/reviews", params: filters, opts: opts)
37
+ end
33
38
  end
34
39
  end
@@ -10,5 +10,10 @@ module Stripe
10
10
  extend Stripe::APIOperations::List
11
11
 
12
12
  OBJECT_NAME = "setup_attempt"
13
+
14
+ # Returns a list of SetupAttempts that associate with a provided SetupIntent.
15
+ def self.list(filters = {}, opts = {})
16
+ request_stripe_object(method: :get, path: "/v1/setup_attempts", params: filters, opts: opts)
17
+ end
13
18
  end
14
19
  end