Guides / Netcash Pay Now
How to accept Netcash Pay Now payments in Next.js
Short answerPost a form from the browser to Netcash's Pay Now page with your Pay Now service key, a reference and the amount. Set your Accept, Decline, Redirect and Notify URLs in the Netcash dashboard. When Netcash calls your Notify URL, ask Netcash for the transaction status before you mark anything as paid.
1. Build the form on the server
export function payNowForm(key: string, order: { ref: string; cents: number; email?: string }) {
const fields: Record<string, string> = {
m1: key, // Pay Now service key
m2: process.env.NETCASH_VENDOR_KEY!,
p2: order.ref, // unique per payment
p3: `Order ${order.ref}`.slice(0, 50),
p4: (order.cents / 100).toFixed(2),
Budget: "Y",
m4: order.ref, // returns as Extra1
m10: `ref=${order.ref}`, // appended to Accept/Decline/Redirect
};
if (order.email) fields.m9 = order.email.slice(0, 100);
return { action: "https://paynow.netcash.co.za/site/paynow.aspx", fields };
}Pay Now is a redirect: your page posts a form to https://paynow.netcash.co.za/site/paynow.aspx and the customer pays on Netcash's page. Build the fields on the server so the service key never sits in client code you ship by mistake.
m1 is your Pay Now service key, m2 is the software vendor key (Netcash publishes a default one for merchants who are not software vendors), p2 is your unique reference, p3 a description of up to 50 characters, and p4 the amount in rand with two decimals. m4, m5 and m6 come back to you as Extra1, Extra2 and Extra3, which is the easiest way to carry your own order and user ids through the payment.
2. Set the four URLs in NetConnector
Netcash does not take the return URLs from your form. They live in the dashboard under Account profile, NetConnector, Pay Now: Accept, Decline, Redirect and Notify. Leave out any question mark; the m10 field is what Netcash appends as the query string.
If you cannot see the NetConnector page in your login, ask your Netcash advisor to enable it for your user. Without the Notify URL you will never hear about cash or EFT payments that complete later.
3. Confirm every notification
Netcash calls your Notify URL server to server for every payment, including offline ones, and retries until it gets through. The notification is not signed, so treat it as a hint and confirm it with Netcash before you credit anything. The full method is in our guide on verifying Pay Now notifications.
4. Test below R100 first
New Pay Now services start with a R100 transaction limit, and above it the card option simply does not show. Test with small amounts, or ask Netcash to raise the limit before you launch.
Read next
netcash pay now notifications are not signed: how to verify them, and card option missing on netcash pay now? check the r100 limit. Or browse every guide.
callCash() does all four steps for you, behind one function call and a checkout with your name on it.
Get early access