Hi there, I’m trying to make a function to change user’s email address along with Stripe account email for the user. I’m using Stripe.js ‘Customer - Update’ and it seems updating the account email on Stripe but when I go to the Stripe’s checkout page the email is not updated.
I’ve actually talked to the Stripe’s support and I got this answer from them.
“So what happens here is that because you have updated the email via the API, it still prefills from the last checkout session. So if you change it in the session it’ll update the customer object, rather than the customer object updating the next checkout session.”
I’m not too sure what this means, is there anyway to achieve email update on Stripe with Bubble’s presets? It sounds like I have to code to get this working.
When using the Stripe API, which is what Stripe.js plugin allows you to do without needing to setup the API calls yourself, you have a choice when creating a checkout session to send a customer email address or a customer object id (when a customer already exists there will be an id associated with them created by Stripe).
What Stripe support was telling you to do is to send the new email address instead of the customer object id for the next checkout session so that there will be the update at the time of the next checkout session instead of trying to update the customer object before hand. ( I think )
Basically in steps
Create a checkout session
Pass new customer details to update the customer object.
Steps don’t do
Update customer details
Create new checkout session sending customer object id
Sounds like the prefill is using the old data instead of the updated data, but I’m not 100% sure on that.
I am not familiar with the Stripe.js plugin so I can not comment on what features or functions it does or doesn’t have. But the Stripe API does provide the option I mentioned.
I’d try to reach out to the developer of the plugin and inquire if they can point you in the right direction on how to utilize the plugin to accomplish the task at hand.
I tested it with my partner and the result was as I shown. The email appears to be changed on the Stripe dashboard but if you charge the user an email will be retrieved from the last charge session.