From d315793bfd3dbf2c64e543be7d0344141cfc2f4f Mon Sep 17 00:00:00 2001 From: justinelut Date: Sat, 15 Jul 2023 07:22:16 +0000 Subject: [PATCH] Updated the readme --- .changeset/lemon-guests-tease.md | 5 +++++ README.md | 4 ++-- src/helpers/FormatPaymentData.ts | 5 +++-- 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 .changeset/lemon-guests-tease.md diff --git a/.changeset/lemon-guests-tease.md b/.changeset/lemon-guests-tease.md new file mode 100644 index 0000000..08da396 --- /dev/null +++ b/.changeset/lemon-guests-tease.md @@ -0,0 +1,5 @@ +--- +"mpesapay": patch +--- + +Updated the Readme diff --git a/README.md b/README.md index 21bda45..704b9aa 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Mpesa Pay is a JavaScript library that enables developers to easily integrate Mp ## Installation -You can install Mpesa Pay using Yarn or NPM. +You can install Mpesa Pay using Yarn, NPM & PNPM. **Yarn** @@ -57,7 +57,7 @@ const Account_Reference = 'YOUR_ACCOUNT_REFERENCE'; const PartyA = "YOUR_MPESA_PARTYA" const B2C_Security_Credential = "YOUR MPESA B2C SECURITY CREDENTIAL" const Initiator_Name = "YOUR MPESA INITIATORS NAME" -const Environment = 'sandbox | live' +const Environment = 'sandbox' diff --git a/src/helpers/FormatPaymentData.ts b/src/helpers/FormatPaymentData.ts index 45b7fe6..8addbb7 100644 --- a/src/helpers/FormatPaymentData.ts +++ b/src/helpers/FormatPaymentData.ts @@ -47,6 +47,7 @@ export default function FormatPaymentData(data: Data): PaymentResult { const paymentinfo = extractData(data); return { status: 'success', + message: 'Transaction processed succesfully', data: { Amount: paymentinfo.Amount, MpesaReceiptNumber: paymentinfo.MpesaReceiptNumber, @@ -59,13 +60,13 @@ export default function FormatPaymentData(data: Data): PaymentResult { if (data && resultscode === 17) { return { status: 'failed', - message: 'Unable to process', + message: 'Unable to process the transaction', resultCode: resultscode, }; } else { return { status: 'canceled', - message: 'Canceled transaction', + message: 'Transaction was cancelled by the user', resultCode: resultscode, }; }