@bebapps/rapyd-sdk
Version:
An un-official [Rapyd](https://rapyd.net) SDK for Node.js.
342 lines (340 loc) • 12.1 kB
text/typescript
import { Address } from '../../collect/types/Address';
export interface ActionData {
/**
* 'address' object. For details, see [Address Object](ref:address-object).
*/
address: Partial<Address>;
/**
* Amount of the transaction, in units defined in `currency`.
*/
amount: number;
/**
* Indicates that the payment has been successfully captured. Read-only.
*/
captured: boolean;
/**
* Reserved.
*/
client_type: string;
/**
* URL where the customer is redirected for final steps in completing the payment. Read-only.
*/
complete_payment_url: string;
/**
* Country of the sender. Two-letter ISO 3166-1 ALPHA-2 code. Uppercase.
*/
country_code: string;
/**
* Time of creation of the transaction object, in [*Unix time*](ref:glossary). Read-only.
*/
created_at: number;
/**
* The transaction currency. In transactions with foreign exchange, this is the source currency.
* Three-letter ISO 4217 code for the currency. Uppercase.
*/
currency_code: string;
/**
* ID of the customer who is making the payment. String starting with **cus_**. Required if `payment_method` is blank.
* For more information, see [Customer Object](ref:customer-object).
*/
customer_token: `cus_${string}`;
/**
* Description of the transaction.
*/
description: string;
/**
* The destination currency in transactions with foreign exchange.
* Three-letter ISO 4217 code for the currency. Uppercase.
*/
dest_currency: string;
/**
* A URL link to the symbol of the destination currency .
*/
dest_currency_symbol: string;
/**
* Details about the dispute, if the transaction was disputed. Read-only.
*/
dispute: string;
/**
* Reserved.
*/
destination_city_id: string;
/**
* ID of the wallet that the money is transferred to. String starting with **ewallet_**.
*/
destination_ewallet_id: `ewallet_${string}`;
/**
* URL where the customer is redirected in case of an error in the payment.
*/
error_payment_url: string;
/**
* Determines whether the payment is held in escrow for later release. Relevant for card payments.
* Relevant to the request.
*/
escrow: string;
/**
* ID of the wallet that the money is transferred from. String starting with **ewallet_**.
*/
ewallet_id: `ewallet_${string}`;
/**
* An array of one object, which contains the following fields:
* * **ewallet_id** - The ID of the wallet that the money is transferred from, a string starting with **ewallet_**.
* * **amount** - Amount of the transaction in currency units defined in `currency`.
* * **percent** - A decimal number representing a percentage of the total payout.
* Read-only.
*/
ewallets: (object)[];
/**
* Determines the time which the transaction must be completed by, in [*Unix time*](ref:glossary).
*/
expiration: number;
/**
* Determines the time which the transaction must be completed by, in [*Unix time*](ref:glossary). Relevant to cash payouts.
*/
expired_at: number;
/**
* Error code explaining reason for failure of the transaction. Read-only.
*/
failure_code: string;
/**
* Message to the merchant, explaining the reason for failure of payment capture. Read-only.
*/
failure_message: string;
/**
* Determines whether the FX rate is fixed for the buy side or for the sell side. Relevant for payment with FX.
*/
fixed_side: string;
/**
* Indicates the type of payment flow. Read-only. One of the following:
* * **redirect_url** - The customer is directed to a URL to complete the transaction.
* * **self_service_pos** - The customer completes the transaction at a point-of-sale location.
* * **bank_transfer** - The customer completes the transaction at the bank branch or bank website.
* * **card** - The transaction is completed immediately or on request of the merchant.
* * **ewallet** - The transaction is completed immediately or when funds are released from escrow.
*/
flow_type: 'redirect_url' | 'self_service_pos' | 'bank_transfer' | 'card' | 'ewallet';
/**
* Currency conversion rate for the transaction. Decimal. Read-only.
*/
fx_rate: string;
/**
* ID of the group payment. Relevant when the payment is part of a group payment. Read-only.
* The ID of the group payment, a string starting with 'gp_'.
*/
group_payment: string;
/**
* ID of the transaction.
*/
id: string;
/**
* Describes how the customer makes the payment.
* Contains the following fields:
* * **name** - Description of the payment method.
* * **steps** - A 'steps' object containing a list of steps for the customer to take. Each step is named step*N*, where *N* is an integer.
* Read-only.
*/
instructions: object;
/**
* ID of the invoice that this payment is for. String starting with **inv_**. Read-only.
*/
invoice: `inv_${string}`;
/**
* Indicates that the payment is a group payment.
*/
is_group: boolean;
/**
* Indicates that the payment has been partially paid. When **false**, indicates that the payment is unpaid or fully paid. Read-only.
*/
is_partial: boolean;
/**
* Merchant-defined ID. Limited to 255 characters.
*/
merchant_reference_id: string;
/**
* The amount of the payment in units of the currency paid by the sender, as defined in `merchant_requested_currency`. Relevant to payments with foreign exchange. Read only.
*/
merchant_requested_amount: number;
/**
* The currency that the payment is converted into. Corresponds to `currency` in the request. Three-letter ISO 4217 code. Uppercase. Relevant to payments with foreign exchange. Read only.
*/
merchant_requested_currency: string;
/**
* A JSON object defined by the Rapyd partner.
*/
metadata: object;
/**
* ID of the order that this payment is for. Read-only. Relevant when the payment is for an order.
*/
order: string;
/**
* Value depends on the transaction type:
* * **Foreign exchange payments** - The amount paid by the sender, in units of the currency defined in `requested_currency`, including gross transaction fees and gross FX fees.
*
* * **Payments not involving foreign exchange** - The amount of the payment, in units of the currency defined in `currency`, including gross transaction fees.
* Read-only.
*/
original_amount: number;
/**
* Contains the following fields:
* * `network_status` - Network status of the payment. One of the following:
* * **approved_by_network**
* * **declined_by_network**
* * **not_sent_to_network**
* * **reversed_after_approval**
* * `risk_level` - Assessment of the risk level of the payment.One of the following:
* * **normal**
* * **elevated**
* * **highest**
* * **not_assessed**
* * `seller_message` - Message to the merchant.
* * `type` - One of the following:
* * **authorized**
* * **manual_review**
* * **issuer_declined**
* * **blocked**
* * **invalid**
* * `reason` - More detailed indication of the reason indicated by `type`. One of the following:
* * **highest_risk_level** - Blocked by default rules.
* * **elevated_risk_level** - Placed in review by default rules.
* * **rule** - Placed in review by rules defined by the client. Read-only.
*/
outcome: { network_status: unknown; risk_level: unknown; seller_message: unknown; type: unknown; reason: unknown };
/**
* Indicates whether the payment has been fully collected. Read-only.
*/
paid: boolean;
/**
* Time of the transaction, in [*Unix time*](ref:glossary). Read-only.
*/
paid_at: number;
/**
* Defines transaction fees and foreign exchange fees.
*/
payment_fees: object;
/**
* 'payment_method' object or ID. If not specified in this field, the payment method is the default payment method specified for the customer.
*
* The 'payment_method' object contains a `type` field and a `fields` object. For more information, see [Payment Method Object](#payment-method-object).
*/
payment_method: string | object;
/**
* Object describing additional information required for the payment. To determine the fields required, run [Get Payment Method Required Fields](ref:get-payment-method-required-fields).
*/
payment_method_options: object;
/**
* The type of transaction method, payment or payout type.
* Use [List Payout Method Types](ref:list-payout-method-types) or [List Payment Method Types](ref:list-payment-method-types) for a list of supported types for a country.
*/
payment_method_type: string;
/**
* Category of payment method type. Read-only. One of the following:
* * **bank_transfer**
* * **bank_redirect**
* * **card**
* * **cash**
*/
payment_method_type_category: 'bank_transfer' | 'bank_redirect' | 'card' | 'cash';
/**
* The customer's primary phone number in E.164 format. The merchant is responsible for verifying that the number is correct. One method of verifying might be to send an activation code to the phone by SMS, with a limited time for response.
*/
phone_number: string;
/**
* Reserved.
*/
price_before_changes: string;
/**
* Indicates that the payment is a group payment and refund is made in proportion between group payers.
*/
proportional_refund: boolean;
/**
* ID of the currency exchange quote.
*/
quote_id: string;
/**
* Reserved.
*/
quotes_comparisons: object;
/**
* Reason for issuing the transaction. Free text.
*/
reason: string;
/**
* Email address that the receipt for this transaction is sent to.
*/
receipt_email: string;
/**
* Reserved.
*/
receipt_number: string;
/**
* URL where the customer can complete a payment. Relevant when `payment_flow_type` is **redirect**. Read-only.
*/
redirect_url: string;
/**
* Indicates whether there was a refund against this payment. Read-only.
*/
refunded: boolean;
/**
* The total amount refunded against this payment, in units of the currency defined in `currency`. Read-only.
*/
refunded_amount: number;
/**
* An object containing the following fields:
* * `data` - A list of up to three refunds.
* * `has_more` - Indicates whether there are more than three refunds against this payment.
* * `total_count` - Total number of refunds against this payment.
* * `url` - URL for requesting all of the refunds against this payment.
* Read-only.
*/
refunds: { data: unknown; has_more: unknown; total_count: unknown; url: unknown };
/**
* Reserved.
*/
rewards: object;
/**
* ID of the wallet that the money is transferred from. String starting with **ewallet_**.
*/
source_wallet_id: `ewallet_${string}`;
/**
* The source currency in transactions with foreign exchange.
* Three-letter ISO 4217 code for the currency. Uppercase.
*/
src_currency: string;
/**
* A URL link to the source-currency symbol.
*/
src_currency_symbol: string;
/**
* A text description suitable for a customer's payment statement. Limited to 22 characters.
*/
statement_descriptor: string;
/**
* Status of the transaction. One of the following:
* * **CANCELED**
* * **CLOSED**
*/
status: 'CANCELED' | 'CLOSED';
/**
* A set of text codes for the customer to use to complete the steps described in the `instructions` field.
* Contains one or more of the following fields:
* * `code`
* * `pay_code`
* * `pairing_code`
* * `payment_code`
* * `response_code`
* Read-only.
*/
textual_codes: { code: unknown; pay_code: unknown; pairing_code: unknown; payment_code: unknown; response_code: unknown };
/**
* ID of the associated transaction. Read-only.
*/
transaction_id: string;
/**
* Type of transaction. See [Transaction Types](ref:transaction-types).
*/
type: string;
/**
* A set of images for the customer to use to complete the steps described in the `instructions` field. For example, a QR code or barcode. Read-only.
*/
visual_codes: object;
};