Payment Method Changed Callback
Optional callback that allows a partner to get information about the changes to the currently selected payment method inside Checkout3.
Callback is triggered when a different payment method is selected in Checkout3 by the user.
Registering callback
To use this optional callback, a partner has to pass an additional flag paymentMethodChangedCallback to avardaCheckoutInit. Please refer to Showing the checkout form for additional info about Checkout 3 Form initialization.
Callback payload
Callback payload is an object with paymentMethod, paymentFee amd taxAmount properties as the first parameter and checkoutInstance as the second parameter (it is not necessary to use it).
paymentMethodis the name of the selected payment method, represented as a stringpaymentFeeis the fee amount for the selected payment method (including tax), represented as a numbertaxAmountis the tax applied to the payment fee, represented as a number
The example below shows how to use these values in a callback function.