| Attribute | Description |
|---|---|
allow="clipboard-write" | Allows clipboard write inside the iframe (e.g. Copy Link); otherwise the browser may block copy. |
allow-same-origin in sandbox: otherwise the iframe would be treated as same-origin with the embedder, allowing our page to access the embedder’s document and creating a security risk. Without sandbox, the iframe loads under our domain normally; cookies, storage, and canvas export/download work; the parent only needs to grant clipboard via allow="clipboard-write".postMessage to the parent window so the parent can hide the iframe, close a modal, or run other logic.| Field | Type | Description |
|---|---|---|
type | string | Always 'MERCHANT_COLLECT_CLOSED'; use this to identify the close event. |
source | string | Always 'merchant-collect'; identifies the sending page. |
{
"type": "MERCHANT_COLLECT_CLOSED",
"source": "merchant-collect"
}window.parent !== window).window.parent; targetOrigin is determined by env or default.event.origin and only accept messages from trusted origins:| Parameter | Values | Effect |
|---|---|---|
darkMode | true / 1 / yes | Force dark |
darkMode | false / 0 / no | Force light |
src, the parent can append this parameter to the server-returned collect URL, e.g.:https://example.com/en/merchant-collect?token=xxx&darkMode=truedarkMode parameter (e.g. load with URL light, then switch to dark via postMessage).| Field | Type | Description |
|---|---|---|
type | string | Must be 'MERCHANT_COLLECT_SET_DARK_MODE'. |
darkMode | boolean | true = dark, false = light. |
contentWindow and call postMessage with the collect page’s origin as the second argument (use window.location.origin when same-origin):darkMode parameter.