The render
event is triggered after the button is fully visible.
render
Render event handler callback, triggered on render.
The click
event is triggered after the button is clicked.
click
Render event handler callback, triggered on click.
State "disabled" disables/enables the button, e.g. makes it non-interactive/interactive State "loading" displays/hides the loading indicator in the button
Optional
value: booleancan be used to set the state to a specific value instead of toggling
Interface to the Payment Button interface.
From the click event handler you should trigger
initiate
.Example
Note that awaiting any asynchronous code before the initiate call in the click handler will prevent popups from opening which will affect user experience negatively.
If you need to asynchronously fetch data before the click handler runs, you can use the
render
event and disable the button during the fetching. You should indicate to the consumer that data is loading if using this pattern.Example of fetching cart asynchronously data on-load