Widget: dynamic setup
Why use a dynamic setup
Using a dynamic setup will grant you a greater flexibility.
For example, setting the amount (data-amount) dynamically will allow your customers to buy multiple products in one transaction.
As the payment logic and management is coming from UnivaPay, you don’t need to develop it from scratch.
It is also possible to set up metadata dynamically, which allow you to link the order data with the payment data, making it easier to identify a transaction when a refund is needed.
The payment result will be send (POST) as JSON data to the URL specified in Webhooks created in the management console.
Please refer to Reference > Webhook and set up a a script to get data (POST) and update order status etc.
- In the management console: adjust the widget theme
- Create a test application token
- Set up a script to output the widget HTML
- Set up a script to receive webhooks
- In the management console: create a webhook
- Make a test payment to test the webhook script
- Create a live application token
- Update your widget script to use the live application token
- The widget is ready