Bubble's native Stripe plugin error while processing payments

All of a sudden some of our credit card transactions aren’t working but some are going through fine. We are getting “No such customer” errors in the logs.
Any idea?

It’s hard to tell without more info but in general terms it means you’re providing a Stripe customer ID, and Stripe can’t find that ID (cus_123456789) in its database. So, check that customer IDs are being created, saved to the user, and supplied to the API call correctly. The first thing I’d check is if the issues are appearing for first time buyers or repeat buyers. If it’s just one of the two it’ll help you narrow down your issue.

Thanks. I checked and its’ the new customers transactions ARE the ones going through. We recently switched to a new Stripe account for reconcilation purposes so it won’t have old transaction data. We are not passing Stripe customer ID anywhere perhaps Bubble is keeping of Stripe customer id somewhere in backend and passing it along but the old customer is not being found. Is this the case?

Well then that’s the problem. Bubble’s Stripe plug-in stored the Stripe customer ID on the user, but then you switched Stripe accounts. Your database stores the customer IDs for the old Stripe account so when it sends them to your new Stripe account it doesn’t know what to do with them.

I have not much idea about how you might go about fixing this but for all of your old customers (from the old Stripe account) you could create a new Stripe customer in the new account and save that ID to the user in the Bubble database. But there might be a better solution that will migrate all of the old Stripe account data to the new account - maybe research that first. Someone else here might have a better solution.

I don’t really understand why you had a need to create a new Stripe account though, you’ve made life more difficult for yourself!

Yep… that’s the problem (the customers don’t exist in your Stripe account - just like the error message says).

Yes you are… the Bubble Stripe plugin passes the customer ID to stripe… so it’s passing the old Customer ID, which doesn’t exist in your new Stripe account.

Unfortunately, due to the way the Bubble Stripe plugin works, there is no way to change or remove the customer ID for a user once it’s set.

If you want to continue using the Bubble Stripe plugin, then only real option is to delete the User from your database, and create a new User - hardly an ideal solution.

Alternatively, ditch the plugin and make your own Stripe calls with the API connector… then store the Customer IDs in a custom field on the User datatype.

1 Like

Got it. We had payments coming from various sources (website Square-space, POS, in-person card reader, etc.) each one with their self generated descriptions into stripe that were getting harder to reconcile. The idea was to route bulk of the non-subscription transactions from ONE source to another account so it a bit more organized. It wouldn’t matter if they were in a new account.

I understand that’s it may not have been the ideal solution but I should be able to create a new customer nonetheless.

Obviously, deleting a user and recreating will make all transactions orphaned, so that’s not going to work. Since Bubble’s don’t allow creating of new Stripe account I’ll have to resort to another solution which can generate a new customer in Stripe.
Thank you for the suggestion Adamhholmes.

That’s correct, you can, but not with the Stripe plug-in, and the transaction history from the old customer won’t be put into the new customer account so from the customer point of view you would essentially not be able to show them any transactions from the old Stripe account…

EDIT: if you do work this out then do reply to this post because I’m curious how you might go about solving it

All our customer order history is stored in our app; it’s available to customers. Anyhow, after some research I figured that Stripe allows coping customers from one account to another one. The details can be found here. I’ll try that first and report back.

2 Likes

I was able to copy Stripe customers to the new account. After that, everything is working fine again. Although, as mentioned in Stripe documentation, no transaction data was copied over but it’s fine because I don’t need it. If there were subscription items that would be a huge problem though. I wish there was a way to access Bubble stored Stripe Customer ID so I could use it to make calls other get data if needed.

Anyhow, I also found a Stripe plugin (Stripe ACH +) that allows creating or passing an existing Customer ID. I plan on using that so I can store Stripe customer’s id in my app, which will come in handy for other APIs call.

You can access it… you just can’t change it