#id10t
1 messages · Page 1 of 1 (latest)
I invite you to follow our official guide for accepting payments using Elements (including creating Customer)
https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
hi. read that earlier. let me clarify...
- customer is new (no records in our database or in stripe)
- customer wants to buy
- we display a form (fname, lname and email on our end + the payment element). at this point the customer has not provided details yet so the payment element's pi was generated without a customer
- customer fills in info and completes the payment
now my struggle is between #3 and #4, there's no customer account yet in stripe.. i know that i can update the intent's customer after the fact but that won't attach the payment method. suggestions?
You have two options, either you create an empty Customer object in Stripe and you attached to the PaymentIntent, then once the customer fill their details you update Stripe Customer Object with it:
https://stripe.com/docs/api/customers/update
Or you update the PaymentIntent's customer field once you create the Stripe Customer object:
https://stripe.com/docs/api/payment_intents/update#update_payment_intent-currency
oh! good idea re empty customer object! didn't even think of that.
the only downside being i might end up with lots of "empty" customers if customer aborts.
on the other hand, the option of updating the paymentintent's customer field after the fact doesn't seem to attach the paymentmethod.