UNPKG

@bebapps/rapyd-sdk

Version:

An un-official [Rapyd](https://rapyd.net) SDK for Node.js.

111 lines (110 loc) 4.64 kB
export interface Refund { /** * ID of the Refund object. String starting with **refund_**. */ id: `refund_${string}`; /** * Amount of the refund, in units defined by `currency`. Decimal, including the correct number of decimal places for the currency exponent, as defined in ISO 2417:2015. If the amount is a whole number, use an integer and not a decimal. * * If this parameter is omitted in the 'Create Refund' request, the refund is for the entire remaining amount of the 'payment' object. For more information, see ***Create Refund - Request Parameters*** below. */ amount: number; /** * The unrefunded amount remaining on the payment. Response only. */ balance_transaction: string; /** * Time of creation of this refund, in [*Unix time*](ref:glossary). Response only. */ created_at: number; /** * Three-letter ISO 4217 code for the currency used in the `amount` parameter. Response only. */ currency: string; /** * An array of one or more objects that represent wallets that the refund is charged to. Each object contains the following fields: * * `ewallet` - The ID of the wallet, a string starting with **ewallet_**. Required. * * `amount` - The amount of the refund charged to this wallet. Decimal. Required when `percentage` is not used. * * `percent` - The percentage of the refund charged to this wallet. Decimal between 0 and 100. Required when `amount` is not used. * * **Note:** All wallets must specify `amount` or all wallets must specify `percentage`. * * For more information, see ***Create Refund - Request Parameters*** below. */ ewallets: ({ ewallet: unknown; amount: unknown; percent: unknown })[]; /** * Indicates the reason that the refund failed. One of the following: * * **lost_or_stolen_card** * * **expired_or_canceled_card** * * **unknown** * * Response only. */ failure_reason: 'lost_or_stolen_card' | 'expired_or_canceled_card' | 'unknown'; /** * Indicates whether the FX rate is fixed for the buy side or for the sell side. Relevant for refunds with foreign exchange. Response only. */ fixed_side: string; /** * Exchange rate for the transaction. When `fixed_side` is **buy**, `fx_rate` is the buy rate. When `fixed_side` is **sell**, `fx_rate` is the sell rate. * Decimal number as string. * Relevant to refunds with foreign exchange. Response only. */ fx_rate: string; /** * Merchant-defined ID. Limited to 255 characters. */ merchant_reference_id: string; /** * A JSON object defined by the client. */ metadata: object; /** * Amount debited from the merchant. Relevant to refunds with foreign exchange. Response only. */ merchant_debited_amount: string; /** * Indicates the currency that is debited from the merchant. Three-letter ISO 4217 code. Relevant to refunds with foreign exchange. Response only. */ merchant_debited_currency: string; /** * ID of the Payment object that the refund is credited against. * String starting with **payment_**. * * For more information, see [Payment Object](ref:payment-object). */ payment: `payment_${string}`; /** * Time that the original payment was created, in [*Unix time*](ref:glossary). Response only. */ payment_created_at: number; /** * The original payment payment method type. Use [List Payment Methods by Country](ref:list-payment-methods-by-country) for a list of supported types for a country */ payment_method_type: string; /** * Indicates whether the refund was returned in proportion to the amounts received by the wallets in the payment. Relevant to a refund for a payment split among multiple wallets. */ proportional_refund: boolean; /** * Description of the reason for the refund, provided by the merchant. */ reason: string; /** * Number of the receipt for the refund, provided by the merchant. Response only. */ receipt_number: string; /** * Indicates the status of the refund operation. One of the following values: * * **Completed** - The refund was complete. * * **Rejected** - The refund was not made because of an internal error. * * **Pending** - The request created a refund object on the Rapyd platform, but the refund is not yet complete. For example, the refund is for a payment method that requires a customer action, such as cash, bank redirect or bank transfer. * * Read-only. */ status: 'Completed' | 'Rejected' | 'Pending'; /** * Time that this refund was last updated, in [*Unix time*](ref:glossary). Response only. */ updated_at: number; };