Closed csmcneill closed 4 months ago
I tested this a bit more and can confirm that Stripe Link is not affected.
Please add your planning poker estimate with Zenhub @ricardo
@bborman22 This applies to other payment methods other than BNPL as well.
I'm still trying to estimate this properly as I'm testing a fix, but I found the root cause of the issue.
Since we moved UPE APMs into separate WC payment methods (which I believe was before WooPayments 5.8.0), we're enqueuing a couple of scripts several times now.
So when looking for the isWooPayEnabled
prop in wcpay_upe_config
, it takes the value from the last defined global variable which doesn't come from the credit card payment method.
So the source code looks like this when not only credit card is available:
<script id="woocommerce-tokenization-form-js-extra">
var wc_tokenization_form_params = ...
var wc_tokenization_form_params = ...
var wc_tokenization_form_params = ...
</script>
...
<script id="wcpay-upe-checkout-js-extra">
var wcpay_upe_config = ...
var wcpay_upe_config = ...
var wcpay_upe_config = ...
</script>
I'm surprised that this has been an issue for so long and apparently we didn't find other side effects related to it.
Describe the bug
If a customer has an existing WooPay account, we expect there to be an OTP modal after the customer enters their email address on the checkout page:
However, if the site is using the shortcode checkout and offering BNPL methods, this modal will not render. I can confirm that this occurs with Klarna and Afterpay are available on the checkout page, but I have not yet confirmed that this occurs when Affirm is enabled.
To Reproduce
[woocommerce_shortcode]
checkout.woopay@example.com
).Actual behavior
If a merchant is offering WooPay and BNPL methods via the shortcode checkout experience, the OTP modal does not render for WooPay customers when they enter their email address on the checkout page. This can result in reduced usage of WooPay.
Expected behavior
The WooPay OTP modal renders on the shortcode checkout regardless of whether or not the merchant is offering BNPL methods.
Additional context
p1716368611870019-slack-C022WMN88KG