UNPKG

bc-opayo-sdk

Version:

BetterCommerce's Opayo NodeJS SDK enables BC client applications to integrate with Opayo merchant API system. It publishes an interface to interact with [Opayo API](https://www.elavon.co.uk/resource-center/help-with-your-solutions/opayo/integrations/types

28 lines (27 loc) 926 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // Other Imports const api_1 = require("../api"); const enums_1 = require("../constants/enums"); class Transaction { /** * Initiates a transaction request. * * @param {ITransactionRequest} data The transaction request data. * @returns {Promise<any>} A promise resolving to the result of the transaction request. * @throws {Error} If the request fails, an error is thrown. */ async request(data) { try { const transactionResult = await api_1.Api.call(`/api/v1/transactions`, enums_1.RequestMethod.POST, data); return transactionResult; } catch (error) { return { hasError: true, error: error }; } } getDetails(data) { throw new Error("Method not implemented."); } } exports.default = Transaction;