Smatpay is a nodejs package for making payments on the smatpay.africa platform
Use the package manager npm to install smatpay.
npm install smatpay@1.0.5
const smatpay = require('smatpay');
#Make payment
# returns payment object
smatpay.makePayment(environment,merchantId,merchantApiKey,merchantKey,walletName,amount,paymentCurrency,paymentDescription,payerName,payerReference,payerAccountId,payerMobile,profileId)
environment has 2 options
smatpay.environment.SANDBOX and smatpay.environment.PRODUCTION
Currency has 2 options
smatpay.currency.USD and smatpay.currency.ZIG
payerReference should be a unique UUID
walletName has 3 options
smatpay.paymentMethod.Ecocash,smatpay.paymentMethod.Innbucks and smatpay.paymentMethod.Zimswitch
# returns '{status:true,token:token}'
smatpay.getAccessToken(environment,merchantId,merchantApiKey,merchantKey)
# returns '{status:true,data:{}}'
smatpay.checkPaymentStatus(environment,reference,transactionCode,walletName,token)
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.