Build your own integration
Connect SeevPlus to any store, booking system or app that can run server code, using the Checkout API and webhooks.
There is a ready-made plugin for WooCommerce. For any other platform, you can build the same integration yourself on the Checkout API. It works anywhere you can run code on a server and send the shopper to a link: a custom store, a booking or ticketing system, an internal tool, or a platform that lets you add your own payment method.
The WooCommerce plugin is built exactly this way.
What you are building
- Your server creates a checkout session for the order and saves the reference it gets back.
- The shopper pays on the SeevPlus page and comes back to your site.
- Your server looks the payment up and marks the order paid only if SeevPlus confirms it.
- A webhook tells your server about payments straight away, including ones where the shopper never came back.
- A scheduled job checks anything still unpaid, in case a webhook was missed.
Every step runs on your server. Your API key and webhook secret never go to a browser or a mobile app.
Before you start
- A SeevPlus organization. Live payments need it to be verified; sandbox works before that.
- A Checkout API key for sandbox and one for production, from Developers in the dashboard. See API Keys.
- Prices in Ghana cedis. Amounts are sent in pesewas, so GHS 100.00 is
10000.
1. Create a checkout session
When the shopper places the order, create a session from your server. Send the whole order total as one amount, so shipping, discounts and tax are exactly what your platform worked out.
curl -X POST "https://api.seevplus.com/api/v1/developer/payments" \
-H "Authorization: Bearer $SEEV_SECRET_KEY" \
-H "Idempotency-Key: order-1042-attempt-1" \
-H "Content-Type: application/json" \
-d '{
"type": "checkout",
"currency": "GHS",
"amount": 12500,
"recipient": {
"name": "Ama Mensah",
"email": "ama.mensah@gmail.com",
"phone": "233241234567"
},
"redirect_url": "https://shop.example.com/seevplus/return?order=1042",
"meta": { "order_id": "1042" }
}'- Idempotency-Key makes a retried request safe. Use one key per payment attempt, for example the order ID plus an attempt number, so a network retry never creates a second session. See Idempotency.
- recipient must be the details the shopper actually gave you. Do not make up a name or email when one is missing. See Customer details.
- redirect_url is where the shopper comes back after paying.
- meta is yours. Put your own order ID in it so you can match a payment to an order later.
The response holds reference and checkout_url. Save the reference against the order, then send the shopper to checkout_url.
2. Check the payment when the shopper comes back
The return to your redirect_url only means the shopper left the payment page. It does not prove they paid. Look the session up by the reference you saved:
curl "https://api.seevplus.com/api/v1/developer/payments/$REFERENCE"This lookup needs no API key. Mark the order paid only when all three hold:
statusiscompletedorsuccess.final_amountequals the order total in pesewas. Iffinal_amountis missing, compareamount.currencyisGHS.
If the status is failed or cancelled, show the order as unpaid and let the shopper try again with a new session. If it is still pending, show a "we're confirming your payment" page and let the webhook or the scheduled job finish it.
If the payment is confirmed but the amount does not match, hold the order and check it in your dashboard. Do not ship it.
3. Receive webhooks
In the dashboard, open Developers, Webhooks and add your endpoint with the payment.succeeded and payment.failed events, once for sandbox and once for production. Store each signing secret on your server.
Check every delivery before you act on it. SeevPlus signs timestamp + "." + body with HMAC-SHA256 and sends the result as v1=<hex> in X-Seev-Signature, with the timestamp in X-Seev-Timestamp.
import crypto from 'node:crypto';
function isGenuine(secret, timestamp, signature, rawBody) {
// Refuse old deliveries so a captured request cannot be replayed.
if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false;
const expected =
'v1=' +
crypto
.createHmac('sha256', secret)
.update(`${timestamp}.${rawBody}`)
.digest('hex');
return (
expected.length === signature.length &&
crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(signature))
);
}Use the raw request body, exactly as it arrived. Parsing it into JSON and turning it back into text changes the bytes and the check fails.
Once the signature checks out, take data.transaction.reference from the delivery and look the session up as in step 2, with the same three checks. The webhook's own amount is in cedis, not pesewas, which is one more reason to check against the lookup. Then answer 200 quickly and do any slow work afterwards. The same payment can arrive more than once, so ignore it if the order is already paid. Use the reference, not the delivery id, to spot repeats. The full payload and retry rules are in Developer Webhooks.
4. Catch anything that was missed
A webhook can fail to reach you, for example while your server is down. Run a job every few minutes that looks up each order still waiting on SeevPlus, using the same lookup and checks. Stop checking an order once it is paid or failed, or after a day or two.
Test it in sandbox
With a sandbox key, the payment page has buttons to approve or decline a payment and no money moves. Before you go live, check each of these:
| Test | What should happen |
|---|---|
| Approve a payment | The order is marked paid once. |
| Decline a payment | The order stays unpaid and the shopper can pay again. |
| Close the tab after approving | The webhook marks the order paid. |
| Turn your webhook endpoint off, approve, then turn it back on | The scheduled job marks the order paid. |
| Send the same webhook twice from the dashboard | Nothing happens the second time. |
Keep sandbox checkout away from real shoppers, since anyone who sees it can approve an order without paying.
Go live
- Swap in the production key and the production webhook secret.
- Make sure your organization is verified. Until then, live payments are refused with
403. - Place one small real order and confirm it is marked paid.