Automattic / woocommerce-payments

Accept payments via credit card. Manage transactions within WordPress.
https://wordpress.org/plugins/woocommerce-payments/
Other
172 stars 69 forks source link

BNPL - Respect minimum order amounts when adding the PMME to the page #9244

Closed mdmoore closed 1 week ago

mdmoore commented 1 month ago

Describe the bug

BNPL has minimum order amounts. Stripe uses the total when determining which BNPL methods are applicable. If no payment methods are applicable, say due to the total not hitting the minimum, no payment methods are displayed. Until recently, this wasn't a problem because nothing would be displayed on the page. However, the container with id payment-method-message is still added to the page and contains an empty Stripe iframe. Since https://github.com/Automattic/woocommerce-payments/pull/9166, a skeleton loader is added. When minimum order amounts aren't hit, the skeleton loader still appears, but no PMME is displayed when loading is finished. The result is a loader that appears to load nothing.

To Reproduce

  1. Enable all BNPL payment methods
  2. Set your currency to USD
  3. Create a product that is less than $1.
  4. Navigate to the product and see the skeleton loader appear

Screenshots

https://github.com/user-attachments/assets/680ace22-648f-4849-bf80-1d691b33de22

Expected behavior

The loader shouldn't appear if minimum order amounts aren't met for the selected currency.

bborman22 commented 4 weeks ago

Hey team! Please add your planning poker estimate with Zenhub @asumaran @cesarcosta99 @lovo-h @reykjalin @rafaelzaleski @ricardo

rafaelzaleski commented 2 days ago

@cesarcosta99 @bborman22 While testing another issue, I noticed that this bug can also occur with the maximum amount, but I believe the fix only addressed the minimum amount. Notice the blank space in the image below.

Screen Shot 2024-09-10 at 11 15 21 AM