Migration from official Stripe plugin
-
Hi there,
first of all, I must say that first impressions are great ??
I have been using the official stripe plugin and have decided to transition to yours.
I have 2 hurdles:
- I sell subscriptions, and as such need to make sure the transition does not cause issues there and that the card token does move across to your plugin. I did some research here in the support section and this seems to work without major issues
- I assumed the saved cards would automatically display in your plugin, but they don’t. Is there a limitation here? In mind mind, all one would need to show them is the card type, last 4 digits and the stripe token. And all of these are saved in the DB. Is there anyway of moving these across to your plugin’s DB so they could display in checkout?
Thanks in advance
Marlon
-
Glad to hear you like our plugin.
- Yes, your subscriptions will continue to process automatically and don’t require any migration effort.
- The customer’s saved payment methods should be showing up on the checkout page. Here is the logic that our plugin follows:
- Check if customer is logged in.
- If customer is logged in, check to see if they have a Stripe customer ID, either in our plugin’s format or another Stripe plugin.
- If the customer has an existing ID from another plugin, fetch the customer’s payment methods from Stripe.
- Save the payment methods in the Stripe plugin’s format.
When testing, make sure your customer ID is valid and exists in the Stripe account that the plugin is connected to. Also ensure the Stripe customer ID associated with your WordPress user has payment methods saved in stripe.com.
Kind Regards,
Thanks for the prompt reply.
Strange. The cards were not showing up on the staging site, but do on the live site. This was a test user with really old cards so perhaps the tokens had been disconnected from Stripe but still showing up in the old plugin history.
Not sure.
Anyway, I’ve made the switch. Let’s see how this goes.
I have a question of I may: keeping this plugin updated takes time and effort, and this is free. How do you get paid for your work?
MarlonThis was a test user with really old cards so perhaps the tokens had been disconnected from Stripe but still showing up in the old plugin history.
Yes, if the payment methods have been detached from the customer, they won’t appear in the list of saved payment methods for the customer. That’s likely what happened here.
I have a question of I may: keeping this plugin updated takes time and effort, and this is free. How do you get paid for your work?
As a Stripe Partner, we are paid to maintain this plugin and ensure its quality reflects that of Stripe.
Kind Regards,
Nice! Well. Yep it up. It’s a great plugin.
Ok, as suspected, most renewals are going through fine, but I have seen a couple of issues.
So, some users subs failed to renew. The error was something like this:
Recurring payment for order failed. Reason: No such PaymentMethod: ‘src_1GofjuDYhZwnEXXXXXXXX’
Looking at the user page on the backend, I noticed that there was no stripe ID, so I updated that. Still did not work. Same error message.
I noticed that the stripe payment token did not reflect the one listed on the user page (stored in Stripe), so I went into the DB and updated the table wp_woocommerce_payment_tokens see: https://ibb.co/hFpDBXB
No luck. When I attempt to charge the user, it still shows: Recurring payment for order failed. Reason: No such PaymentMethod: ‘src_1GofjuDYhZwnEXXXXXXXX’ (with the incorrect token)
Any ideas?
It turns out that if I log in as the user and go through the payment process manually it fixes this.
I noticed that the stripe payment token did not reflect the one listed on the user page (stored in Stripe), so I went into the DB and updated the table wp_woocommerce_payment_tokens see:?https://ibb.co/hFpDBXB
When the Stripe plugin processes the renewal payment, it doesn’t use an entry from the wp_woocommerce_payment_tokens table. It uses the metadata entry for the renewal order called
_payment_method_token
. You can modify the payment method for the subscription by going to the WooCommerce > Subscriptions > Edit Subscription page and click the pencil icon next to “Billing details”.You will see an input field where you can modify the payment method associated with the subscription. Note that any renewal order that exists already has its own
_payment_method_token
value that was copied over from the subscription. So any edits you make to the subscription will pertain to future renewal orders.You can also just modify the subscription and orders using your WordPress tables.
Kind Regards,
Got it. Never knew that was there.
Ok, the solution is (in case someone faces this issue):
EITHER
Log in as the user and checkout with the saved card (if the correct customer token is present in the user page – you can get this from stripe.com or the subscription information). This will update future renewals.
OR
Go to the sub, update the token info. Then delete the failed order, create a new pending order and attempt to charge.
Thank you very much
Marlon
Hi Marlon,
I’m facing this exact issue where our subscriptions aren’t going and are giving the error message “Payment Failed. Reason: No such PaymentMethod: ‘pm_1N0xVtEbTrRAqStAubkgxg9E’”
Please can you clarify the second option where you go to the subscription, update the token info etc.. I’m not sure of the exact steps and it would be great to understand how to do this.
Thanks,
Gus
Sure thing. So:
- go to the sub page and click on pencil icon next the “billing” header.
- Update the “Payment Method Token” with the correct one for that user. This can be found in the User page or in Stripe. It starts with “src_”
- Now delete the pending order that failed.
- Create a new pending order. This is done from the “Subscription Actions” box in the main sub page.
- Finally, navigate to the new order page and under “Order Actions” manually renew.
All done!
Thanks for your help, much appreciated.
@mrclayton Hope you’re well.
I wonder if you could help. I continue to have issues with the transition to your plugin.
So, I continue to see payments fail with the following error, many months after the initial transition to your plugin: “Recurring payment for order failed. Reason: A source must be attached to a customer to be used as a
payment_method
.”It seems that when a renewal payment fails, even if the user comes to the site and updates the payment details on the checkout page in order to pay for the failed renewal, the “Payment Token” field does not get updated. This means the payment will fail again the following month. This will continue until an admin updates the info on the sub page manually.
Should the token not get updated in the sub when the user enters a new payment method?
Let me know
Marlon
Should the token not get updated in the sub when the user enters a new payment method?
Yes, the Stripe plugin is designed to store the customer’s new payment method against the subscription object so that future renewal payments use that updated payment method ID. The plugin determines if the failed order is a renewal order, and if it is, it saves the customer’s payment method.
I just ran a test where a renewal order failed and the customer pays for the failed renewal order. The customer’s new payment method was correctly saved and added to the subscription object.
When WCS triggers the action
woocommerce_subscription_failing_payment_method_updated_${gateway_id
the plugin associates the new payment method with the subscription object. That action is triggered when the failed renewal order is paid for by the customer.Based on your description of the issue, it’s as if that action is not being triggered by WCS. I’d recommend performing this test scenario on your staging site using test mode to see what the result yields.
Kind Regards
Thanks for your message. @mrclayton
So, I followed (I think) your recommendation on our staging site: https://vimeo.com/846303168/18042df80e
Any ideas?
Thanks for providing that video. For subscription #99040, once you refreshed the page after paying for the failed order, it shows it was a manual renewal which is a clue I believe.
I don’t believe WCS is triggering the action
woocommerce_subscription_failing_payment_method_updated_stripe_cc
after the failed renewal is paid for because it believes the subscription is a manual subscription. This could be happening because the_payment_method
metakey for the subscription is stillstripe
.Try the following:
For subscription #99040, navigate to your WordPress postmeta table and for post_id enter 99040. Check what the value is for the meta_key _payment_method. Is the value “stripe”? If so update it to “stripe_cc”. Then, go through your test scenario again where you generate a failed renewal order. Once the renewal order fails, pay for the failed renewal order using a brand new credit card. Then, process a new payment for the subscription and see what happens.
Kind Regards
Hi again,
Yes, it’s set to manual renewal payments as that’s what WC does when it detects a staging site.
However, I navigated to the DB and it was already set to “stripe_cc”
Any ideas?
Thanks in advance
- The topic ‘Migration from official Stripe plugin’ is closed to new replies.