ohehr_payment
Version:
Payment integration package for multiple payment providers
25 lines • 1.45 kB
TypeScript
import { KhanGatewayAccessTokenResponse, KhanGatewayConfig, KhanGatewayTransactionResponse } from "./types";
/**
* Generates a configuration object for Khan Gateway
* @param config - An object containing endpoint, consumerKey, secretKey, and bankAccount
* @returns KhanGatewayConfig object
*/
export declare const getKhanGateWayConfig: ({ endpoint, consumerKey, secretKey, bankAccount, }: KhanGatewayConfig) => KhanGatewayConfig;
/**
* Fetches an access token from the Khan Gateway
* @param config - Configuration object for Khan Gateway
* @returns A Promise resolving to KhanGatewayAccessTokenResponse
* @throws Will throw an error if the request fails
*/
export declare const getKhanGateWayAccessToken: (config: KhanGatewayConfig) => Promise<KhanGatewayAccessTokenResponse>;
/**
* Fetches transaction data from the Khan Gateway
* @param from - Optional start date for transaction history
* @param to - Optional end date for transaction history
* @param tokens - Access token response from the gateway
* @param config - Configuration object for Khan Gateway
* @returns A Promise resolving to KhanGatewayTransactionResponse or undefined
* @throws Will throw an error if the request fails
*/
export declare const checkKhanGateWayTransaction: (from: Date | null, to: Date | null, tokens: KhanGatewayAccessTokenResponse, config: KhanGatewayConfig) => Promise<KhanGatewayTransactionResponse | undefined>;
//# sourceMappingURL=utils.d.ts.map