Hello, I’m struggling with saving credit card details as payment method. I have a case with free trial period – if set, credit card is not added to customer’s payment methods, meaning it is not charged with first renewal.
I just wanted to let you know that I’ve tried another Stripe plugin, the Woocommerce’s official one. And there is the same behaviour, so the card details as payment method is not saved on customer’s account.
For test purposes I turned on the sign up fee along with trial period – as it needs to charge the card, it also saves it as payment method.
So it seems to be the plugin deficiency – if card is not charged in checkout (due to trial period), plugin does not enforce its authorization for future payments neither.
thanks for a quick reply. I did not test it with previous versions, although I observed the same behaviour with both plugins: “official” one and from Payment Plugins. No logs found in debug.log (with debugging enabled on staging site). I also tried turning off other plugins, but nothing has happened neither.
To reproduce the issue:
Add this code to functions.php of your theme (or with a plugin to manage php hooks): add_filter( 'fsub/cart/require_payment_on_trial', '__return_true' );
Create new subscription product: set its price and free trial period (to any value, it can be even 1 day)
Go to product page, add it to cart and go to checkout
If the Stripe’s credit card form appears, provide the details and proceed
Go to Woocommerce’s My account and navigate to My payment methods endpoint
There should be no payment method (credit card) saved
I’m testing this on the official plugin (the demo version, of course), and when I go to the subscription details, my credit card is saved there, even though I’m on a free trial.
Please see above.
The card details are listed there.
So, should I wait until tomorrow for the renewal, at which point the card will be removed, or is the field already empty after placing the order?
You can also send a screenshot of what it looks like on your end.
Just to be sure, I checked the section you’re referring to, and it looks correct.
For testing purposes, I also checked our other payment plugin (PayU), and the data is saved correctly there as well.
Appreciate your efforts and update on this thread. I managed to make it working in one scenario only: when using the old shortcode checkout. If modern block checkout is enabled, the payment method is not saved. Would you be able to confirm which one you’ve used for testing? 🙂