stripe 10.11.0 → 10.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -9
  3. data/OPENAPI_VERSION +1 -1
  4. data/VERSION +1 -1
  5. data/lib/stripe/object_types.rb +6 -5
  6. data/lib/stripe/resources/account.rb +70 -70
  7. data/lib/stripe/resources/apple_pay_domain.rb +4 -4
  8. data/lib/stripe/resources/apps/secret.rb +5 -5
  9. data/lib/stripe/resources/charge.rb +1 -1
  10. data/lib/stripe/resources/checkout/session.rb +21 -21
  11. data/lib/stripe/resources/credit_note.rb +35 -35
  12. data/lib/stripe/resources/customer.rb +58 -58
  13. data/lib/stripe/resources/ephemeral_key.rb +9 -9
  14. data/lib/stripe/resources/file.rb +5 -5
  15. data/lib/stripe/resources/financial_connections/account.rb +34 -34
  16. data/lib/stripe/resources/identity/verification_session.rb +38 -38
  17. data/lib/stripe/resources/invoice.rb +72 -72
  18. data/lib/stripe/resources/issuing/authorization.rb +32 -32
  19. data/lib/stripe/resources/issuing/card.rb +22 -22
  20. data/lib/stripe/resources/issuing/dispute.rb +16 -16
  21. data/lib/stripe/resources/issuing/personalization_design.rb +119 -0
  22. data/lib/stripe/resources/issuing/physical_bundle.rb +26 -0
  23. data/lib/stripe/resources/payment_intent.rb +100 -100
  24. data/lib/stripe/resources/payment_link.rb +10 -10
  25. data/lib/stripe/resources/payment_method.rb +17 -17
  26. data/lib/stripe/resources/payment_method_domain.rb +29 -29
  27. data/lib/stripe/resources/payout.rb +22 -22
  28. data/lib/stripe/resources/quote.rb +51 -51
  29. data/lib/stripe/resources/setup_intent.rb +32 -32
  30. data/lib/stripe/resources/sigma/scheduled_query_run.rb +4 -4
  31. data/lib/stripe/resources/source.rb +18 -18
  32. data/lib/stripe/resources/subscription.rb +36 -36
  33. data/lib/stripe/resources/subscription_item.rb +1 -1
  34. data/lib/stripe/resources/subscription_schedule.rb +19 -19
  35. data/lib/stripe/resources/tax/calculation.rb +10 -10
  36. data/lib/stripe/resources/tax/settings.rb +0 -1
  37. data/lib/stripe/resources/tax/transaction.rb +10 -10
  38. data/lib/stripe/resources/terminal/reader.rb +46 -46
  39. data/lib/stripe/resources/transfer.rb +1 -1
  40. data/lib/stripe/resources/treasury/financial_account.rb +25 -25
  41. data/lib/stripe/resources/treasury/inbound_transfer.rb +14 -14
  42. data/lib/stripe/resources/treasury/outbound_payment.rb +14 -14
  43. data/lib/stripe/resources/treasury/outbound_transfer.rb +14 -14
  44. data/lib/stripe/resources/treasury/transaction_entry.rb +4 -4
  45. data/lib/stripe/resources.rb +2 -0
  46. data/lib/stripe/version.rb +1 -1
  47. metadata +4 -2
@@ -24,84 +24,71 @@ module Stripe
24
24
  )
25
25
  end
26
26
 
27
- # Cancels the quote.
28
- def cancel(params = {}, opts = {})
27
+ # Accepts the specified quote.
28
+ def self.accept(quote, params = {}, opts = {})
29
29
  request_stripe_object(
30
30
  method: :post,
31
- path: format("/v1/quotes/%<quote>s/cancel", { quote: CGI.escape(self["id"]) }),
31
+ path: format("/v1/quotes/%<quote>s/accept", { quote: CGI.escape(quote) }),
32
32
  params: params,
33
33
  opts: opts
34
34
  )
35
35
  end
36
36
 
