[ ] Does your code follow the Extendables standards?
[ ] Have you written new tests for your changes, as applicable?
[ ] Have you successfully run tests with your changes locally?
Changes proposed in this Pull Request:
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:
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.
This PR fixes this issue by making sure Amazon Pay is also set as the payment method of the subscription when also copying over the payment method meta from the order.
Closes #283
How to test the changes in this Pull Request:
Install and activate the latest WooCommerce Subscriptions extension
Enable the $0 checkout setting in WooCommerce > Settings >Subscriptions
Create a subscription product with a 7-day free trial
Purchase the subscription with no payment method.
You will see the trial and next payment date. The subscription will be in "manual payment" mode which is expected.
Manually trigger the subscription renewal using the "Process renewal" subscription action:
Now pay for the new pending renewal order from My Account page and complete the payment with Amazon Pay
Check the subscription on the My Account page and confirm the payment method is set to Amazon Pay:
Process another renewal and confirm Amazon pay processing the renewal automatically.
Other information:
[ ] Have you checked to ensure there aren't other open Pull Requests for the same update/change?
Changelog entry
Fix - Paying for a manual renewal after a free trial doesn't save Amazon Pay as the payment method
All Submissions:
Changes proposed in this Pull Request:
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:
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.
I recorded my screen to showcase the issue:
https://github.com/woocommerce/woocommerce-gateway-amazon-pay/assets/2275145/3c849770-2ed9-4d83-a175-f68fad375987
This PR fixes this issue by making sure Amazon Pay is also set as the payment method of the subscription when also copying over the payment method meta from the order.
Closes #283
How to test the changes in this Pull Request:
Other information:
Changelog entry