UNPKG

nodejs-cryptomus

Version:

A comprehensive Node.js client for the Cryptomus API

169 lines (159 loc) 3.86 kB
/** * Payment creation request */ export interface CreatePaymentRequest { /** Order amount in the currency specified in the 'currency' parameter */ amount: string | number; /** Payment currency */ currency: string; /** Order ID in your system (must be unique) */ order_id: string; /** URL to redirect after successful payment */ url_return?: string; /** URL to redirect after failed payment */ url_failure?: string; /** IPN URL to receive payment notifications */ url_callback?: string; /** Additional information about the order */ is_payment_multiple?: boolean; /** Allow the customer to pay less than the specified amount */ to_currency?: string; /** Lifetime of the payment order in minutes (default: 1440, 4320 max) */ lifetime?: number; /** Additional information about the payment */ additional_data?: string; /** Comment to the invoice */ comment?: string; /** For exchanges, related to the service of exchangers */ exchange_rate?: number; /** Enable/disable payment with a different cryptocurrency */ is_exchange?: boolean; } /** * Payment creation response */ export interface PaymentInfo { /** UUID of the payment */ uuid: string; /** Order ID in your system */ order_id: string; /** Payment currency */ currency: string; /** Payment amount */ amount: string; /** Payment amount in USD */ amount_usd: string; /** Payment status */ status: string; /** URL to redirect the user for payment */ url: string; /** QR code data URL */ qr_code: string; /** True if this payment is for a static wallet */ is_static: boolean; /** Payment address */ wallet: string; /** Created timestamp */ created_at: string; /** Updated timestamp */ updated_at: string; /** Merchant details */ merchant: { /** UUID of the merchant */ uuid: string; /** Address of the merchant */ address: string; /** Name of the merchant */ name: string; }; } /** * Payment status request */ export interface PaymentStatusRequest { /** UUID of the payment */ uuid?: string; /** Order ID in your system */ order_id?: string; } /** * Payment history request */ export interface PaymentHistoryRequest { /** Page number */ page?: number; /** Items per page */ per_page?: number; /** Filter by currency */ currency?: string; /** Filter by status */ status?: string; /** Filter by date range (start) */ date_from?: string; /** Filter by date range (end) */ date_to?: string; } /** * Static wallet creation request */ export interface CreateStaticWalletRequest { /** Payment currency */ currency: string; /** Network for the currency */ network?: string; /** Order ID in your system */ order_id: string; /** IPN URL to receive payment notifications */ url_callback?: string; /** Comment for the wallet */ comment?: string; /** Name for the wallet */ name?: string; } /** * QR code generation request */ export interface GenerateQrCodeRequest { /** UUID of the payment or static wallet */ uuid: string; /** Size of the QR code in pixels */ size?: number; } /** * Refund request */ export interface RefundRequest { /** UUID of the payment */ uuid: string; /** Refund amount */ amount?: string; /** Address to send the refund */ address: string; /** Network for the refund */ network?: string; } /** * Block wallet request */ export interface BlockWalletRequest { /** UUID of the static wallet */ uuid: string; } /** * Webhook test request */ export interface TestWebhookRequest { /** UUID of the payment */ uuid?: string; /** Order ID in your system */ order_id?: string; } /** * Resend webhook request */ export interface ResendWebhookRequest { /** UUID of the payment */ uuid?: string; /** Order ID in your system */ order_id?: string; }