Token Widget
Generate a widget URL for Apple Pay and Google Pay payments.
Request Parameters
| Name | Type | Description |
|---|---|---|
public_keyRequired | String | Merchant identifier. Example: `i000000001` |
amountRequired | Number | Payment amount. Example: `100`, `20.50` |
order_idRequired | String | Unique order ID. Max 255 characters. |
descriptionRequired | String | Payment description. Max 1000 characters. |
PHP (Laravel) Example
PHP (Laravel)
1$payload = [2 'public_key' => 'public_key',3 'amount' => 2.50,4 'order_id' => 'order id generated by your system',5 'description' => 'Test payment',6];7
8$data = base64_encode(json_encode($payload));9$private_key = 'your_private_key';10$signature = base64_encode(sha1($private_key . $data . $private_key, 1));11
12$request = Http::get("***", [13 'data' => $data,14 'signature' => $signature15]);16
17$response = $request->json();Response
Response
1{2 "status": "success",3 "widget_url": "***"4}Using the Widget
Embed the returned widget_url in an iframe or webview:
HTML
1<iframe src="" width="100%" height="400"></iframe>When the payment is completed inside the iframe, you can receive the result by listening for the message event:
JavaScript
1window.addEventListener('message', function(event) {2console.log(event.data); // {status: 'success', payment: {...}}3});