saucal / woocommerce-gateway-amazon-pay

Amazon Pay Gateway
0 stars 1 forks source link

prevents JS fatal when jQuery.Event is passed to renderButton #167

Closed dpanta94 closed 2 years ago

dpanta94 commented 2 years ago

All Submissions:

Changes proposed in this Pull Request:

Was introduced in pull #165 and produces:

Uncaught AmazonPay:
Can not find element #pay_with_amazon_2 for amazon.Pay.renderButton.

image

renderButton is being registered as a callback to jQuery Events, which pass always the Event as the first parameter. As a result the function was running with invalid parameters. We ensure that when that happens, params revert back to defaults.

Other information: