Payment Callbacks
When a customer pays via an external provider, the provider redirects them back to your theme. Your theme must implement these return pages.
Pesapal
After a Pesapal payment, the customer's browser is redirected to:
/checkout/success?OrderTrackingId=<trackingId>&OrderMerchantReference=<orderId>
| Query param | Value |
|---|---|
OrderTrackingId | Pesapal's internal tracking ID |
OrderMerchantReference | The Dukanext order _id |
Show a success confirmation page. You do not need to fetch the order — the payment has been processed on the backend by the time the customer lands here. A simple branded "Your order was placed successfully" screen is enough.
Dukanext Wallet
After a DN Wallet payment, the customer is redirected to:
/shop
No order ID is passed as a query param. If you want to show an order confirmation on return, optionally store the order ID in sessionStorage before redirecting:
// before redirecting to DN Wallet
sessionStorage.setItem('dn_pending_order', orderId);
// on /shop page load
const orderId = sessionStorage.getItem('dn_pending_order');
sessionStorage.removeItem('dn_pending_order');
// fetch and display the order
No payments activated
No redirect occurs. The order creation response contains the full order — show the confirmation directly from it:
{
"status": "success",
"data": {
"_id": "69e93be95c08152c63f2b8ef",
"orderNumber": "dels-4584--main",
"products": [
{ "_id": "69bc36fda53000e2ede23dca", "title": "main product", "quantity": 1 }
],
"shippingTotal": 0,
"productsTotal": 5,
"cartTotal": 6,
"taxTotal": 1
}
}
Order confirmation page requirements
Every order confirmation page must display:
- Order reference number (
orderNumber) - List of items ordered
- Order total (
cartTotal)