1. Embedding the Iframe
height based on your UI layout.
2. Listening to Iframe Events
When a user initiates an order, the iframe sends a message to the parent window usingpostMessage.
You must listen for:
Event Type: order-requested
Data payload includes a JWT token.
Client-Side Listener Example
3. Decrypting the JWT
After decoding the JWT, the structure appears as:- Deduct user balance
- Initiate payment collection
- Validate user session
4. Server-Side Order Confirmation (Process Payment)
Once you verify payment from the user, call:Request Body
Headers
Profile → Developers
5. Response Codes
| Status | Response | Meaning |
|---|---|---|
200 OK | { "success": true } | Payment accepted, order processing |
400 | { "error": "Failed to get balance" } | Validation error |
400 | { "error": "Insufficient balance" } | Not enough WizzGift balance |
404 | { "error": "Checkout not found" } | Invalid or expired checkout |
404 | { "error": "Unauthorized" } | API key missing or incorrect |
6. Webhook Handling
When a payment is accepted, WizzGift will send webhook updates to:7. Complete Integration Flow
8. Example End-to-End Code
Decode JWT (Node.js Example)
9. Security Recommendations
- Do not trust client-side validation alone.
- Always verify payment server-side before calling
doPayment. - Keep your API key secure and rotate periodically.
- Use HTTPS for all callback endpoints.
10. Support
For technical support or partnership inquiries: 📧 [email protected]🌐 https://www.wizzgift.com