UNPKG

@monei-js/node-sdk

Version:

Node.js SDK for MONEI Digital Payment Gateway

177 lines (176 loc) 8.04 kB
/** * MONEI API v1 * The MONEI API is organized around REST principles. Our API is designed to be intuitive and developer-friendly. ### Base URL All API requests should be made to: ``` https://api.monei.com/v1 ``` ### Environment MONEI provides two environments: - **Test Environment**: For development and testing without processing real payments - **Live Environment**: For processing real transactions in production ### Client Libraries We provide official SDKs to simplify integration: - [PHP SDK](https://github.com/MONEI/monei-php-sdk) - [Python SDK](https://github.com/MONEI/monei-python-sdk) - [Node.js SDK](https://github.com/MONEI/monei-node-sdk) - [Postman Collection](https://postman.monei.com/) Our SDKs handle authentication, error handling, and request formatting automatically. You can download the OpenAPI specification from the https://js.monei.com/api/v1/openapi.json and generate your own client library using the [OpenAPI Generator](https://openapi-generator.tech/). ### Important Requirements - All API requests must be made over HTTPS - If you are not using our official SDKs, you **must provide a valid `User-Agent` header** with each request - Requests without proper authentication will return a `401 Unauthorized` error ### Error Handling The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a `statusCode` attribute indicating the outcome of your request. ### Rate Limits The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a `429 Too Many Requests` status code. * * The version of the OpenAPI document: 1.7.3 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import type { PaymentBillingDetails } from './payment-billing-details'; import type { PaymentCustomer } from './payment-customer'; import type { PaymentPaymentMethodInput } from './payment-payment-method-input'; import type { PaymentPaymentMethods } from './payment-payment-methods'; import type { PaymentSequence } from './payment-sequence'; import type { PaymentSessionDetails } from './payment-session-details'; import type { PaymentShippingDetails } from './payment-shipping-details'; import type { PaymentTransactionType } from './payment-transaction-type'; /** * * @export * @interface CreatePaymentRequest */ export interface CreatePaymentRequest { /** * Amount intended to be collected by this payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge 1.00 USD). * @type {number} * @memberof CreatePaymentRequest */ amount: number; /** * Three-letter [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217), in uppercase. Must be a supported currency. * @type {string} * @memberof CreatePaymentRequest */ currency: string; /** * An order ID from your system. A unique identifier that can be used to reconcile the payment with your internal system. * @type {string} * @memberof CreatePaymentRequest */ orderId: string; /** * The URL to which a payment result should be sent asynchronously. * @type {string} * @memberof CreatePaymentRequest */ callbackUrl?: string; /** * The URL the customer will be directed to after transaction completed (successful or failed - except if `failUrl` is provided). * @type {string} * @memberof CreatePaymentRequest */ completeUrl?: string; /** * The URL the customer will be directed to after transaction has failed, instead of `completeUrl` (used in hosted payment page). This allows to provide two different URLs for successful and failed payments. * @type {string} * @memberof CreatePaymentRequest */ failUrl?: string; /** * The URL the customer will be directed to if they decide to cancel payment and return to your website (used in hosted payment page). * @type {string} * @memberof CreatePaymentRequest */ cancelUrl?: string; /** * A payment token generated by monei.js [Components](https://docs.monei.com/monei-js/overview/) or a paymentToken [saved after a previous successful payment](https://docs.monei.com/guides/save-payment-method/). In case of the first one, you will also need to send the `sessionId` used to generate the token in the first place. * @type {string} * @memberof CreatePaymentRequest */ paymentToken?: string; /** * A unique identifier within your system that adds security to the payment process. You need to pass the same session ID as the one used on the frontend to initialize MONEI Component (if you needed to). This is required if a payment token (not permanent) was already generated in the frontend. * @type {string} * @memberof CreatePaymentRequest */ sessionId?: string; /** * If set to true a permanent token that represents a payment method used in the payment will be generated. * @type {boolean} * @memberof CreatePaymentRequest */ generatePaymentToken?: boolean; /** * * @type {PaymentPaymentMethodInput} * @memberof CreatePaymentRequest */ paymentMethod?: PaymentPaymentMethodInput; /** * * @type {PaymentPaymentMethods} * @memberof CreatePaymentRequest */ allowedPaymentMethods?: PaymentPaymentMethods; /** * * @type {PaymentTransactionType} * @memberof CreatePaymentRequest */ transactionType?: PaymentTransactionType; /** * * @type {PaymentSequence} * @memberof CreatePaymentRequest */ sequence?: PaymentSequence; /** * A unique identifier of the Store. If specified the payment is attached to this Store. * @type {string} * @memberof CreatePaymentRequest */ storeId?: string; /** * A unique identifier of the Point of Sale. If specified the payment is attached to this Point of Sale. If there is a QR code attached to the same Point of Sale, this payment will be available by scanning the QR code. * @type {string} * @memberof CreatePaymentRequest */ pointOfSaleId?: string; /** * A unique identifier of the Subscription. If specified the payment is attached to this Subscription. * @type {string} * @memberof CreatePaymentRequest */ subscriptionId?: string; /** * If set to `true`, the new payment will be automatically created when customer visits the payment link of the previously failed payment. Is automatically set to `true` if `completeUrl` is not provided.(set this value to `true` to create \"Pay By Link\" payments). * @type {boolean} * @memberof CreatePaymentRequest */ autoRecover?: boolean; /** * An arbitrary string attached to the payment. Often useful for displaying to users. * @type {string} * @memberof CreatePaymentRequest */ description?: string; /** * * @type {PaymentCustomer} * @memberof CreatePaymentRequest */ customer?: PaymentCustomer; /** * * @type {PaymentBillingDetails} * @memberof CreatePaymentRequest */ billingDetails?: PaymentBillingDetails; /** * * @type {PaymentShippingDetails} * @memberof CreatePaymentRequest */ shippingDetails?: PaymentShippingDetails; /** * * @type {PaymentSessionDetails} * @memberof CreatePaymentRequest */ sessionDetails?: PaymentSessionDetails; /** * Payment expiration time. * @type {number} * @memberof CreatePaymentRequest */ expireAt?: number; /** * A set of key-value pairs that you can attach to a resource. This can be useful for storing additional information about the resource in a structured format. * @type {object} * @memberof CreatePaymentRequest */ metadata?: object; }