#Cvijo

1 messages · Page 1 of 1 (latest)

analog cypressBOT
dry sleet
#

Hi Rubeus, i dont see any flag on Payment method object that could tell that this PM is flagged for future used, on dashboard you can see that it has paymentIntent that setup this pm for future use

cunning sphinx
#

Hello! There's no way to tell if a given Payment Method has been set up for future use beyond listing out all of the Setup Intents and Payment Intents associated with the Customer.

#

We recommend you either track this on your end (possibly with metadata on the Payment Method) or make sure no Payment Methods can be attached to Customers without being set up for future use.

dry sleet
#

oh, ok .. and can you tell me when i create checkout session and customer pay, Stripe creates guest customer and attach that PM to him .. and when later i create real customer i should use attach payment method i guess to transger that guest connected PM to my real customer?

#

and to get that PM id i must retrive paymentintent first and read PM from that chechkout session

cunning sphinx
#

Checkout won't set up a Payment Method for future use and use a guest customer. If you're setting them up for future use an actual Customer will be created.

#

And the Payment Method will be attached to that Customer.

dry sleet
#

hmm in test mode its not like that

#

stripe creates guest customer

cunning sphinx
dry sleet
#

yes

#

and then i use that intent to find PM and attach it to my customer and then i can use that card .. at least its how it works now

cunning sphinx
#

Can you give me the Checkout Session ID or the request ID where you created it? Or the Payment Intent ID?

dry sleet
#

sure give me a min

#

oh i am sorry .. i never tried without customer .. i see that if it doesnt exists i create new customer by myself ... but question is the same for paymentIntents too so from stripe.js elements i create paymentIntent for future use and than stripe create guest customer

#

so when i create real customer i have to attach that PM to him is that normal way of doing things?

cunning sphinx
#

I'm not sure what you're describing with Stripe.js, but no, that's not the normal way of doing things. What we recommend is that you either create a Customer or use an existing Customer up front.

dry sleet
#

well at some use cases when payment intent is created we dont know much about customer and we dont have record of him in our database so we cant map it to Stripe customer, but we sohuld probably to some link tables to get this result

cunning sphinx
#

So you only know which Customer it is after they pay?

dry sleet
#

well yes, when we get information from brokers we only get email and we dont save it in our database until he come to pickup car (rental agency) but he can pay on online checkin form

#

before he come to pickup a car

cunning sphinx
#

You can set setup_future_usage on the Payment Intent and then, after that Payment Intent is confirmed, attach the Payment Method to a Customer.

dry sleet
#

its like booking.com or something simular .. customer reserve appartment on booking.com and he will pay on arrival directly to owner of appartman, but until customer doesnt come booking.com will not share you any information upfront

#

yap thats what we are doing now .. and thank you Rubeus for your time and help

#

hi Rubeus again 🙂 .. i just tried checkout session without sending custemerId and it here is paymentIntent and no customer attached or created on Stripe side

#

pi_3M1dn3IuVfmuXS5M2wMpas5m

#

cs_test_a1XlVyQUSbHYlSc70knu7IFMf66qtRPnox3klm9W6K9br0wvlsEu4AQfGT

#

and here is PM pm_1M1dn2IuVfmuXS5MtRTCeatd (its setup for future use)

cunning sphinx
#

Interesting, I thought we created a Customer in that scenario. In any case, you should now be able to attach that Payment Method to a Customer.