37
- # Finalizes the quote.
38
- def finalize_quote(params = {}, opts = {})
37
+ # Cancels the quote.
38
+ def cancel(params = {}, opts = {})
39
39
  request_stripe_object(
40
40
  method: :post,
41
- path: format("/v1/quotes/%<quote>s/finalize", { quote: CGI.escape(self["id"]) }),
42
- params: params,
43
- opts: opts
44
- )
45
- end
46
-
47
- # When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items.
48
- def list_computed_upfront_line_items(params = {}, opts = {})
49
- request_stripe_object(
50
- method: :get,
51
- path: format("/v1/quotes/%<quote>s/computed_upfront_line_items", { quote: CGI.escape(self["id"]) }),
41
+ path: format("/v1/quotes/%<quote>s/cancel", { quote: CGI.escape(self["id"]) }),
52
42
  params: params,
53
43
  opts: opts
54
44
  )
55
45
  end
56
46
 
57
- # When retrieving a quote, 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.
58
- def list_line_items(params = {}, opts = {})
47
+ # Cancels the quote.
48
+ def self.cancel(quote, params = {}, opts = {})
59
49
  request_stripe_object(
60
- method: :get,
61
- path: format("/v1/quotes/%<quote>s/line_items", { quote: CGI.escape(self["id"]) }),
50
+ method: :post,
51
+ path: format("/v1/quotes/%<quote>s/cancel", { quote: CGI.escape(quote) }),
62
52
  params: params,
63
53
  opts: opts
64
54
  )
65
55
  end
66
56
 
67
- # Download the PDF for a finalized quote
68
- def pdf(params = {}, opts = {}, &read_body_chunk_block)
69
- config = opts[:client]&.config || Stripe.config
70
- opts = { api_base: config.uploads_base }.merge(opts)
71
- request_stream(
72
- method: :get,
73
- path: format("/v1/quotes/%<quote>s/pdf", { quote: CGI.escape(self["id"]) }),
74
- params: params,
75
- opts: opts,
76
- &read_body_chunk_block
77
- )
57
+ # 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).
58
+ def self.create(params = {}, opts = {})
59
+ request_stripe_object(method: :post, path: "/v1/quotes", params: params, opts: opts)
78
60
  end
79
61
 
80
- # Accepts the specified quote.
81
- def self.accept(quote, params = {}, opts = {})
62
+ # Finalizes the quote.
63
+ def finalize_quote(params = {}, opts = {})
82
64
  request_stripe_object(
83
65
  method: :post,
84
- path: format("/v1/quotes/%<quote>s/accept", { quote: CGI.escape(quote) }),
66
+ path: format("/v1/quotes/%<quote>s/finalize", { quote: CGI.escape(self["id"]) }),
85
67
  params: params,
86
68
  opts: opts
87
69
  )
88
70
  end
89
71
 
90
- # Cancels the quote.
91
- def self.cancel(quote, params = {}, opts = {})
72
+ # Finalizes the quote.
73
+ def self.finalize_quote(quote, params = {}, opts = {})
92
74
  request_stripe_object(
93
75
  method: :post,
94
- path: format("/v1/quotes/%<quote>s/cancel", { quote: CGI.escape(quote) }),
76
+ path: format("/v1/quotes/%<quote>s/finalize", { quote: CGI.escape(quote) }),
95
77
  params: params,
96
78
  opts: opts
97
79
  )
98
80
  end
99
81
 
100
- # Finalizes the quote.
101
- def self.finalize_quote(quote, params = {}, opts = {})
82
+ # Returns a list of your quotes.
83
+ def self.list(filters = {}, opts = {})
84
+ request_stripe_object(method: :get, path: "/v1/quotes", params: filters, opts: opts)
85
+ end
86
+
87
+ # When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items.
88
+ def list_computed_upfront_line_items(params = {}, opts = {})
102
89
  request_stripe_object(
103
- method: :post,
104
- path: format("/v1/quotes/%<quote>s/finalize", { quote: CGI.escape(quote) }),
90
+ method: :get,
91
+ path: format("/v1/quotes/%<quote>s/computed_upfront_line_items", { quote: CGI.escape(self["id"]) }),
105
92
  params: params,
106
93
  opts: opts
107
94
  )
@@ -117,6 +104,16 @@ module Stripe
117
104
  )
