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

80 lines (79 loc) 2.91 kB
/** * {OpayoEnvironment} class is used to setup the environment. * This class provides options to select the environment. */ export default class OpayoEnvironment { /** * Field to store the vendor name. * @property {string} */ static vendorName: string; /** * Field to store the integration key. * @property {string} */ static integrationKey: string; /** * Field to store the integration password. * @property {string} */ static integrationPassword: string; static environment: string; static extras: any; /** * Field to store the opayo auth base url. * @property {string} */ static authUrl: string; /** * Field to store the opayo api base url. * @property {string} */ static baseUrl: string; /** * Initializes the OpayoEnvironment with the vendor name, integration key, integration password and * whether to use the sandbox environment or not. If useSandBox is not provided, it will default to true. * @param vendorName {string} The vendor name. * @param integrationKey {string} The integration key. * @param integrationPassword {string} The integration password. * @param useSandBox {boolean} Whether to use the sandbox environment or not. Defaults to true. * @param extras {any} Any additional information that needs to be passed to the server. * @returns {OpayoEnvironment} The OpayoEnvironment instance. */ static init(vendorName: string, integrationKey: string, integrationPassword: string, useSandBox?: boolean, extras?: {}): typeof OpayoEnvironment; /** * Get the vendor name set in the OpayoEnvironment. * @returns {string} The vendor name. */ static getVendorName(): string; /** * Get the integration key set in the OpayoEnvironment. * @returns {string} The integration key. */ static getIntegrationKey(): string; /** * Get the integration password set in the OpayoEnvironment. * @returns {string} The integration password. */ static getIntegrationPassword(): string; /** * Get any additional configuration options that were passed in the constructor. * @returns {Object} The additional configuration options. */ static getExtras(): any; /** * Get the current environment being used in the OpayoEnvironment. * @returns {string} The current environment, either "sandbox" or "production". */ static getEnvironment(): string; /** * Get the URL of the authentication service. * @returns {string} The URL of the authentication service. */ static getAuthUrl(): string; /** * Get the URL of the API service. * @returns {string} The URL of the API service. */ static getBaseUrl(): string; }