Send custom events from the Web Checkout JS bridge
As well as being used for the payment process, the JS Bridge can be used to transfer custom events between a web view and your app.
Send custom data in platform events
All events between your Poq app and the Web Checkout JS bridge support an extra customData
property which can contain information that you require to be passed through to your customisations made using the Poq SDK.
The following snippet sends extra data containing the collection information for the user.
PoqWebCheckout.send('paymentcompleted', { order: { total: 13.0, orderId: '0776620100', subTotal: 10.0, delivery: 5.0, discount: 2.0 }, customData: { nearestStore: '0141', collectionDate: '2019/01/01' }});
Send custom events
The Poq web checkout JS bridge also supports sending completely custom events that you can develop with the Poq SDK.
The following snippet sends a custom event containing custom data.
PoqWebCheckout.send('mycustomevent', { customData: { analyticsEvent: 'cta_clicked', userId: '26b5abba-b597-4209-8187-6eda501b0663' }})