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.

t()

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 address() :: %{
  optional(:city) => binary(),
  optional(:country) => binary(),
  optional(:line1) => binary(),
  optional(:line2) => binary(),
  optional(:postal_code) => binary(),
  optional(:state) => binary()
}
@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.

Link to this type

destination_payment_method_data()

View Source
@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.

Link to this type

destination_payment_method_options()

View Source
@type destination_payment_method_options() :: %{
  optional(:us_bank_account) => us_bank_account() | binary()
}

Payment method-specific configuration for this OutboundPayment.

@type end_user_details() :: %{
  optional(:ip_address) => binary(),
  optional(:present) => boolean()
}

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.

  • amount Amount (in cents) transferred.
  • cancelable Returns true if the object can be canceled, and false otherwise.
  • created Time at which the object was created. Measured in seconds since the Unix epoch.
  • currency Three-letter ISO currency code, in lowercase. Must be a supported currency.
  • customer ID of the customer to whom an OutboundPayment is sent.
  • description An arbitrary string attached to the object. Often useful for displaying to users.
  • destination_payment_method The PaymentMethod via which an OutboundPayment is sent. This field can be empty if the OutboundPayment was created using destination_payment_method_data.
  • destination_payment_method_details Details about the PaymentMethod for an OutboundPayment.
  • end_user_details Details about the end user.
  • expected_arrival_date The date when funds are expected to arrive in the destination account.
  • financial_account The FinancialAccount that funds were pulled from.
  • hosted_regulatory_receipt_url A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses.
  • id Unique identifier for the object.
  • livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode.
  • metadata Set 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.
  • object String representing the object's type. Objects of the same type share the same value.
  • returned_details Details about a returned OutboundPayment. Only set when the status is returned.
  • statement_descriptor The description that appears on the receiving end for an OutboundPayment (for example, bank statement for external bank transfer).
  • status Current status of the OutboundPayment: processing, failed, posted, returned, canceled. An OutboundPayment is processing if it has been created and is pending. The status changes to posted once the OutboundPayment has been "confirmed" and funds have left the account, or to failed or canceled. If an OutboundPayment fails to arrive at its destination, its status will change to returned.
  • status_transitions
  • transaction The Transaction associated with this object.
@type us_bank_account() :: %{optional(:network) => :ach | :us_domestic_wire}

Functions

Link to this function

cancel(id, params \\ %{}, opts \\ [])

View Source
@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
Link to this function

create(params \\ %{}, opts \\ [])

View Source
@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
Link to this function

fail(id, params \\ %{}, opts \\ [])

View Source
@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
Link to this function

list(params \\ %{}, opts \\ [])

View Source
@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
Link to this function

post(id, params \\ %{}, opts \\ [])

View Source
@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
Link to this function

retrieve(id, params \\ %{}, opts \\ [])

View Source
@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}
Link to this function

return_outbound_payment(id, params \\ %{}, opts \\ [])

View Source
@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