118
105
  end
119
106
 
107
+ # When retrieving a quote, 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.
108
+ def list_line_items(params = {}, opts = {})
109
+ request_stripe_object(
110
+ method: :get,
111
+ path: format("/v1/quotes/%<quote>s/line_items", { quote: CGI.escape(self["id"]) }),
112
+ params: params,
113
+ opts: opts
114
+ )
115
+ end
116
+
120
117
  # When retrieving a quote, 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.
121
118
  def self.list_line_items(quote, params = {}, opts = {})
122
119
  request_stripe_object(
@@ -127,6 +124,19 @@ module Stripe
127
124
  )
128
125
  end
129
126
 
127
+ # Download the PDF for a finalized quote
128
+ def pdf(params = {}, opts = {}, &read_body_chunk_block)
129
+ config = opts[:client]&.config || Stripe.config
130
+ opts = { api_base: config.uploads_base }.merge(opts)
131
+ request_stream(
132
+ method: :get,
133
+ path: format("/v1/quotes/%<quote>s/pdf", { quote: CGI.escape(self["id"]) }),
134
+ params: params,
135
+ opts: opts,
136
+ &read_body_chunk_block
137
+ )
138
+ end
139
+
130
140
  # Download the PDF for a finalized quote
131
141
  def self.pdf(quote, params = {}, opts = {}, &read_body_chunk_block)
132
142
  config = opts[:client]&.config || Stripe.config
@@ -140,16 +150,6 @@ module Stripe
140
150
  )
141
151
  end
142
152
 
143
- # 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).
144
- def self.create(params = {}, opts = {})
145
- request_stripe_object(method: :post, path: "/v1/quotes", params: params, opts: opts)
146
- end
147
-
148
- # Returns a list of your quotes.
149
- def self.list(filters = {}, opts = {})
150
- request_stripe_object(method: :get, path: "/v1/quotes", params: filters, opts: opts)
151
- end
152
-
153
153
  # A quote models prices and services for a customer.
154
154
  def self.update(id, params = {}, opts = {})
155
155
  request_stripe_object(
@@ -45,6 +45,18 @@ module Stripe
45
45
  )
46
46
  end
47
47
 
48
+ # You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action.
49
+ #
50
+ # After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error.
51
+ def self.cancel(intent, params = {}, opts = {})
52
+ request_stripe_object(
53
+ method: :post,
54
+ path: format("/v1/setup_intents/%<intent>s/cancel", { intent: CGI.escape(intent) }),
55
+ params: params,
56
+ opts: opts
57
+ )
58
+ end
59
+
48
60
  # Confirm that your customer intends to set up the current or
49
61
  # provided payment method. For example, you would confirm a SetupIntent
50
62
  # when a customer hits the “Save” button on a payment method management
@@ -68,28 +80,6 @@ module Stripe
68
80
  )
69
81
  end
70
82
 
71
- # Verifies microdeposits on a SetupIntent object.
72
- def verify_microdeposits(params = {}, opts = {})
73
- request_stripe_object(
74
- method: :post,
75
- path: format("/v1/setup_intents/%<intent>s/verify_microdeposits", { intent: CGI.escape(self["id"]) }),
76
- params: params,
77
- opts: opts
78
- )
79
- end
80
-
81
- # You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action.
82
- #
83
- # After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error.
84
- def self.cancel(intent, params = {}, opts = {})
85
- request_stripe_object(
86
- method: :post,
87
- path: format("/v1/setup_intents/%<intent>s/cancel", { intent: CGI.escape(intent) }),
88
- params: params,
89
- opts: opts
90
- )
91
- end
92
-
93
83
  # Confirm that your customer intends to set up the current or
94
84
  # provided payment method. For example, you would confirm a SetupIntent
95
85
  # when a customer hits the “Save” button on a payment method management
@@ -113,16 +103,6 @@ module Stripe
113
103
  )
114
104
  end
115
105
 
