Testing and going live
Build and test without a bank facility, then switch to real payments.
Test mode
Every workspace starts in test mode. Test payments go to Kina Bank's test gateway using Kina Bank's shared test merchant, so you need nothing from the bank to begin. Test keys start with cpk_test_ and see only test data.
| Test card | Number | Expiry | CVV |
|---|---|---|---|
| Visa | 4012 0000 0000 3010 | Any future date | 123 |
| Kina debit card | 5076 4802 0002 1147 | As listed in Kina Bank's guide | — |
These are Kina Bank's published test cards. If one stops working, check Kina Bank's current integration guide.
Your server must be reachable
Webhooks are sent from CSHPay to your server over the internet. While developing on your own computer, use a tunnel so your webhook URL is reachable, and register the tunnel's address as a test endpoint.
Going live
- Get your own Kina Bank Internet Payment Gateway facility. Kina Bank gives you a Merchant ID, a Terminal ID and a secret key.
- Enter them in the dashboard under Kina Bank. The secret key is stored encrypted and is never shown again; afterwards you see only its fingerprint.
- Make the check payment. Pay PGK 1.00 with your own card through your new credentials. It proves the three values work together. The money goes to your own Kina Bank account and you can refund it afterwards.
- Choose a paid plan under Billing.
- Create a live API key and a live webhook endpoint. Live endpoints must use
https, and so must yourreturnUrl. - Swap the key and secret on your server. Nothing else in your code changes.
Before you take real payments
- Orders are marked paid only from the webhook or the API, never from the customer returning to your site.
- Your webhook handler verifies the signature against the raw body and rejects old timestamps.
- Your webhook handler is safe to run twice for the same event.
- Every create-payment request sends an
Idempotency-Key. - Your API key is on your server only, and not in your source repository.
- You have tried a declined card and an abandoned checkout, and your site handles both.
How you are billed
CSHPay is billed monthly in arrears: a plan fee plus any live payments above the plan's allowance. Kina Bank cannot charge a card automatically, so each invoice is taken from prepaid credit if you have enough, or paid by card from the dashboard. An invoice unpaid after 7 days pauses live API requests until it is paid. Test mode is never paused. Money your customers pay you is never touched.
