woocommerce / woocommerce-gateway-amazon-pay

Amazon Pay Gateway
20 stars 23 forks source link

Paying for renewal payment after free trial doesn't save Amazon Pay as the payment method & stays in manual renewal #283

Open mattallan opened 4 months ago

mattallan commented 4 months ago

Internal ticket: 8137103-zen

Describe the bug

In WooCommerce Subscriptions we have a setting that allows customers to purchase $0 subscription products (i.e. subscriptions that have a trial period) without entering a payment method on the checkout: image

After the free trial ends, when the customer pays for the first renewal order with Amazon Pay, the new payment method is not set on the subscription resulting in the subscription remaining as requiring manual renewal, instead of automatically renewing with Amazon Pay.

Here's a screen recording highlighting the issue:

https://github.com/woocommerce/woocommerce-gateway-amazon-pay/assets/2275145/3c849770-2ed9-4d83-a175-f68fad375987

To Reproduce Steps to reproduce the behavior:

  1. Enable the $0 checkout setting in WooCommerce > Settings >Subscriptions
  2. Create a subscription product with a 7-day free trial
  3. Purchase the subscription with no payment method.
  4. You will see the trial and next payment date. The subscription will be in "manual payment" mode which is expected.
  5. Manually trigger the subscription renewal using the "Process renewal" subscription action: image
  6. Now pay for the new pending renewal order from My Account page and complete the payment with Amazon Pay
  7. Check the subscription on the My Account page and notice that it's still saying it is manual renewal.

Expected behavior

The subscription will renew automatically with Amazon Payments and not require manual renewal.

Isolating the problem (mark completed items with an [x]):

WordPress Environment

``` Copy and paste the system status report from **WooCommerce > System Status** in WordPress admin. ```