116
- # Verifies microdeposits on a SetupIntent object.
117
- def self.verify_microdeposits(intent, params = {}, opts = {})
118
- request_stripe_object(
119
- method: :post,
120
- path: format("/v1/setup_intents/%<intent>s/verify_microdeposits", { intent: CGI.escape(intent) }),
121
- params: params,
122
- opts: opts
123
- )
124
- end
125
-
126
106
  # Creates a SetupIntent object.
127
107
  #
128
108
  # After you create the SetupIntent, attach a payment method and [confirm](https://stripe.com/docs/api/setup_intents/confirm)
@@ -145,5 +125,25 @@ module Stripe
145
125
  opts: opts
146
126
  )
147
127
  end
128
+
129
+ # Verifies microdeposits on a SetupIntent object.
130
+ def verify_microdeposits(params = {}, opts = {})
131
+ request_stripe_object(
132
+ method: :post,
133
+ path: format("/v1/setup_intents/%<intent>s/verify_microdeposits", { intent: CGI.escape(self["id"]) }),
134
+ params: params,
135
+ opts: opts
136
+ )
137
+ end
138
+
139
+ # Verifies microdeposits on a SetupIntent object.
140
+ def self.verify_microdeposits(intent, params = {}, opts = {})
141
+ request_stripe_object(
142
+ method: :post,
143
+ path: format("/v1/setup_intents/%<intent>s/verify_microdeposits", { intent: CGI.escape(intent) }),
144
+ params: params,
145
+ opts: opts
146
+ )
147
+ end
148
148
  end
149
149
  end
@@ -15,10 +15,6 @@ module Stripe
15
15
  "scheduled_query_run"
16
16
  end
17
17
 
18
- def self.resource_url
19
- "/v1/sigma/scheduled_query_runs"
20
- end
21
-
22
18
  # Returns a list of scheduled query runs.
23
19
  def self.list(filters = {}, opts = {})
24
20
  request_stripe_object(
@@ -28,6 +24,10 @@ module Stripe
28
24
  opts: opts
29
25
  )
30
26
  end
27
+
28
+ def self.resource_url
29
+ "/v1/sigma/scheduled_query_runs"
30
+ end
31
31
  end
32
32
  end
33
33
  end
@@ -14,8 +14,8 @@ module Stripe
14
14
  # Related guides: [Sources API](https://stripe.com/docs/sources) and [Sources & Customers](https://stripe.com/docs/sources/customers).
15
15
  class Source < APIResource
16
16
  extend Stripe::APIOperations::Create
17
- include Stripe::APIOperations::Save
18
17
  extend Stripe::APIOperations::NestedResource
18
+ include Stripe::APIOperations::Save
19
19
 
20
20
  OBJECT_NAME = "source"
21
21
  def self.object_name
@@ -24,6 +24,23 @@ module Stripe
24
24
 
25
25
  nested_resource_class_methods :source_transaction, operations: %i[retrieve list]
26
26
 
27
+ # Creates a new source object.
28
+ def self.create(params = {}, opts = {})
29
+ request_stripe_object(method: :post, path: "/v1/sources", params: params, opts: opts)
30
+ end
31
+
32
+ # Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
33
+ #
34
+ # This request accepts the metadata and owner as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our [payment method guides](https://stripe.com/docs/sources) for more detail.
35
+ def self.update(id, params = {}, opts = {})
36
+ request_stripe_object(
37
+ method: :post,
38
+ path: format("/v1/sources/%<id>s", { id: CGI.escape(id) }),
39
+ params: params,
40
+ opts: opts
41
+ )
42
+ end
43
+
27
44
  # Verify a given source.
28
45
  def verify(params = {}, opts = {})
29
46
  request_stripe_object(
@@ -67,22 +84,5 @@ module Stripe
67
84
  end
68
85
  extend Gem::Deprecate
69
86
  deprecate :source_transactions, :"Source.list_source_transactions", 2020, 1
70
-
71
- # Creates a new source object.
72
- def self.create(params = {}, opts = {})
73
- request_stripe_object(method: :post, path: "/v1/sources", params: params, opts: opts)
74
- end
75
-
76
- # Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
77
- #
78
- # This request accepts the metadata and owner as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our [payment method guides](https://stripe.com/docs/sources) for more detail.
79
- def self.update(id, params = {}, opts = {})
80
- request_stripe_object(
81
- method: :post,
82
- path: format("/v1/sources/%<id>s", { id: CGI.escape(id) }),
83
- params: params,
84
- opts: opts
85
- )
86
- end
87
87
  end
88
88
  end
@@ -30,35 +30,36 @@ module Stripe
30
30
  )
