@spreeloop/orange_money
Version:
A orange money api integration package
36 lines • 1.61 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.OrangeMoneyPayment = void 0;
const utils_1 = require("../utils/utils");
const fake_1 = require("./implementations/fake");
const live_1 = require("./implementations/live");
/**
* Creates a orange money payment.
*/
class OrangeMoneyPayment {
/**
* Create a new payment using the provided configuration.
*
* @param {OrangeMoneyPaymentParams} config - The payment configuration.
* - {TargetEnvironment} config.targetEnvironment the target environment.
* - {string} config.apiUserName channelUser api username.
* - {string} config.apiPassword channelUser api password.
* - {string} config.xAuthToken the x-auth-token.
* - {string} [mobileInitParams.omVersion] the mobile orange money version apply for payment request.The default orange money version
* is 1.0.2: for more information: https://apiw.orange.cm/omcoreapis/1.0.2/mp/pay.
* - {String} config.targetEnvironment the target environment.
* @return {OrangeMoneyPaymentInterface} The created payment.
*/
static createPayment(config) {
switch (config.targetEnvironment) {
case utils_1.TargetEnvironment.prod:
return new live_1.OrangeMoneyPaymentLive(config);
case utils_1.TargetEnvironment.fake:
return new fake_1.OrangeMoneyPaymentFake();
default:
return new live_1.OrangeMoneyPaymentLive(config);
}
}
}
exports.OrangeMoneyPayment = OrangeMoneyPayment;
//# sourceMappingURL=payments.js.map