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.
Thanks for the help boston85719
I think I get the picture but I’m still not sure how to do what you said, and this part
Are you saying that Stripe API has the option which I have no access with the Stripe.js Plugin?
I think I get the concept of session and object but I’m not a coder so I have no idea what to do… bummer
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.
Here is a link to Stripe API Documentation
This section in the screen shot shows the options
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.
boston85719 Again, thank you very much for your help.
I’m gonna bring this issue to the plugin developer as you suggested.
I just tested this on my end and it works fine with stripe.js - customer update. Did you try refreshing your stripe page?
Thanks for the reply paul29,
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.
Did you check the Stripe checkout page?