UNPKG

bc-payments-sdk

Version:

BetterCommerce's Payments NodeJS SDK is a complete solution for storefront clients that integrate payments. `bc-payments-sdk` is a single point interface for storefront clients for interacting with payment gateways.

44 lines (43 loc) 2.41 kB
/** * Class {Logger} provides methods for logging specific activities to an external * service. The activities that can be logged include payment related activity, * such as payment status changes, or any other type of activity. */ export declare class Logger { /** * Logs activity details to the infrastructure logging service. * * This method captures various details such as user information, page URL, * and request data, then sends these details to an external logging API. * * @param data - The log activity data containing details of the activity. * - requestData: The request data associated with the activity. * - pageUrl: The URL of the page where the activity occurred. * - objectId: The unique identifier for the logged object. * - userId: The unique identifier of the user performing the activity. * - userName: The name of the user performing the activity. * - ipAddress: The IP address of the user. * - message: A short message describing the activity. * @param {object} headers - The headers to include in the logging request. * @param {object} cookies - The cookies to include in the logging request. * @returns {Promise<any>} A promise that resolves to the result of the logging operation. */ static logActivity(data: any, { headers, cookies }: any): Promise<any>; /** * Logs payment related activity to the infrastructure logging service. * * This method captures various payment related details such as payment method, * payment status, transaction ID, and request data, then sends these details * to an external logging API. * * @param data - The log payment data containing details of the payment. * - paymentMethod: The payment method used for the payment. * - paymentStatus: The payment status associated with the payment. * - transactionId: The unique identifier for the payment transaction. * - requestData: The request data associated with the payment. * @param {object} headers - The headers to include in the logging request. * @param {object} cookies - The cookies to include in the logging request. * @returns {Promise<any>} A promise that resolves to the result of the logging operation. */ static logPayment(data: any, { headers, cookies }: any): Promise<any>; }