Sample App: Go
A working Go integration against the PayKore sandbox. No framework required — two plain Go files you can read top to bottom.
Source: samples/go/ in the PayKore repo.
What it covers
| Step | Flow |
|---|---|
| 1 | Create two wallets |
| 2 | Fund wallet A (sandbox only) |
| 3 | P2P transfer: A → B |
| 4 | Bank transfer from A (async, settles via webhook) |
| 5 | QR payment: merchant creates intent, payer pays |
| 6 | USSD payment: initiate + simulate confirmation |
| 7 | KYC: submit BVN (async, result via webhook) |
Prerequisites
- Go 1.21+
- A PayKore sandbox API key — sign up at app.paykore.com
Setup
cd samples/go
go mod tidy
Run the quickstart
export PAYKORE_API_KEY=sk_test_YOUR_KEY_HERE
go run quickstart.go
You'll see a ✅ line printed for each step. The full run takes under 10 seconds.
═══════════════════════════════════════
PayKore Go Quickstart
Environment: sandbox
═══════════════════════════════════════
── Step 1: Create wallets ──
✅ Wallet A created
{
"id": "wlt_9f3kA2mXpQ",
"status": "pending",
"nuban": "0123456789"
}
...
✅ P2P transfer completed
✅ Bank transfer accepted (202)
✅ QR payment completed (payer)
✅ USSD simulation: confirm sent
✅ BVN submitted
═══════════════════════════════════════
All steps completed successfully.
Run webhook-server.go to test async event delivery.
═══════════════════════════════════════
Run the webhook server
Steps 4 (bank transfer) and 7 (KYC) produce async results. The webhook server captures and prints them.
Terminal 1 — start the server:
export PAYKORE_WEBHOOK_SECRET=whsec_YOUR_SECRET_HERE
go run webhook-server.go
Terminal 2 — expose it via ngrok:
ngrok http 8080
Register the ngrok URL with PayKore:
curl -X POST https://sandbox.paykore.com/v1/webhooks \
-H "Authorization: Bearer $PAYKORE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://YOUR_NGROK_URL/webhooks",
"events": ["transaction.completed","transaction.failed","wallet.activated","kyc.verified","kyc.failed"]
}'
Save the secret from the response and export it as PAYKORE_WEBHOOK_SECRET.
Terminal 3 — run the quickstart again:
go run quickstart.go
You'll see events arrive in Terminal 1:
── 2025-06-01T10:03:24Z ──
Event: transaction.completed
✅ Transaction completed
ID: tx_8wXyZ1aBcD
Type: bank_transfer
Reference: go_bank_f47ac10b-...
Amount: ₦1000.00
── 2025-06-01T10:03:26Z ──
Event: kyc.verified
✅ KYC verified
User ref: go_user_a_1717200000
Type: bvn
Verified at: 2025-06-01T10:03:25Z
Key files
| File | What it is |
|---|---|
quickstart.go | The runnable script — one block per flow |
webhook-server.go | The HTTP server — signature verification + event handlers |
go.mod | Module definition with SDK dependency |
Next steps
- Go SDK Reference → — Full method documentation for every SDK call used here.
- Verifying Signatures → — How
verifySignature()in the webhook server works. - Test Scenarios → — The full pre-launch checklist once the quickstart is working.