31
31
  end
32
32
 
33
- # Removes the currently applied discount on a subscription.
34
- def delete_discount(params = {}, opts = {})
33
+ # Cancels a customer's subscription immediately. The customer will not be charged again for the subscription.
34
+ #
35
+ # Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed.
36
+ #
37
+ # By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
38
+ def self.cancel(subscription_exposed_id, params = {}, opts = {})
35
39
  request_stripe_object(
36
40
  method: :delete,
37
- path: format("/v1/subscriptions/%<subscription_exposed_id>s/discount", { subscription_exposed_id: CGI.escape(self["id"]) }),
38
- params: params,
39
- opts: opts
40
- )
41
- end
42
-
43
- # Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date.
44
- def resume(params = {}, opts = {})
45
- request_stripe_object(
46
- method: :post,
47
- path: format("/v1/subscriptions/%<subscription>s/resume", { subscription: CGI.escape(self["id"]) }),
41
+ path: format("/v1/subscriptions/%<subscription_exposed_id>s", { subscription_exposed_id: CGI.escape(subscription_exposed_id) }),
48
42
  params: params,
49
43
  opts: opts
50
44
  )
51
45
  end
52
46
 
53
- # Cancels a customer's subscription immediately. The customer will not be charged again for the subscription.
47
+ # Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions.
54
48
  #
55
- # Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed.
49
+ # When you create a subscription with collection_method=charge_automatically, the first invoice is finalized as part of the request.
50
+ # The payment_behavior parameter determines the exact behavior of the initial payment.
56
51
  #
57
- # By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
58
- def self.cancel(subscription_exposed_id, params = {}, opts = {})
52
+ # To start subscriptions where the first invoice always begins in a draft status, use [subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules#managing) instead.
53
+ # Schedules provide the flexibility to model more complex billing configurations that change over time.
54
+ def self.create(params = {}, opts = {})
55
+ request_stripe_object(method: :post, path: "/v1/subscriptions", params: params, opts: opts)
56
+ end
57
+
58
+ # Removes the currently applied discount on a subscription.
59
+ def delete_discount(params = {}, opts = {})
59
60
  request_stripe_object(
60
61
  method: :delete,
61
- path: format("/v1/subscriptions/%<subscription_exposed_id>s", { subscription_exposed_id: CGI.escape(subscription_exposed_id) }),
62
+ path: format("/v1/subscriptions/%<subscription_exposed_id>s/discount", { subscription_exposed_id: CGI.escape(self["id"]) }),
62
63
  params: params,
63
64
  opts: opts
64
65
  )
@@ -74,32 +75,29 @@ module Stripe
74
75
  )
75
76
  end
76
77
 
78
+ # By default, returns a list of subscriptions that have not been canceled. In order to list canceled subscriptions, specify status=canceled.
79
+ def self.list(filters = {}, opts = {})
80
+ request_stripe_object(method: :get, path: "/v1/subscriptions", params: filters, opts: opts)
81
+ end
82
+
77
83
  # Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date.
78
- def self.resume(subscription, params = {}, opts = {})
84
+ def resume(params = {}, opts = {})
79
85
  request_stripe_object(
80
86
  method: :post,
81
- path: format("/v1/subscriptions/%<subscription>s/resume", { subscription: CGI.escape(subscription) }),
87
+ path: format("/v1/subscriptions/%<subscription>s/resume", { subscription: CGI.escape(self["id"]) }),
82
88
  params: params,
83
89
  opts: opts
84
90
  )
85
91
  end
86
92
 
