UNPKG

mtn-momo-client

Version:

A collection of utils to interact with the mtn-momo api

38 lines (37 loc) 2.39 kB
import { Product } from '../types'; import type { CreateProductClientOptions } from './common/client'; import type { FetchAccountBalance } from './common/createAccountBalanceFetcher'; import type { FetchBasicUserInfo } from './common/createGetBasicUserInfo'; import type { RequestToPayDeliveryNotification } from './common/createRequestToPayDeliveryNotification'; import type { InitiateTransaction } from './common/createTransactionInitiator'; import type { FetchTransactionStatus } from './common/createTransactionStatusFetcher'; import type { ValidateAccountHolderStatus } from './common/createValidateAccountHolderStatus'; type CreateCollectionAPIOptions = Omit<CreateProductClientOptions, 'targetProduct'>; type CreateCollectionAPIResult = { /** * This operation is used to request a payment from a consumer (Payer). The payer will be asked to authorize the payment. * The transaction will be executed once the payer has authorized the payment. * The requesttopay will be in status PENDING until the transaction is authorized or declined by the payer or it is timed out by the system. * Status of the transaction can be validated by using the requestToPayTransactionStatus method */ requestToPay: InitiateTransaction<Product.Collection>; /** * This operation is used to get the status of a request to pay */ requestToPayTransactionStatus: FetchTransactionStatus<Product.Collection>; /** Get the balance of the account */ getAccountBalance: FetchAccountBalance; /** This operation returns personal information of the account holder. The operation does not need any consent by the account holder. */ getBasicUserInfo: FetchBasicUserInfo; /** This operation is used to check if an account holder is registered and active in the system. */ validateAccountHolderStatus: ValidateAccountHolderStatus; /** This operation is used to send additional Notification to an End User. */ requestToPayDeliveryNotification: RequestToPayDeliveryNotification; }; /** * Creates methods to access the collections API * @param options Properties to use when creating functions to access the collections API * @returns {CreateCollectionAPIResult} Methods to access the collections API */ declare const createCollectionAPI: (options: CreateCollectionAPIOptions) => CreateCollectionAPIResult; export { createCollectionAPI };