Fix incompatible types.

This commit is contained in:
Pedro Silva 2023-09-11 10:32:46 +01:00
parent 0ddd11ece1
commit 9e5e380424
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3

View file

@ -84,6 +84,11 @@ class GooglepayButton {
config.ppcpStyle = this.ppcpConfig.button.mini_cart_style;
config.buttonStyle = this.buttonConfig.button.mini_cart_style;
config.ppcpButtonWrapper = this.ppcpConfig.button.mini_cart_wrapper;
// Handle incompatible types.
if (config.buttonStyle.type === 'buy') {
config.buttonStyle.type = 'pay';
}
}
if (['cart-block', 'checkout-block'].indexOf(this.context) !== -1) {