Stripe.Resources.Refund (tiger_stripe v0.3.0)

Copy Markdown View Source

Refund

Refund objects allow you to refund a previously created charge that isn't refunded yet. Funds are refunded to the credit or debit card that's initially charged.

Related guide: Refunds

Summary

Types

destination_details()

@type destination_details() :: %{
  optional(:affirm) => map() | nil,
  optional(:afterpay_clearpay) => map() | nil,
  optional(:alipay) => map() | nil,
  optional(:alma) => map() | nil,
  optional(:amazon_pay) => map() | nil,
  optional(:au_bank_transfer) => map() | nil,
  optional(:blik) => destination_details_blik() | nil,
  optional(:br_bank_transfer) => destination_details_br_bank_transfer() | nil,
  optional(:card) => destination_details_card() | nil,
  optional(:cashapp) => map() | nil,
  optional(:crypto) => destination_details_crypto() | nil,
  optional(:customer_cash_balance) => map() | nil,
  optional(:eps) => map() | nil,
  optional(:eu_bank_transfer) => destination_details_eu_bank_transfer() | nil,
  optional(:gb_bank_transfer) => destination_details_gb_bank_transfer() | nil,
  optional(:giropay) => map() | nil,
  optional(:grabpay) => map() | nil,
  optional(:jp_bank_transfer) => destination_details_jp_bank_transfer() | nil,
  optional(:klarna) => map() | nil,
  optional(:mb_way) => destination_details_mb_way() | nil,
  optional(:multibanco) => destination_details_multibanco() | nil,
  optional(:mx_bank_transfer) => destination_details_mx_bank_transfer() | nil,
  optional(:nz_bank_transfer) => map() | nil,
  optional(:p24) => destination_details_p24() | nil,
  optional(:paynow) => map() | nil,
  optional(:paypal) => destination_details_paypal() | nil,
  optional(:pix) => map() | nil,
  optional(:revolut) => map() | nil,
  optional(:sofort) => map() | nil,
  optional(:swish) => destination_details_swish() | nil,
  optional(:th_bank_transfer) => destination_details_th_bank_transfer() | nil,
  optional(:twint) => map() | nil,
  optional(:type) => String.t() | nil,
  optional(:us_bank_transfer) => destination_details_us_bank_transfer() | nil,
  optional(:wechat_pay) => map() | nil,
  optional(:zip) => map() | nil,
  optional(String.t()) => term()
}
  • affirm
  • afterpay_clearpay
  • alipay
  • alma
  • amazon_pay
  • au_bank_transfer
  • blik
  • br_bank_transfer
  • card
  • cashapp
  • crypto
  • customer_cash_balance
  • eps
  • eu_bank_transfer
  • gb_bank_transfer
  • giropay
  • grabpay
  • jp_bank_transfer
  • klarna
  • mb_way
  • multibanco
  • mx_bank_transfer
  • nz_bank_transfer
  • p24
  • paynow
  • paypal
  • pix
  • revolut
  • sofort
  • swish
  • th_bank_transfer
  • twint
  • type - The type of transaction-specific details of the payment method used in the refund (e.g., card). An additional hash is included on destination_details with a name matching this value. It contains information specific to the refund transaction. Max length: 5000.
  • us_bank_transfer
  • wechat_pay
  • zip

destination_details_blik()

@type destination_details_blik() :: %{
  optional(:network_decline_code) => String.t() | nil,
  optional(:reference) => String.t() | nil,
  optional(:reference_status) => String.t() | nil,
  optional(String.t()) => term()
}
  • network_decline_code - For refunds declined by the network, a decline code provided by the network which indicates the reason the refund failed. Max length: 5000. Nullable.
  • reference - The reference assigned to the refund. Max length: 5000. Nullable.
  • reference_status - Status of the reference on the refund. This can be pending, available or unavailable. Max length: 5000. Nullable.

destination_details_br_bank_transfer()

@type destination_details_br_bank_transfer() :: %{
  optional(:reference) => String.t() | nil,
  optional(:reference_status) => String.t() | nil,
  optional(String.t()) => term()
}
  • reference - The reference assigned to the refund. Max length: 5000. Nullable.
  • reference_status - Status of the reference on the refund. This can be pending, available or unavailable. Max length: 5000. Nullable.

destination_details_card()

@type destination_details_card() :: %{
  optional(:reference) => String.t() | nil,
  optional(:reference_status) => String.t() | nil,
  optional(:reference_type) => String.t() | nil,
  optional(:type) => String.t() | nil,
  optional(String.t()) => term()
}
  • reference - Value of the reference number assigned to the refund. Max length: 5000.
  • reference_status - Status of the reference number on the refund. This can be pending, available or unavailable. Max length: 5000.
  • reference_type - Type of the reference number assigned to the refund. Max length: 5000.
  • type - The type of refund. This can be refund, reversal, or pending. Possible values: pending, refund, reversal.

destination_details_crypto()

@type destination_details_crypto() :: %{
  optional(:reference) => String.t() | nil,
  optional(String.t()) => term()
}
  • reference - The transaction hash of the refund. Max length: 5000. Nullable.

destination_details_eu_bank_transfer()

@type destination_details_eu_bank_transfer() :: %{
  optional(:reference) => String.t() | nil,
  optional(:reference_status) => String.t() | nil,
  optional(String.t()) => term()
}
  • reference - The reference assigned to the refund. Max length: 5000. Nullable.
  • reference_status - Status of the reference on the refund. This can be pending, available or unavailable. Max length: 5000. Nullable.

destination_details_gb_bank_transfer()

@type destination_details_gb_bank_transfer() :: %{
  optional(:reference) => String.t() | nil,
  optional(:reference_status) => String.t() | nil,
  optional(String.t()) => term()
}
  • reference - The reference assigned to the refund. Max length: 5000. Nullable.
  • reference_status - Status of the reference on the refund. This can be pending, available or unavailable. Max length: 5000. Nullable.

destination_details_jp_bank_transfer()

@type destination_details_jp_bank_transfer() :: %{
  optional(:reference) => String.t() | nil,
  optional(:reference_status) => String.t() | nil,
  optional(String.t()) => term()
}
  • reference - The reference assigned to the refund. Max length: 5000. Nullable.
  • reference_status - Status of the reference on the refund. This can be pending, available or unavailable. Max length: 5000. Nullable.

destination_details_mb_way()

@type destination_details_mb_way() :: %{
  optional(:reference) => String.t() | nil,
  optional(:reference_status) => String.t() | nil,
  optional(String.t()) => term()
}
  • reference - The reference assigned to the refund. Max length: 5000. Nullable.
  • reference_status - Status of the reference on the refund. This can be pending, available or unavailable. Max length: 5000. Nullable.

destination_details_multibanco()

@type destination_details_multibanco() :: %{
  optional(:reference) => String.t() | nil,
  optional(:reference_status) => String.t() | nil,
  optional(String.t()) => term()
}
  • reference - The reference assigned to the refund. Max length: 5000. Nullable.
  • reference_status - Status of the reference on the refund. This can be pending, available or unavailable. Max length: 5000. Nullable.

destination_details_mx_bank_transfer()

@type destination_details_mx_bank_transfer() :: %{
  optional(:reference) => String.t() | nil,
  optional(:reference_status) => String.t() | nil,
  optional(String.t()) => term()
}
  • reference - The reference assigned to the refund. Max length: 5000. Nullable.
  • reference_status - Status of the reference on the refund. This can be pending, available or unavailable. Max length: 5000. Nullable.

destination_details_p24()

@type destination_details_p24() :: %{
  optional(:reference) => String.t() | nil,
  optional(:reference_status) => String.t() | nil,
  optional(String.t()) => term()
}
  • reference - The reference assigned to the refund. Max length: 5000. Nullable.
  • reference_status - Status of the reference on the refund. This can be pending, available or unavailable. Max length: 5000. Nullable.

destination_details_paypal()

@type destination_details_paypal() :: %{
  optional(:network_decline_code) => String.t() | nil,
  optional(String.t()) => term()
}
  • network_decline_code - For refunds declined by the network, a decline code provided by the network which indicates the reason the refund failed. Max length: 5000. Nullable.

destination_details_swish()

@type destination_details_swish() :: %{
  optional(:network_decline_code) => String.t() | nil,
  optional(:reference) => String.t() | nil,
  optional(:reference_status) => String.t() | nil,
  optional(String.t()) => term()
}
  • network_decline_code - For refunds declined by the network, a decline code provided by the network which indicates the reason the refund failed. Max length: 5000. Nullable.
  • reference - The reference assigned to the refund. Max length: 5000. Nullable.
  • reference_status - Status of the reference on the refund. This can be pending, available or unavailable. Max length: 5000. Nullable.

destination_details_th_bank_transfer()

@type destination_details_th_bank_transfer() :: %{
  optional(:reference) => String.t() | nil,
  optional(:reference_status) => String.t() | nil,
  optional(String.t()) => term()
}
  • reference - The reference assigned to the refund. Max length: 5000. Nullable.
  • reference_status - Status of the reference on the refund. This can be pending, available or unavailable. Max length: 5000. Nullable.

destination_details_us_bank_transfer()

@type destination_details_us_bank_transfer() :: %{
  optional(:reference) => String.t() | nil,
  optional(:reference_status) => String.t() | nil,
  optional(String.t()) => term()
}
  • reference - The reference assigned to the refund. Max length: 5000. Nullable.
  • reference_status - Status of the reference on the refund. This can be pending, available or unavailable. Max length: 5000. Nullable.

next_action()

@type next_action() :: %{
  optional(:display_details) => next_action_display_details() | nil,
  optional(:type) => String.t() | nil,
  optional(String.t()) => term()
}
  • display_details
  • type - Type of the next action to perform. Max length: 5000.

next_action_display_details()

@type next_action_display_details() :: %{
  optional(:email_sent) => next_action_display_details_email_sent() | nil,
  optional(:expires_at) => integer() | nil,
  optional(String.t()) => term()
}
  • email_sent
  • expires_at - The expiry timestamp. Format: Unix timestamp.

next_action_display_details_email_sent()

@type next_action_display_details_email_sent() :: %{
  optional(:email_sent_at) => integer() | nil,
  optional(:email_sent_to) => String.t() | nil,
  optional(String.t()) => term()
}
  • email_sent_at - The timestamp when the email was sent. Format: Unix timestamp.
  • email_sent_to - The recipient's email address. Max length: 5000.

presentment_details()

@type presentment_details() :: %{
  optional(:presentment_amount) => integer() | nil,
  optional(:presentment_currency) => String.t() | nil,
  optional(String.t()) => term()
}
  • presentment_amount - Amount intended to be collected by this payment, denominated in presentment_currency.
  • presentment_currency - Currency presented to the customer during payment. Max length: 5000.

t()

@type t() :: %Stripe.Resources.Refund{
  amount: integer(),
  balance_transaction: String.t() | Stripe.Resources.BalanceTransaction.t(),
  charge: String.t() | Stripe.Resources.Charge.t(),
  created: integer(),
  currency: String.t(),
  description: String.t() | nil,
  destination_details: destination_details() | nil,
  failure_balance_transaction:
    String.t() | Stripe.Resources.BalanceTransaction.t() | nil,
  failure_reason: String.t() | nil,
  id: String.t(),
  instructions_email: String.t() | nil,
  metadata: %{required(String.t()) => String.t()},
  next_action: next_action() | nil,
  object: String.t(),
  payment_intent: String.t() | Stripe.Resources.PaymentIntent.t(),
  pending_reason: String.t() | nil,
  presentment_details: presentment_details() | nil,
  reason: String.t(),
  receipt_number: String.t(),
  source_transfer_reversal: String.t() | Stripe.Resources.TransferReversal.t(),
  status: String.t(),
  transfer_reversal: String.t() | Stripe.Resources.TransferReversal.t()
}
  • amount - Amount, in cents (or local equivalent).
  • balance_transaction - Balance transaction that describes the impact on your account balance. Nullable. Expandable.
  • charge - ID of the charge that's refunded. Nullable. Expandable.
  • created - Time at which the object was created. Measured in seconds since the Unix epoch. Format: Unix timestamp.
  • currency - Three-letter ISO currency code, in lowercase. Must be a supported currency. Format: ISO 4217 currency code.
  • description - An arbitrary string attached to the object. You can use this for displaying to users (available on non-card refunds only). Max length: 5000.
  • destination_details - Expandable.
  • failure_balance_transaction - After the refund fails, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction. Expandable.
  • failure_reason - Provides the reason for the refund failure. Possible values are: lost_or_stolen_card, expired_or_canceled_card, charge_for_pending_refund_disputed, insufficient_funds, declined, merchant_request, or unknown. Max length: 5000.
  • id - Unique identifier for the object. Max length: 5000.
  • instructions_email - For payment methods without native refund support (for example, Konbini, PromptPay), provide an email address for the customer to receive refund instructions. Max length: 5000.
  • 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. Nullable.
  • next_action - Expandable.
  • object - String representing the object's type. Objects of the same type share the same value. Possible values: refund.
  • payment_intent - ID of the PaymentIntent that's refunded. Nullable. Expandable.
  • pending_reason - Provides the reason for why the refund is pending. Possible values are: processing, insufficient_funds, or charge_pending. Possible values: charge_pending, insufficient_funds, processing.
  • presentment_details - Expandable.
  • reason - Reason for the refund, which is either user-provided (duplicate, fraudulent, or requested_by_customer) or generated by Stripe internally (expired_uncaptured_charge). Possible values: duplicate, expired_uncaptured_charge, fraudulent, requested_by_customer. Nullable.
  • receipt_number - This is the transaction number that appears on email receipts sent for this refund. Max length: 5000. Nullable.
  • source_transfer_reversal - The transfer reversal that's associated with the refund. Only present if the charge came from another Stripe account. Nullable. Expandable.
  • status - Status of the refund. This can be pending, requires_action, succeeded, failed, or canceled. Learn more about failed refunds. Max length: 5000. Nullable.
  • transfer_reversal - This refers to the transfer reversal object if the accompanying transfer reverses. This is only applicable if the charge was created using the destination parameter. Nullable. Expandable.

Functions

expandable_fields()

object_name()