import { Application, TransactionResponse } from '../models/index.js'; import PaymentAppResponse from '../models/PaymentAppResponse.js'; import 'isomorphic-fetch'; import { AirtimePurchaseRequest, MoneyCollectRequest, MoneyDepositRequest, PaymentRefundRequest, YangoRefillRequest } from '../types.js'; import { AOperation } from './AOperation.js'; /** * Containing all operations provided by MeSomb Payment Service. * * [Check the documentation here](https://mesomb.hachther.com/en/api/schema/) */ export default class PaymentOperation extends AOperation { service: string; constructor({ applicationKey, accessKey, secretKey, language, timeout, }: { applicationKey: string; accessKey: string; secretKey: string; language?: string; timeout?: number; }); /** * Collect money a user account * * @param {MoneyCollectRequest} params - collection parameter * @param {number} params.amount - Amount of the transaction * @param {'MTN' | 'ORANGE' | 'AIRTEL'} params.service - Payment service * @param {string} params.payer - Account number to collect from * @param {string} [params.nonce] - Unique string on each request * @param {string | number } [params.trxID] - If you want to include your transaction ID in the request * @param {string} [params.country='CM'] - 2 letters country code of the service (configured during your service registration in MeSomb) * @param {string} [params.currency='XAF'] - Currency of your service depending on your country * @param {boolean} [params.fees=true] - True if you want to include the fees in the amount * @param {string} [params.mode='synchronous'] - Mode of the transaction (synchronous or asynchronous) * @param {boolean} [params.conversion=false] - True in case of foreign currently defined if you want to rely on MeSomb to convert the amount in the local currency * @param {LocationRequest} [params.location] - Location of the customer * @param {CustomerRequest} [params.customer] - Customer details * @param {ProductRequest[] | ProductRequest} [params.products] - List of products * @param {Record} [params.extra] - Additional parameters * * @returns {Promise} - The transaction response * * @return TransactionResponse */ makeCollect({ amount, service, payer, nonce, trxID, country, currency, fees, mode, conversion, location, customer, products, extra, }: MoneyCollectRequest): Promise; /** * Collect money to a user account * * @param {MoneyDepositRequest} params - The deposit parameters * @param {number} params.amount - Amount of the transaction * @param {'MTN' | 'ORANGE' | 'AIRTEL'} params.service - Payment service * @param {string} params.receiver - Account number to depose in * @param {string} [params.nonce] - Unique string on each request * @param {string | number | null} [params.trxID] - If you want to include your transaction ID in the request * @param {string} [params.country='CM'] - 2 letters country code of the service (configured during your service registration in MeSomb) * @param {string} [params.currency='XAF'] - Currency of your service depending on your country * @param {boolean} [params.conversion=false] - True in case of foreign currently defined if you want to rely on MeSomb to convert the amount in the local currency * @param {LocationRequest} [params.location] - Location of the customer * @param {CustomerRequest} [params.customer] - Customer details * @param {ProductRequest[] | ProductRequest} [params.products] - List of products * @param {Record} [params.extra] - Additional parameters * @returns {Promise} - The transaction response */ makeDeposit({ amount, service, receiver, nonce, trxID, country, currency, conversion, location, customer, products, extra, }: MoneyDepositRequest): Promise; /** * Collect money to a user account * * @param {MoneyDepositRequest} params - The deposit parameters * @param {number} params.amount - Amount of the transaction * @param {'MTN' | 'ORANGE' | 'AIRTEL'} params.service - Payment service * @param {string} params.receiver - Account number to depose in * @param {'MTN' | 'ORANGE' | 'CAMTEL' | 'NEXTTEL' | 'YOOMEE'} params.merchant - Unique string on each request * @param {string} [params.nonce] - Unique string on each request * @param {string | number | null} [params.trxID] - If you want to include your transaction ID in the request * @param {string} [params.country='CM'] - 2 letters country code of the service (configured during your service registration in MeSomb) * @param {string} [params.currency='XAF'] - Currency of your service depending on your country * @param {LocationRequest} [params.location] - Location of the customer * @param {CustomerRequest} [params.customer] - Customer details * @param {ProductRequest[] | ProductRequest} [params.products] - List of products * @param {Record} [params.extra] - Additional parameters * @returns {Promise} - The transaction response */ purchaseAirtime({ amount, service, receiver, merchant, nonce, trxID, country, currency, location, customer, products, extra, }: AirtimePurchaseRequest): Promise; /** * Method to refund customer based on a transaction * * @param id of the transaction * @param params{PaymentRefundRequest} refund parameter * * @return TransactionResponse */ refundTransaction(id: string, { amount, nonce, conversion, currency }: PaymentRefundRequest): Promise; /** * Get the current status of your service on MeSomb */ getStatus(): Promise; /** * Retrieve the current payment pricing information for the application. */ getPricing(): Promise; /** * Refill a Yango driver account. */ yangoRefill(params: YangoRefillRequest): Promise; /** * Fetch transactions base on MeSomb IDs or external IDs * * * @return Transaction[] * @param ids * @param source */ getTransactions(ids: string[], source?: 'MESOMB' | 'EXTERNAL'): Promise[]>; /** * Check transactions base on MeSomb IDs or external IDs * * @return Transaction[] * @param ids * @param source */ checkTransactions(ids: string[], source?: string): Promise[]>; } //# sourceMappingURL=PaymentOperation.d.ts.map