@spreeloop/mtn_momo
Version:
A mtn momo api integration package
108 lines • 6.09 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.MtnMomoPaymentStatusCode = exports.MtnMomoPaymentStatus = exports.ApiErrorType = exports.MtnMomoFailedPaymentReason = exports.RequestKey = void 0;
var RequestKey;
(function (RequestKey) {
RequestKey["keyAuthorization"] = "Authorization";
RequestKey["keyContentType"] = "Content-Type";
RequestKey["keyXReferenceId"] = "X-Reference-Id";
RequestKey["keyXCallbackUrl"] = "X-Callback-Url";
RequestKey["keySubscriptionKey"] = "Ocp-Apim-Subscription-Key";
RequestKey["keyProviderCallbackhost"] = "providerCallbackHost";
RequestKey["keyReferenceId"] = "X-Reference-Id";
RequestKey["keyEnvironmentTarget"] = "X-Target-Environment";
RequestKey["keyAmount"] = "amount";
RequestKey["keyCurrency"] = "currency";
RequestKey["keyExternalId"] = "externalId";
RequestKey["keyPayer"] = "payer";
RequestKey["keyPartyIdType"] = "partyIdType";
RequestKey["keyPartyId"] = "partyId";
RequestKey["keyPayerMessage"] = "payerMessage";
RequestKey["keyPayeeNote"] = "payeeNote";
RequestKey["keyAccessToken"] = "access_token";
})(RequestKey = exports.RequestKey || (exports.RequestKey = {}));
var MtnMomoFailedPaymentReason;
(function (MtnMomoFailedPaymentReason) {
MtnMomoFailedPaymentReason["PAYEE_NOT_FOUND"] = "PAYEE_NOT_FOUND";
MtnMomoFailedPaymentReason["PAYER_NOT_FOUND"] = "PAYER_NOT_FOUND";
MtnMomoFailedPaymentReason["NOT_ALLOWED"] = "NOT_ALLOWED";
MtnMomoFailedPaymentReason["NOT_ALLOWED_TARGET_ENVIRONMENT"] = "NOT_ALLOWED_TARGET_ENVIRONMENT";
MtnMomoFailedPaymentReason["LOW_BALANCE_OR_PAYEE_LIMIT_REACHED_OR_NOT_ALLOWED"] = "LOW_BALANCE_OR_PAYEE_LIMIT_REACHED_OR_NOT_ALLOWED";
MtnMomoFailedPaymentReason["INVALID_CALLBACK_URL_HOST"] = "INVALID_CALLBACK_URL_HOST";
MtnMomoFailedPaymentReason["INVALID_CURRENCY"] = "INVALID_CURRENCY";
MtnMomoFailedPaymentReason["SERVICE_UNAVAILABLE"] = "SERVICE_UNAVAILABLE";
MtnMomoFailedPaymentReason["INTERNAL_PROCESSING_ERROR"] = "INTERNAL_PROCESSING_ERROR";
MtnMomoFailedPaymentReason["NOT_ENOUGH_FUNDS"] = "NOT_ENOUGH_FUNDS";
MtnMomoFailedPaymentReason["PAYER_LIMIT_REACHED"] = "PAYER_LIMIT_REACHED";
MtnMomoFailedPaymentReason["PAYEE_NOT_ALLOWED_TO_RECEIVE"] = "PAYEE_NOT_ALLOWED_TO_RECEIVE";
MtnMomoFailedPaymentReason["PAYMENT_NOT_APPROVED"] = "PAYMENT_NOT_APPROVED";
MtnMomoFailedPaymentReason["RESOURCE_NOT_FOUND"] = "RESOURCE_NOT_FOUND";
MtnMomoFailedPaymentReason["APPROVAL_REJECTED"] = "APPROVAL_REJECTED";
MtnMomoFailedPaymentReason["EXPIRED"] = "EXPIRED";
MtnMomoFailedPaymentReason["TRANSACTION_CANCELED"] = "TRANSACTION_CANCELED";
MtnMomoFailedPaymentReason["RESOURCE_ALREADY_EXIST"] = "RESOURCE_ALREADY_EXIST";
MtnMomoFailedPaymentReason["COULD_NOT_PERFORM_TRANSACTION"] = "COULD_NOT_PERFORM_TRANSACTION";
})(MtnMomoFailedPaymentReason = exports.MtnMomoFailedPaymentReason || (exports.MtnMomoFailedPaymentReason = {}));
var ApiErrorType;
(function (ApiErrorType) {
ApiErrorType["insufficientFunds"] = "insufficientFunds";
ApiErrorType["invalidData"] = "invalidData";
ApiErrorType["failedToInitiateThePayment"] = "failedToInitiateThePayment";
ApiErrorType["failedToGenerateAccessToken"] = "failedToGenerateAccessToken";
ApiErrorType["failedToCheckPaymentStatus"] = "failedToCheckPaymentStatus";
ApiErrorType["accountLocked"] = "accountLocked";
ApiErrorType["invalidPaymentAmount"] = "invalidPaymentAmount";
ApiErrorType["unauthorized"] = "unauthorized";
})(ApiErrorType = exports.ApiErrorType || (exports.ApiErrorType = {}));
/**
* The status of payment request.
*/
var MtnMomoPaymentStatus;
(function (MtnMomoPaymentStatus) {
/**
* User has clicked on “Confirmed”, transaction
* is in progress on Mtn system.
*/
MtnMomoPaymentStatus["PENDING_PAYMENT"] = "PENDING";
/**
* Payment is done.
*/
MtnMomoPaymentStatus["SUCCESSFUL_PAYMENT"] = "SUCCESSFUL";
/**
* Payment has failed.
*/
MtnMomoPaymentStatus["FAILED_PAYMENT"] = "FAILED";
/**
* Payment has been created.
*/
MtnMomoPaymentStatus["CREATED_PAYMENT"] = "CREATED";
})(MtnMomoPaymentStatus = exports.MtnMomoPaymentStatus || (exports.MtnMomoPaymentStatus = {}));
/**
* List all the status code request for mtn payment.
*/
var MtnMomoPaymentStatusCode;
(function (MtnMomoPaymentStatusCode) {
// Successfully created api user.
MtnMomoPaymentStatusCode[MtnMomoPaymentStatusCode["apiUserCreated"] = 201] = "apiUserCreated";
// Successfully created api key.
MtnMomoPaymentStatusCode[MtnMomoPaymentStatusCode["apiKeyCreated"] = 201] = "apiKeyCreated";
// Successfully created access token.
MtnMomoPaymentStatusCode[MtnMomoPaymentStatusCode["accessTokenCreated"] = 200] = "accessTokenCreated";
// Successfully status retriever.
MtnMomoPaymentStatusCode[MtnMomoPaymentStatusCode["statusRetrieved"] = 200] = "statusRetrieved";
// Successfully initiate the payment.
MtnMomoPaymentStatusCode[MtnMomoPaymentStatusCode["paymentInitiated"] = 202] = "paymentInitiated";
// Unauthorized
MtnMomoPaymentStatusCode[MtnMomoPaymentStatusCode["unauthorized"] = 401] = "unauthorized";
// Bad request, e.g. invalid data was sent in the request.
MtnMomoPaymentStatusCode[MtnMomoPaymentStatusCode["badRequest"] = 400] = "badRequest";
// Not found, reference id not found or closed in sandbox.
MtnMomoPaymentStatusCode[MtnMomoPaymentStatusCode["notFound"] = 404] = "notFound";
// Conflict, duplicated reference id.
MtnMomoPaymentStatusCode[MtnMomoPaymentStatusCode["conflictError"] = 409] = "conflictError";
// Internal error. Check log for information.
MtnMomoPaymentStatusCode[MtnMomoPaymentStatusCode["internalError"] = 500] = "internalError";
// No response.
MtnMomoPaymentStatusCode[MtnMomoPaymentStatusCode["noResponse"] = 0] = "noResponse";
})(MtnMomoPaymentStatusCode = exports.MtnMomoPaymentStatusCode || (exports.MtnMomoPaymentStatusCode = {}));
//# sourceMappingURL=constants.js.map