UNPKG

@monei-js/node-sdk

Version:

Node.js SDK for MONEI Digital Payment Gateway

217 lines (216 loc) 8.03 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 { PaymentCancellationReason } from './payment-cancellation-reason'; import type { PaymentCustomer } from './payment-customer'; import type { PaymentLastRefundReason } from './payment-last-refund-reason'; import type { PaymentNextAction } from './payment-next-action'; import type { PaymentPaymentMethod } from './payment-payment-method'; import type { PaymentSequence } from './payment-sequence'; import type { PaymentSessionDetails } from './payment-session-details'; import type { PaymentShippingDetails } from './payment-shipping-details'; import type { PaymentShop } from './payment-shop'; import type { PaymentStatus } from './payment-status'; import type { PaymentTraceDetails } from './payment-trace-details'; /** * * @export * @interface Payment */ export interface Payment { /** * Unique identifier for the payment. * @type {string} * @memberof Payment */ id: string; /** * 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 Payment */ amount: number; /** * Three-letter [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217), in uppercase. Must be a supported currency. * @type {string} * @memberof Payment */ 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 Payment */ orderId?: string; /** * An arbitrary string attached to the payment. Often useful for displaying to users. * @type {string} * @memberof Payment */ description?: string; /** * MONEI Account identifier. * @type {string} * @memberof Payment */ accountId: string; /** * Unique identifier provided by the bank performing transaction. * @type {string} * @memberof Payment */ authorizationCode?: string; /** * Has the value `true` if the resource exists in live mode or the value `false` if the resource exists in test mode. * @type {boolean} * @memberof Payment */ livemode: boolean; /** * * @type {PaymentStatus} * @memberof Payment */ status: PaymentStatus; /** * Payment status code. * @type {string} * @memberof Payment */ statusCode?: string; /** * Human readable status message, can be displayed to a user. * @type {string} * @memberof Payment */ statusMessage?: string; /** * * @type {PaymentCustomer} * @memberof Payment */ customer?: PaymentCustomer; /** * * @type {PaymentShop} * @memberof Payment */ shop?: PaymentShop; /** * * @type {PaymentBillingDetails} * @memberof Payment */ billingDetails?: PaymentBillingDetails; /** * * @type {PaymentShippingDetails} * @memberof Payment */ shippingDetails?: PaymentShippingDetails; /** * Amount in cents refunded (can be less than the amount attribute on the payment if a partial refund was issued). * @type {number} * @memberof Payment */ refundedAmount?: number; /** * Amount in cents refunded in the last transaction. * @type {number} * @memberof Payment */ lastRefundAmount?: number; /** * * @type {PaymentLastRefundReason} * @memberof Payment */ lastRefundReason?: PaymentLastRefundReason; /** * * @type {PaymentCancellationReason} * @memberof Payment */ cancellationReason?: PaymentCancellationReason; /** * * @type {PaymentSessionDetails} * @memberof Payment */ sessionDetails?: PaymentSessionDetails; /** * * @type {PaymentTraceDetails} * @memberof Payment */ traceDetails?: PaymentTraceDetails; /** * A permanent token represents a payment method used in the payment. Pass `generatePaymentToken: true` when you creating a payment to generate it. You can pass it as `paymentToken` parameter to create other payments with the same payment method. This token does not expire, and should only be used server-side. * @type {string} * @memberof Payment */ paymentToken?: string; /** * * @type {PaymentPaymentMethod} * @memberof Payment */ paymentMethod?: PaymentPaymentMethod; /** * * @type {PaymentSequence} * @memberof Payment */ sequence?: PaymentSequence; /** * A permanent identifier that refers to the initial payment of a sequence of payments. This value needs to be sent in the path for `RECURRING` payments. * @type {string} * @memberof Payment */ sequenceId?: string; /** * A unique identifier of the Store. If specified the payment is attached to this Store. * @type {string} * @memberof Payment */ 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 Payment */ pointOfSaleId?: string; /** * 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 Payment */ metadata?: object; /** * * @type {PaymentNextAction} * @memberof Payment */ nextAction?: PaymentNextAction; /** * Time at which the resource was created. Measured in seconds since the Unix epoch. * @type {number} * @memberof Payment */ createdAt?: number; /** * Time at which the resource updated last time. Measured in seconds since the Unix epoch. * @type {number} * @memberof Payment */ updatedAt?: number; }