Class: Stripe::Payout

Inherits:
APIResource show all
Extended by:
APIOperations::Create, APIOperations::List
Includes:
APIOperations::Save
Defined in:
lib/stripe/resources/payout.rb

Overview

A ‘Payout` object is created when you receive funds from Stripe, or when you initiate a payout to either a bank account or debit card of a [connected Stripe account](stripe.com/docs/connect/bank-debit-card-payouts). You can retrieve individual payouts, and list all payouts. Payouts are made on [varying schedules](stripe.com/docs/connect/manage-payout-schedule), depending on your country and industry.

Related guide: [Receiving payouts](stripe.com/docs/payouts)

Constant Summary collapse

OBJECT_NAME =
"payout"

Constants inherited from StripeObject

StripeObject::RESERVED_FIELD_NAMES

Instance Attribute Summary

Attributes inherited from APIResource

#save_with_parent

Class Method Summary collapse

Instance Method Summary collapse

Methods included from APIOperations::Create

create

Methods included from APIOperations::List

list

Methods included from APIOperations::Save

included, #save

Methods inherited from APIResource

class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource

Methods included from APIOperations::Request

included

Methods inherited from StripeObject

#==, #[], #[]=, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values

Constructor Details

This class inherits a constructor from Stripe::StripeObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject

Class Method Details

.cancel(payout, params = {}, opts = {}) ⇒ Object

You can cancel a previously created payout if it hasn’t been paid out yet. Stripe refunds the funds to your available balance. You can’t cancel automatic Stripe payouts.



43
44
45
46
47
48
49
50
# File 'lib/stripe/resources/payout.rb', line 43

def self.cancel(payout, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/payouts/%<payout>s/cancel", { payout: CGI.escape(payout) }),
    params: params,
    opts: opts
  )
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 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.



55
56
57
58
59
60
61
62
# File 'lib/stripe/resources/payout.rb', line 55

def self.reverse(payout, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/payouts/%<payout>s/reverse", { payout: CGI.escape(payout) }),
    params: params,
    opts: opts
  )
end

Instance Method Details

#cancel(params = {}, opts = {}) ⇒ Object

You can cancel a previously created payout if it hasn’t been paid out yet. Stripe refunds the funds to your available balance. You can’t cancel automatic Stripe payouts.



21
22
23
24
25
26
27
28
# File 'lib/stripe/resources/payout.rb', line 21

def cancel(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/payouts/%<payout>s/cancel", { payout: CGI.escape(self["id"]) }),
    params: params,
    opts: opts
  )
end

#reverse(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 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.



33
34
35
36
37
38
39
40
# File 'lib/stripe/resources/payout.rb', line 33

def reverse(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/payouts/%<payout>s/reverse", { payout: CGI.escape(self["id"]) }),
    params: params,
    opts: opts
  )
end