#10x-payment-guide
1 messages · Page 1 of 1 (latest)
You can do whichever makes sense for your use-case. Either method can definitely work
Not creating one until a purchase happens will keep your dashboard a bit cleaner but otherwise there should not be much of a difference
Yeah, it seems like if I create it when a purchase is made, that requires a lot more conditional logic and might make the payment endpoint messy
was just wondering if it was appropriate to create customers willy nilly like this
that may or may not end up as paying customers
also, is there an easy way to check if a paymentmethod is new or is already attached to the customer?
The object will have a field with the customer's ID if it is attached to that customer https://stripe.com/docs/api/payment_methods/object#payment_method_object-customer
just to be sure, there's some confusiopn for me regarding the paymentmethod object. In my flow, I think I intend to fetch this via the client. I.e. stripe elements, they input their card data... and it returns back a payment method object, right?
Um it depends on the flow that you are using but that does sound like an accurrate description of some of our flows
Are you following a specific doc from our site on this?
I've decided to make custom flow/integration, so not pre-built checkout or anything.
I use the .net sdk and elements
not any specific doc
but I've been trying to follow the docs as best i can
I'd recommend looking at these docs for payments
https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
Or this one for saving a PM without taking a payment
https://stripe.com/docs/payments/save-and-reuse
This flow has a slightly different approach. Achieves the same result but it fits some usecases better
https://stripe.com/docs/payments/accept-a-payment-deferred
For the first two links, you would instantiate elements, create an intent, and confirm it client side which would create a PM
For the third link you would initiate elements, collect payment details, create the intent, and then confirm it
thanks