#nick-paymentintent-customer
1 messages ยท Page 1 of 1 (latest)
You'd want to do that before, though IIRC you can set the customer after too
For customers with saved payment methods you wish to use, you must indicate the customer to go with that payment method
I am attempting to attach it before, however it doesn't seem to be accepting the customer id when sending the request over to Stripe
I believe I am sending the customer object within the payment intent object, and then the update payment intent never executes because of it.
req_ChINbism3hVT8F
This is the most recent payment intent, but the function of passing the customer id to the payment intent is being executed in my code. I can show an example of my code if need be as well
This is a confirm request though
Do you have an example of the custoemr causing a failure like you described?
Or i am misunderstanding here
For that payment, a customer was never included in the requests
Created: https://dashboard.stripe.com/test/logs/req_JRwZEiM8m5DPMW
Updates: https://dashboard.stripe.com/test/logs/req_UV1oYBl4tvTpe2 & https://dashboard.stripe.com/test/logs/req_eMPJDVKwiPTW0j
Okay give a moment
No I don't have an example of the customer causing the failure,
I am trying to figure out the easiest/ best way of attaching the customer id to the payment intent object without having break my entire code lol\
Hello! I can ask my questions again if you'd like!
It sounds like you need to figure out where in your code to set/send the customer, right?
So far, it looks like that hasn't been included in payment intent requests
Yes, I can show you what I am working with so this can be a little clearer on both ends
These are the 2 files I am working with, I am trying to update the payment intent with the customer id attached to it but the only things that are updated are the amount and description
๐ taking over but will take me some time to catch up
nick-paymentintent-customer
those files you shared are weird binary files
please just share the exact code for the call to the Update PaymentIntent as text here (nothing else)
you can wrap code between ```
sorry that's a big picture of code
Please, as the developer, read your code and share the exact part that updates the PaymentIntent. nothing else and not as a picture
perfect. So now your code is doing this customer: customerId, // Attach the customer to the payment intent
This is likely null. As the developer, you go and add logs to it before using it and confirm. Then it comes from your client so you go and confirm what the client sends.
And then you should be able to quickly fix it
Also: you should never have a Customer id come from the client, so this is likely designed incorrectly. Otherwise anyone could steal someone else's cus_123 to have them pay
I am getting this type of error now: v3:1 Uncaught (in promise) IntegrationError: elements.submit() must be called before stripe.confirmPayment(). Call elements.submit() as soon as your customer presses pay, prior to any asynchronous work. Integration guide: https://stripe.com/docs/payments/accept-a-payment-deferred
at Hi (v3:1:302195)
at e._handleMessage (v3:1:307420)
at e._handleMessage (v3:1:89629)
at v3:1:305326
So did you call elements.submit() first?
Do you know you are using a beta though? Like its integration path is different. So you need to carefully read the docs and follow the recommendations in the right order
okay so what doc are you following exactly?
I mean this is a server-side call, it's completely unrelated to the client-side error.
Like what are you really trying to do. Which exact end to end guide are you following to accept a payment?
because updating a PaymentIntent server-side, is unrelated to the logic of client-side confirming it. And you seem to have 2 completely separate errors/questions but I'm not really following you
I am trying to follow the link above when accepting a payment with Stripe Payment Element
Okay, so you have 2 separate errors though
1/ You can't seem to update the PaymentIntent's customer properly -> I explained how to fix this and you're looking into it
2/ You get that error about confirmPayment() -> This is likely because you have a mistake in the code that calls confirmPayment(). Can you share that part?
Looking at the picture of your code from earlier, a colleague of mine noticed you are passing clientSecret to the confirmPayment() call, which is not correct. That's why you get that error
yeah look at that code, and remove what I said
const { error, paymentIntent } = await stripe.confirmPayment({
clientSecret: clientSecret,```
this last line should **not** be here and is causing the error
I removed it, one moment
sure!
Thank you for your help so far, I really appreciate it! I am going to continue this tomorrow morning, and if I have any questions I'll be sure to ask again. Thank you