Quickstart
Take a Kina Bank card payment in three steps. Start in test mode: no bank facility is needed.
CSHPay sits between your application and the Kina Bank Internet Payment Gateway. You create a payment with one API call, send your customer to pay, and receive a signed webhook when Kina Bank confirms it. Card details are entered only on Kina Bank's own page, and live payments settle directly to your own Kina Bank account.
Before you start
- Create a workspace. It starts in test mode.
- In the dashboard, open API keys and create a test key (
cpk_test_…). Copy it; it is shown once. - Open Webhooks, add the URL of your server's webhook route, and copy its signing secret (
whsec_…).
1. Create a payment
From your server, when your customer is ready to pay:
curl -X POST https://cshpay.cksolutionshub.com/api/v1/payments \
-H "Authorization: Bearer cpk_test_..." \
-H "Content-Type: application/json" \
-H "Idempotency-Key: ORDER-14" \
-d '{
"amount": 968.62,
"reference": "ORDER-14",
"description": "Order #14",
"returnUrl": "https://your-site.com/thanks"
}'The Idempotency-Key header makes a retried request return the same payment, so a network hiccup can never create two. Use your own order id.
{
"id": "7b0e3c0a-6f0b-4b63-9d0c-2f8f7a3a1e11",
"object": "payment",
"mode": "test",
"reference": "ORDER-14",
"amount": "968.62",
"currency": "PGK",
"status": "pending",
"checkoutUrl": "https://cshpay.cksolutionshub.com/checkout/7b0e3c0a-6f0b-4b63-9d0c-2f8f7a3a1e11",
"returnUrl": "https://your-site.com/thanks",
"expiresAt": "2026-11-19T00:00:00.000Z"
}2. Send the customer to pay
Redirect the customer to checkoutUrl. They see your business name and the amount, click Pay, and enter their card on Kina Bank's page. In test mode use Kina Bank's test Visa card 4012 0000 0000 3010, any future expiry, CVV 123.
Prefer to keep the customer on your own page? See Checkout for the drop-in page.
3. Confirm it from the webhook
When Kina Bank confirms the payment, CSHPay posts a payment.succeeded event to your webhook URL. Verify its signature, then mark the order paid.
app.post('/webhooks/cshpay', express.raw({ type: 'application/json' }), (req, res) => {
const raw = req.body.toString('utf8');
if (!cshpay.verifyWebhook(raw, req.get('Cshpay-Signature'))) return res.status(400).end();
const event = JSON.parse(raw);
if (event.type === 'payment.succeeded') {
markOrderPaid(event.data.payment.reference); // your code
}
res.sendStatus(200);
});status: "succeeded".Next
- Libraries and samples for Node.js, Next.js, Python and ASP.NET Core.
- Webhooks: events, signatures and retries.
- Testing and going live.
