View Source Stripe.Treasury.OutboundPayment (stripity_stripe v3.2.0)
Use OutboundPayments to send funds to another party's external bank account or FinancialAccount. To send money to an account belonging to the same user, use an OutboundTransfer.
Simulate OutboundPayment state changes with the /v1/test_helpers/treasury/outbound_payments endpoints. These methods can only be called on test mode objects.
Summary
Types
Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
Hash used to generate the PaymentMethod to be used for this OutboundPayment. Exclusive with destination_payment_method.
Payment method-specific configuration for this OutboundPayment.
End user details.
Optional hash to set the the return code.
The treasury.outbound_payment type.
Functions
Cancel an OutboundPayment.
Creates an OutboundPayment.
Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state.
Returns a list of OutboundPayments sent from the specified FinancialAccount.
Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state.
Retrieves the details of an existing OutboundPayment by passing the unique OutboundPayment ID from either the OutboundPayment creation request or OutboundPayment list.
Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state.
Types
@type billing_details() :: %{ optional(:address) => address() | binary(), optional(:email) => binary() | binary(), optional(:name) => binary() | binary(), optional(:phone) => binary() | binary() }
Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
@type destination_payment_method_data() :: %{ optional(:billing_details) => billing_details(), optional(:financial_account) => binary(), optional(:metadata) => %{optional(binary()) => binary()}, optional(:type) => :financial_account | :us_bank_account, optional(:us_bank_account) => us_bank_account() }
Hash used to generate the PaymentMethod to be used for this OutboundPayment. Exclusive with destination_payment_method.
@type destination_payment_method_options() :: %{ optional(:us_bank_account) => us_bank_account() | binary() }
Payment method-specific configuration for this OutboundPayment.
End user details.
@type returned_details() :: %{
  optional(:code) =>
    :account_closed
    | :account_frozen
    | :bank_account_restricted
    | :bank_ownership_changed
    | :declined
    | :incorrect_account_holder_name
    | :invalid_account_number
    | :invalid_currency
    | :no_account
    | :other
}
      Optional hash to set the the return code.
@type t() :: %Stripe.Treasury.OutboundPayment{ amount: integer(), cancelable: boolean(), created: integer(), currency: binary(), customer: binary() | nil, description: binary() | nil, destination_payment_method: binary() | nil, destination_payment_method_details: term() | nil, end_user_details: term() | nil, expected_arrival_date: integer(), financial_account: binary(), hosted_regulatory_receipt_url: binary() | nil, id: binary(), livemode: boolean(), metadata: term(), object: binary(), returned_details: term() | nil, statement_descriptor: binary(), status: binary(), status_transitions: term(), transaction: binary() | Stripe.Treasury.Transaction.t() }
The treasury.outbound_payment type.
amountAmount (in cents) transferred.cancelableReturnstrueif the object can be canceled, andfalseotherwise.createdTime at which the object was created. Measured in seconds since the Unix epoch.currencyThree-letter ISO currency code, in lowercase. Must be a supported currency.customerID of the customer to whom an OutboundPayment is sent.descriptionAn arbitrary string attached to the object. Often useful for displaying to users.destination_payment_methodThe PaymentMethod via which an OutboundPayment is sent. This field can be empty if the OutboundPayment was created usingdestination_payment_method_data.destination_payment_method_detailsDetails about the PaymentMethod for an OutboundPayment.end_user_detailsDetails about the end user.expected_arrival_dateThe date when funds are expected to arrive in the destination account.financial_accountThe FinancialAccount that funds were pulled from.hosted_regulatory_receipt_urlA hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses.idUnique identifier for the object.livemodeHas the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.metadataSet of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.objectString representing the object's type. Objects of the same type share the same value.returned_detailsDetails about a returned OutboundPayment. Only set when the status isreturned.statement_descriptorThe description that appears on the receiving end for an OutboundPayment (for example, bank statement for external bank transfer).statusCurrent status of the OutboundPayment:processing,failed,posted,returned,canceled. An OutboundPayment isprocessingif it has been created and is pending. The status changes topostedonce the OutboundPayment has been "confirmed" and funds have left the account, or tofailedorcanceled. If an OutboundPayment fails to arrive at its destination, its status will change toreturned.status_transitionstransactionThe Transaction associated with this object.
@type us_bank_account() :: %{optional(:network) => :ach | :us_domestic_wire}
      Functions
@spec cancel( id :: binary(), params :: %{optional(:expand) => [binary()]}, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Cancel an OutboundPayment.
Details
- Method: 
post - Path: 
/v1/treasury/outbound_payments/{id}/cancel 
@spec create( params :: %{ optional(:amount) => integer(), optional(:currency) => binary(), optional(:customer) => binary(), optional(:description) => binary(), optional(:destination_payment_method) => binary(), optional(:destination_payment_method_data) => destination_payment_method_data(), optional(:destination_payment_method_options) => destination_payment_method_options(), optional(:end_user_details) => end_user_details(), optional(:expand) => [binary()], optional(:financial_account) => binary(), optional(:metadata) => %{optional(binary()) => binary()}, optional(:statement_descriptor) => binary() }, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Creates an OutboundPayment.
Details
- Method: 
post - Path: 
/v1/treasury/outbound_payments 
@spec fail( id :: binary(), params :: %{optional(:expand) => [binary()]}, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state.
Details
- Method: 
post - Path: 
/v1/test_helpers/treasury/outbound_payments/{id}/fail 
@spec list( params :: %{ optional(:customer) => binary(), optional(:ending_before) => binary(), optional(:expand) => [binary()], optional(:financial_account) => binary(), optional(:limit) => integer(), optional(:starting_after) => binary(), optional(:status) => :canceled | :failed | :posted | :processing | :returned }, opts :: Keyword.t() ) :: {:ok, Stripe.List.t(t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Returns a list of OutboundPayments sent from the specified FinancialAccount.
Details
- Method: 
get - Path: 
/v1/treasury/outbound_payments 
@spec post( id :: binary(), params :: %{optional(:expand) => [binary()]}, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state.
Details
- Method: 
post - Path: 
/v1/test_helpers/treasury/outbound_payments/{id}/post 
@spec retrieve( id :: binary(), params :: %{optional(:expand) => [binary()]}, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Retrieves the details of an existing OutboundPayment by passing the unique OutboundPayment ID from either the OutboundPayment creation request or OutboundPayment list.
Details
- Method: 
get - Path: 
/v1/treasury/outbound_payments/{id} 
@spec return_outbound_payment( id :: binary(), params :: %{ optional(:expand) => [binary()], optional(:returned_details) => returned_details() }, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state.
Details
- Method: 
post - Path: 
/v1/test_helpers/treasury/outbound_payments/{id}/return