@spreeloop/orange_money
Version:
A orange money api integration package
63 lines • 2.46 kB
TypeScript
import Joi from 'joi';
import { DisbursementXTargetEnvironmentType } from '../utils/constants';
import { LoggerInterface } from '../../utils/logging_interface';
import { CreateAccessTokenResponse } from '../operations/create_access_token';
import { TransferRequest, TransferResponse } from '../operations/transfer';
import { GetTransferStatusRequest, GetTransferStatusResponse } from '../operations/get_transfer_status';
/**
* Interface for DisbursementServiceConfig.
*/
export interface DisbursementServiceConfig {
clientId: string;
clientSecret: string;
customerKey: string;
customerSecret: string;
channelUserMsisdn: string;
pin: string;
environment: DisbursementXTargetEnvironmentType;
logger: LoggerInterface;
}
/**
* Joi schema for DisbursementServiceConfigSchema.
*/
export declare const DisbursementServiceConfigSchema: Joi.ObjectSchema<DisbursementServiceConfig>;
/**
* Orange Money API Disbursement.
* @class
*/
export interface DisbursementInterface {
/**
* Creates an access token.
*
* @return {Promise<CreateAccessTokenResponse>} The method response containing a string and a token.
*/
createAccessToken(): Promise<CreateAccessTokenResponse>;
/**
* Transfers the specified amount of money from one account to another.
*
* @param {TransferRequest} params - The parameters for the transfer.
* @return {Promise<TransferResponse>} - The response from the transfer method.
*/
transfer(params: TransferRequest): Promise<TransferResponse>;
/**
* Retrieves the status of a transfer.
*
* @param {GetTransferStatusRequest} params - The parameters for retrieving the transfer status.
* @return {Promise<GetTransferStatusResponse>} - The method response containing the status and transfer status response.
*/
getTransferStatus(params: GetTransferStatusRequest): Promise<GetTransferStatusResponse>;
}
/**
* Orange Money API Disbursement.
* @class
*/
export declare class Disbursement {
/**
* Creates a new Disbursement object based on the provided configuration.
*
* @param {DisbursementServiceConfig} config - The configuration for the Disbursement object.
* @return {Disbursement} A new Disbursement object based on the provided configuration.
*/
static createDisbursement(config: DisbursementServiceConfig): DisbursementInterface;
}
//# sourceMappingURL=disbursement_service.d.ts.map