87
- save_nested_resource :source
88
-
89
- # Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions.
90
- #
91
- # When you create a subscription with collection_method=charge_automatically, the first invoice is finalized as part of the request.
92
- # The payment_behavior parameter determines the exact behavior of the initial payment.
93
- #
94
- # To start subscriptions where the first invoice always begins in a draft status, use [subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules#managing) instead.
95
- # Schedules provide the flexibility to model more complex billing configurations that change over time.
96
- def self.create(params = {}, opts = {})
97
- request_stripe_object(method: :post, path: "/v1/subscriptions", params: params, opts: opts)
98
- end
99
-
100
- # By default, returns a list of subscriptions that have not been canceled. In order to list canceled subscriptions, specify status=canceled.
101
- def self.list(filters = {}, opts = {})
102
- request_stripe_object(method: :get, path: "/v1/subscriptions", params: filters, opts: opts)
93
+ # Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date.
94
+ def self.resume(subscription, params = {}, opts = {})
95
+ request_stripe_object(
96
+ method: :post,
97
+ path: format("/v1/subscriptions/%<subscription>s/resume", { subscription: CGI.escape(subscription) }),
98
+ params: params,
99
+ opts: opts
100
+ )
103
101
  end
104
102
 
105
103
  def self.search(params = {}, opts = {})
@@ -144,5 +142,7 @@ module Stripe
144
142
  opts: opts
145
143
  )
146
144
  end
145
+
146
+ save_nested_resource :source
147
147
  end
148
148
  end
@@ -8,8 +8,8 @@ module Stripe
8
8
  extend Stripe::APIOperations::Create
9
9
  include Stripe::APIOperations::Delete
10
10
  extend Stripe::APIOperations::List
11
- include Stripe::APIOperations::Save
12
11
  extend Stripe::APIOperations::NestedResource
12
+ include Stripe::APIOperations::Save
13
13
 
14
14
  OBJECT_NAME = "subscription_item"
15
15
  def self.object_name
@@ -25,52 +25,52 @@ module Stripe
25
25
  )
26
26
  end
27
27
 
28
- # Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property.
29
- def release(params = {}, opts = {})
28
+ # Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active.
29
+ def self.cancel(schedule, params = {}, opts = {})
30
30
  request_stripe_object(
31
31
  method: :post,
32
- path: format("/v1/subscription_schedules/%<schedule>s/release", { schedule: CGI.escape(self["id"]) }),
32
+ path: format("/v1/subscription_schedules/%<schedule>s/cancel", { schedule: CGI.escape(schedule) }),
33
33
  params: params,
34
34
  opts: opts
35
35
  )
36
36
  end
37
37
 
38
- # Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active.
39
- def self.cancel(schedule, params = {}, opts = {})
38
+ # Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions.
39
+ def self.create(params = {}, opts = {})
40
40
  request_stripe_object(
41
41
  method: :post,
42
- path: format("/v1/subscription_schedules/%<schedule>s/cancel", { schedule: CGI.escape(schedule) }),
42
+ path: "/v1/subscription_schedules",
43
43
  params: params,
44
44
  opts: opts
45
45
  )
46
46
  end
47
47
 
48
- # Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property.
49
- def self.release(schedule, params = {}, opts = {})
48
+ # Retrieves the list of your subscription schedules.
49
+ def self.list(filters = {}, opts = {})
50
50
  request_stripe_object(
51
- method: :post,
52
- path: format("/v1/subscription_schedules/%<schedule>s/release", { schedule: CGI.escape(schedule) }),
53
- params: params,
51
+ method: :get,
52
+ path: "/v1/subscription_schedules",
53
+ params: filters,
54
54
  opts: opts
55
55
  )
56
56
  end
57
57
 
58
- # Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions.
59
- def self.create(params = {}, opts = {})
58
+ # Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property.
59
+ def release(params = {}, opts = {})
60
60
  request_stripe_object(
61
61
  method: :post,
62
- path: "/v1/subscription_schedules",
62
+ path: format("/v1/subscription_schedules/%<schedule>s/release", { schedule: CGI.escape(self["id"]) }),
63
63
  params: params,
64
64
  opts: opts
65
65
  )
66
66
  end
67
67
 
