Skip to content

Commit

Permalink
(fix) : use bill uuid instead of receipt number (#19)
Browse files Browse the repository at this point in the history
refactor: use bill uuid instead of receipt number to save a bill payment
  • Loading branch information
amosmachora authored Nov 12, 2024
1 parent 26d8332 commit a7e728b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions app/api/mpesa/stk-push/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@ export const POST = async (request: NextRequest) => {
const origin = request.headers.get("origin") ?? "";

const mfl = requestBody.accountReference.substring(0, 5);
const billId = requestBody.accountReference.substring(
6,
requestBody.accountReference.indexOf("-")
);

const billId = requestBody.accountReference.split("#").at(-1)!;
const healthFacilityMpesaConfig = getHealthFacilityMpesaConfig(mfl);

if (!healthFacilityMpesaConfig) {
Expand Down

0 comments on commit a7e728b

Please sign in to comment.