Class: Stripe::PayoutService
- Inherits:
-
StripeService
- Object
- StripeService
- Stripe::PayoutService
- Defined in:
- lib/stripe/services/payout_service.rb
Defined Under Namespace
Classes: CancelParams, CreateParams, ListParams, RetrieveParams, ReverseParams, UpdateParams
Instance Method Summary collapse
-
#cancel(payout, params = {}, opts = {}) ⇒ Object
You can cancel a previously created payout if its status is pending.
-
#create(params = {}, opts = {}) ⇒ Object
To send funds to your own bank account, create a new payout object.
-
#list(params = {}, opts = {}) ⇒ Object
Returns a list of existing payouts sent to third-party bank accounts or payouts that Stripe sent to you.
-
#retrieve(payout, params = {}, opts = {}) ⇒ Object
Retrieves the details of an existing payout.
-
#reverse(payout, params = {}, opts = {}) ⇒ Object
Reverses a payout by debiting the destination bank account.
-
#update(payout, params = {}, opts = {}) ⇒ Object
Updates the specified payout by setting the values of the parameters you pass.
Methods inherited from StripeService
#initialize, #request, #request_stream
Constructor Details
This class inherits a constructor from Stripe::StripeService
Instance Method Details
#cancel(payout, params = {}, opts = {}) ⇒ Object
You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can’t cancel automatic Stripe payouts.
170 171 172 173 174 175 176 177 178 |
# File 'lib/stripe/services/payout_service.rb', line 170 def cancel(payout, params = {}, opts = {}) request( method: :post, path: format("/v1/payouts/%<payout>s/cancel", { payout: CGI.escape(payout) }), params: params, opts: opts, base_address: :api ) end |
#create(params = {}, opts = {}) ⇒ Object
To send funds to your own bank account, create a new payout object. Your [Stripe balance](stripe.com/docs/api#balance) must cover the payout amount. If it doesn’t, you receive an “Insufficient Funds” error.
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.
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](stripe.com/docs/api#balance_object) details available and pending amounts by source type.
185 186 187 |
# File 'lib/stripe/services/payout_service.rb', line 185 def create(params = {}, opts = {}) request(method: :post, path: "/v1/payouts", params: params, opts: opts, base_address: :api) end |
#list(params = {}, opts = {}) ⇒ Object
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.
190 191 192 |
# File 'lib/stripe/services/payout_service.rb', line 190 def list(params = {}, opts = {}) request(method: :get, path: "/v1/payouts", params: params, opts: opts, base_address: :api) end |
#retrieve(payout, params = {}, opts = {}) ⇒ Object
Retrieves the details of an existing payout. Supply the unique payout ID from either a payout creation request or the payout list. Stripe returns the corresponding payout information.
195 196 197 198 199 200 201 202 203 |
# File 'lib/stripe/services/payout_service.rb', line 195 def retrieve(payout, params = {}, opts = {}) request( method: :get, path: format("/v1/payouts/%<payout>s", { payout: CGI.escape(payout) }), params: params, opts: opts, base_address: :api ) end |
#reverse(payout, params = {}, opts = {}) ⇒ Object
Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead.
By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required.
208 209 210 211 212 213 214 215 216 |
# File 'lib/stripe/services/payout_service.rb', line 208 def reverse(payout, params = {}, opts = {}) request( method: :post, path: format("/v1/payouts/%<payout>s/reverse", { payout: CGI.escape(payout) }), params: params, opts: opts, base_address: :api ) end |
#update(payout, params = {}, opts = {}) ⇒ Object
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.
219 220 221 222 223 224 225 226 227 |
# File 'lib/stripe/services/payout_service.rb', line 219 def update(payout, params = {}, opts = {}) request( method: :post, path: format("/v1/payouts/%<payout>s", { payout: CGI.escape(payout) }), params: params, opts: opts, base_address: :api ) end |