68
- # Retrieves the list of your subscription schedules.
69
- def self.list(filters = {}, opts = {})
68
+ # Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property.
69
+ def self.release(schedule, params = {}, opts = {})
70
70
  request_stripe_object(
71
- method: :get,
72
- path: "/v1/subscription_schedules",
73
- params: filters,
71
+ method: :post,
72
+ path: format("/v1/subscription_schedules/%<schedule>s/release", { schedule: CGI.escape(schedule) }),
73
+ params: params,
74
74
  opts: opts
75
75
  )
76
76
  end
@@ -14,31 +14,31 @@ module Stripe
14
14
  "tax.calculation"
15
15
  end
16
16
 
17
- # Retrieves the line items of a persisted tax calculation as a collection.
18
- def list_line_items(params = {}, opts = {})
17
+ # Calculates tax based on input and returns a Tax Calculation object.
18
+ def self.create(params = {}, opts = {})
19
19
  request_stripe_object(
20
- method: :get,
21
- path: format("/v1/tax/calculations/%<calculation>s/line_items", { calculation: CGI.escape(self["id"]) }),
20
+ method: :post,
21
+ path: "/v1/tax/calculations",
22
22
  params: params,
23
23
  opts: opts
24
24
  )
25
25
  end
26
26
 
27
27
  # Retrieves the line items of a persisted tax calculation as a collection.
28
- def self.list_line_items(calculation, params = {}, opts = {})
28
+ def list_line_items(params = {}, opts = {})
29
29
  request_stripe_object(
30
30
  method: :get,
31
- path: format("/v1/tax/calculations/%<calculation>s/line_items", { calculation: CGI.escape(calculation) }),
31
+ path: format("/v1/tax/calculations/%<calculation>s/line_items", { calculation: CGI.escape(self["id"]) }),
32
32
  params: params,
33
33
  opts: opts
34
34
  )
35
35
  end
36
36
 
37
- # Calculates tax based on input and returns a Tax Calculation object.
38
- def self.create(params = {}, opts = {})
37
+ # Retrieves the line items of a persisted tax calculation as a collection.
38
+ def self.list_line_items(calculation, params = {}, opts = {})
39
39
  request_stripe_object(
40
- method: :post,
41
- path: "/v1/tax/calculations",
40
+ method: :get,
41
+ path: format("/v1/tax/calculations/%<calculation>s/line_items", { calculation: CGI.escape(calculation) }),
42
42
  params: params,
43
43
  opts: opts
44
44
  )
@@ -8,7 +8,6 @@ module Stripe
8
8
  # Related guide: [Using the Settings API](https://stripe.com/docs/tax/settings-api)
9
9
  class Settings < SingletonAPIResource
10
10
  include Stripe::APIOperations::SingletonSave
11
-
12
11
  OBJECT_NAME = "tax.settings"
13
12
  def self.object_name
14
13
  "tax.settings"
@@ -12,16 +12,6 @@ module Stripe
12
12
  "tax.transaction"
13
13
  end
14
14
 
15
- # Retrieves the line items of a committed standalone transaction as a collection.
16
- def list_line_items(params = {}, opts = {})
17
- request_stripe_object(
18
- method: :get,
19
- path: format("/v1/tax/transactions/%<transaction>s/line_items", { transaction: CGI.escape(self["id"]) }),
20
- params: params,
21
- opts: opts
22
- )
23
- end
24
-
25
15
  # Creates a Tax Transaction from a calculation.
26
16
  def self.create_from_calculation(params = {}, opts = {})
27
17
  request_stripe_object(
@@ -42,6 +32,16 @@ module Stripe
42
32
  )
43
33
  end
44
34
 
35
+ # Retrieves the line items of a committed standalone transaction as a collection.
36
+ def list_line_items(params = {}, opts = {})
37
+ request_stripe_object(
38
+ method: :get,
39
+ path: format("/v1/tax/transactions/%<transaction>s/line_items", { transaction: CGI.escape(self["id"]) }),
40
+ params: params,
41
+ opts: opts
42
+ )
43
+ end
44
+
45
45
  # Retrieves the line items of a committed standalone transaction as a collection.
46
46
  def self.list_line_items(transaction, params = {}, opts = {})
47
47
  request_stripe_object(