import { Address } from './Address';
import { Escrow } from './Escrow';
import { Outcome } from './Outcome';
import { PaymentFees } from './PaymentFees';
import { PaymentMethodType } from './PaymentMethodType';
export interface Payment {
/**
* ID of the payment. String starting with **payment_**. Response only.
*/
id: `payment_${string}`;
/**
* Billing address associated with this specific payment.
*
* For more information, see [Address Object](ref:address-object).
*/
address: Partial
;
/**
* The amount received by the recipient, in units of the currency defined in `currency`. Decimal, including the correct number of decimal places for the currency exponent, as defined in ISO 2417:2015. To verify a card, set to **0**.
*/
amount: number;
/**
* Reason for cancellation or reversal of a payment. Response only.
*
* See ***cancel_reason - Reversal Values***, below.
*/
cancel_reason: string;
/**
* Determines when the payment is processed for capture. Relevant to card payments.
* - **True**: Capture the payment immediately. This is the default.
* - **False**: Authorize the payment, then capture some or all of the payment at a later time, when the merchant runs the [Capture Payment](ref:capture-payment) method.
*
* **Note:** Some card payment methods do not support delayed capture.
*/
capture: boolean;
/**
* Indicates whether the payment has been successfully captured. Response only.
*/
captured: boolean;
/**
* URL where the customer is redirected for final steps in completing the operation. Provided by the client.
*
* Relevant to bank redirect payment methods.
*/
complete_payment_url: string;
/**
* The country of the payment method. Two-letter ISO 3166-1 ALPHA-2 code. Uppercase. Response only.
*/
country_code: string;
/**
* Time of creation of the payment, in [*Unix time*](ref:glossary). Response only.
*/
created_at: number;
/**
* Defines the currency for the amount received by the seller (merchant). Three-letter ISO 4217 code. Uppercase.
* In FX transactions, when `fixed_side` is **buy**, it is the currency received by the merchant. When `fixed_side` is **sell**, it is the currency charged to the buyer.
* See also `fixed_side` and `requested_currency` fields.
*
* This value is reflected in the `currency_code` field of the response.
*/
currency: string;
/**
* Indicates the currency of the amount received by the recipient. Three-letter ISO 4217 code. Uppercase. Response only.
*/
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: `cus_${string}`;
/**
* ID of the customer who is making the payment. String starting with **cus_**. When a payment is created without an existing customer, the platform creates an anonymous customer with no payment methods. Read only.
* For more information, see [Customer Object](ref:customer-object).
*/
customer_token: `cus_${string}`;
/**
* Description of the payment transaction.
*/
description: string;
/**
* Details about the dispute, if the payment was disputed. Response only.
*/
dispute: object;
/**
* The ID of the payment created after the last payment you want to retrieve. String starting with **payment_**.
*
* Relevant to [List Payments](ref:list-payments).
*/
ending_before: `payment_${string}`;
/**
* URL where the customer is redirected in case of an error in the operation. Provided by the client.
*
* Relevant to bank redirect payment methods.
*/
error_payment_url: string;
/**
* Determines whether the payment is held in escrow for later release. To release escrow funds immediately, use 'Update Payment' and set `escrow` to **false**. Relevant for card payments.
* Describes the escrow. Relevant for card payments when the payment is created with `escrow` set to **true**. Response only.
* See [Escrow Object](ref:escrow-object).
*/
escrow: boolean | Partial;
/**
* Determines the number of days after creation of the payment that funds are released from escrow. Funds are released at 5:00 pm GMT on the day indicated. Integer, range: 1-90.
*/
escrow_release_days: number;
/**
* ID of the wallet that the money is paid into. String starting with **ewallet_**. Response only.
*/
ewallet_id: `ewallet_${string}`;
/**
* Specifies the wallets that the money is collected into. If this is left blank, the money goes into the oldest 'collection'-type client wallet. If there is no 'collection' client wallet, the money goes into the oldest 'general'-type client wallet.
*
* See [Wallets Array](ref:wallets-array).
*/
ewallets: (object)[];
/**
* End of the time allowed for the customer to complete this payment, in [*Unix time*](ref:glossary). Default is 2 weeks.
*
* Relevant to all payment methods where the `is_expirable` field is **true** in the response to [List Payment Methods by Country](ref:list-payment-methods-by-country).
*/
expiration: number;
/**
* Error code explaining the reason for failure of payment capture. Response only.
*/
failure_code: string;
/**
* Message to the merchant, explaining the reason for failure of payment capture. Response only.
*/
failure_message: string;
/**
* Indicates whether the FX rate is fixed for the buy side (seller) or for the sell side (buyer).
* - **buy** - The currency that the seller (merchant) receives for goods or services. Fixed side buy relates to the seller (merchant) funds. For example, a US-based merchant wants to charge 100 USD. The buyer (customer) pays the amount in MXN that converts to 100 USD.
*
* - **sell** - The currency that the buyer is charged with to purchase goods or services from the seller. Fixed side sell relates to the buyer (customer) funds. For example, a US-based merchant wants to charge a buyer 2,000 MXN and will accept whatever amount in USD that is converted from 2,000 MXN.
*
* See also `requested_currency`.
*/
fixed_side: string;
/**
* Reserved.
*/
flow_type: 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. Response only.
*/
fx_rate: string;
/**
* When **true**, includes only group payments in the response. When **false**, excludes group payments from the response. Default is **false**.
*
* Relevant to [List Payments](ref:list-payments).
*/
group: boolean;
/**
* ID of the group payment. String starting with **gp_**. Relevant when the payment is part of a group payment. Response only.
*/
group_payment: `gp_${string}`;
/**
* Indicates how the transaction was initiated. One of the following:
* - **customer_present** - The transaction was initiated by the customer. This is the default.
* - **installment** - The transaction was initiated by a subscription where there is a fixed number of installments.
* - **moto** - The transaction was initiated by mail order or by a telephone order and was initiated by the merchant or Rapyd client.
* - **recurring** - The transaction was initiated by a subscription where charges are made at regular intervals and there is no end date.
* - **unscheduled** - The transaction is a top-up transaction that was previously authorized by the cardholder and was initiated by the merchant or Rapyd client.
*/
initiation_type: 'customer_present' | 'installment' | 'moto' | 'recurring' | 'unscheduled';
/**
* Describes how the customer makes the payment. Read-only.
*
* 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.
*/
instructions: {
name: unknown;
steps: unknown;
};
/**
* ID of the invoice that this payment is for. String starting with **inv_**. Response only.
*/
invoice: `inv_${string}`;
/**
* Indicates whether the payment has been partially paid. When **false**, indicates that the payment is unpaid or fully paid. Response only.
*/
is_partial: boolean;
/**
* The maximum number of payments to return. Range: 1-100. Default is 10.
*
* Relevant to [List Payments](ref:list-payments).
*/
limit: string;
/**
* ID defined by the client.. Limited to 255 characters.
*/
merchant_reference_id: string;
/**
* Indicates the amount paid by the payer, in units of the currency defined in `merchant_requested_currency`. Relevant to payments with FX. Read only.
*/
merchant_requested_amount: number;
/**
* Indicates the currency that merchant receives. Three-letter ISO 4217 code. Uppercase. Relevant to payments with FX. Response only.
*/
merchant_requested_currency: string;
/**
* A JSON object defined by the client.
*/
metadata: object;
/**
* Reserved.
*/
mid: string;
/**
* Indicates the next action for completing the payment. One of the following values:
* - **3d_verification** - The next action is 3DS. Relevant only to card payments.
* - **pending_capture** - The next action is pending the capture of the amount. Relevant only to card payments when the amount is not zero.
* - **pending_confirmation** - The next action is pending the confirmation for the payment. Relevant to all payment methods excluding card payment.
* - **not_applicable** - The payment has completed or the next action is not relevant.
*/
next_action: '3d_verification' | 'pending_capture' | 'pending_confirmation' | 'not_applicable';
/**
* ID of the order that this payment is for. Read-only. Relevant when the payment is for an order.
*/
order: string;
/**
* - **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.
*
* Response only.
*/
original_amount: number;
/**
* Describes the outcome of the risk assessment. Response only.
*
* See [Outcome Object](ref:outcome-object).
*/
outcome: Partial;
/**
* Indicates whether the payment has been fully captured. Response only.
*/
paid: boolean;
/**
* Time of the last capture, in [*Unix time*](ref:glossary). Response only.
*/
paid_at: number;
/**
* ID of the payment. String starting with **payment_**.
*/
payment: `payment_${string}`;
/**
* Object that defines transaction fees and foreign exchange fees.
* These are fees that the Rapyd merchant can define for its consumers in addition to the payment amount. They are not related to the fees Rapyd charges to its clients.
*
* See [Payment Fees Object](ref:payment-fees-object).
*/
payment_fees: Partial;
/**
* `payment_method` ID or object. 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 Type Object](ref:payment-method-type-object).
*/
payment_method: string | Partial;
/**
* Details of the `payment_method` object. Response only.
*/
payment_method_data: object;
/**
* Object describing additional payment method fields required for the payment. These values are not saved as part of the payment method object. To determine the fields required, run [Get Payment Method Required Fields](ref:get-payment-method-required-fields).
*
* See [Payment Method Type Object](ref:payment-method-type-object).
*/
payment_method_options: Partial;
/**
* The type of payment method. For a list of supported types for a country, run [List Payment Methods by Country](ref:list-payment-methods-by-country).
*/
payment_method_type: string;
/**
* Category of payment method type. Read-only. One of the following:
* - **bank_transfer**
* - **bank_redirect**
* - **card**
* - **cash**
* - **ewallet**
*/
payment_method_type_category: 'bank_transfer' | 'bank_redirect' | 'card' | 'cash' | 'ewallet';
/**
* Email address that the receipt for this transaction is sent to.
*/
receipt_email: string;
/**
* Reserved. Response only.
*/
receipt_number: string;
/**
* URL where the customer is redirected for additional steps required for the payment. Response only.
*/
redirect_url: string;
/**
* Indicates whether there was a refund against this payment. Response only.
*/
refunded: boolean;
/**
* The total amount refunded against this payment, in units of the currency defined in `currency`. Response only.
*/
refund_amount: string;
/**
* The total amount refunded against this payment, in units of the currency defined in `currency`. Response 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.
*
* Response only.
*/
refunds: {
data: unknown;
has_more: unknown;
total_count: unknown;
url: unknown;
};
/**
* When `fixed_side` is **sell**, it is the currency received by the merchant.
* When `fixed_side` is **buy**, it is the currency charged to the buyer (customer) to pay the seller (merchant).
* Three-letter ISO 4217 code. Relevant to payments with FX.
* See also `currency` and `fixed_side` fields.
*/
requested_currency: string;
/**
* The merchant's mobile app redirects the customer to a bank's web page for completion of the payment. When the payment is complete, the customer is redirected back to a **Payment Complete** page or **Error** page in the mobile app. If the bank does not support URL redirection, set this field to **true** and Rapyd will send the bank an intermediate URL. After the payment is complete, Rapyd's intermediate URL redirects the consumer back to the mobile app. Default is **false**.
*/
show_intermediate_return_page: boolean;
/**
* The ID of the payment created before the first payment you want to retrieve. String starting with **payment_**.
*
* Relevant to [List Payments](ref:list-payments).
*/
starting_after: `payment_${string}`;
/**
* A text description suitable for a customer's payment statement. Limited to 22 characters.
*/
statement_descriptor: string;
/**
* Indicates the status of the payment. Response only.
*
* **Responses:**
* One of the following:
* - **ACT** - Active and awaiting payment. Can be updated.
* - **CAN** - Canceled by the merchant or the customer's bank.
* - **CLO** - Closed and paid.
* - **ERR** - Error. An attempt was made to create or complete a payment, but it failed.
* - **EXP** - The payment has expired.
* - **NEW** - Not closed.
* - **REV** - Reversed by Rapyd. See `cancel_reason`, above.
*/
status: 'ACT' | 'CAN' | 'CLO' | 'ERR' | 'EXP' | 'NEW' | 'REV';
/**
* A set of text codes for the customer to use to complete the steps described in the `instructions` field. Response only.
*
* Contains one or more of the following fields:
* - `code`
* - `pay_code`
* - `pairing_code`
* - `payment_code`
* - `response_code`
*/
textual_codes: {
code: unknown;
pay_code: unknown;
pairing_code: unknown;
payment_code: unknown;
response_code: unknown;
};
/**
* ID of the payment to complete. String starting with **payment_**. Relevant to the [Complete Payment](ref:complete-payment) method.
*/
token: `payment_${string}`;
/**
* ID of the associated transaction. Response only.
*/
transaction_id: 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. Response only.
*/
visual_codes: object;
/**
* Array of objects that represent the wallets that the funds are paid into. See [Wallets Array](ref:wallets-array).
*/
wallets: any[];
}
//# sourceMappingURL=Payment.d.ts.map