// Widget Ready - Fired when the widget is fully loaded and ready{ type: 'READY', payload: void}// Widget Destroyed - Fired when the widget is destroyed{ type: 'DESTROY', payload: void}
// 3DS Started - Fired when 3DS verification begins{ type: 'PAYMENT_3DS_START', payload: void}// 3DS Successful - Fired when 3DS verification is successful{ type: 'PAYMENT_3DS_SUCCESS', payload: void}// 3DS Error - Fired when 3DS verification encounters an error{ type: 'PAYMENT_3DS_ERROR', payload: { code: string; message: string; details?: unknown; }}// 3DS Failed - Fired when 3DS verification fails{ type: 'PAYMENT_3DS_FAILURE', payload: { code: string; message: string; details?: unknown; }}
Events related to form interactions:
// Field Change - Fired when a form field value changes{ type: 'FIELD_CHANGE', payload: { field: string; value: unknown; }}// Field Blur - Fired when a form field loses focus{ type: 'FIELD_BLUR', payload: { field: string; value: unknown; }}// Form Submit - Fired when the form is submitted{ type: 'FORM_SUBMIT', payload: Record<string, unknown>}
onMessage: async (message) => { if (message.type === 'PAYMENT_SUCCESS') { // Update order status in your system try { await updateOrderStatus(orderId, 'paid', message.payload.transactionId); showSuccessMessage('Payment successful! Your order has been confirmed.'); } catch (error) { // Handle order update error console.error('Failed to update order status:', error); showWarningMessage('Payment successful, but order status update failed. Please contact support.'); } }}