#streetfeels

1 messages · Page 1 of 1 (latest)

mystic swiftBOT
fossil quest
#

Good question. To make the card re-usable you will need to attach the PM to a customer before confirming your payment intent

#

I think you will want to create a customer, set it as the customer property on the payment intent, and confirm that intent with setup_future_usage set to offline or online?

mystic swiftBOT
tidal patio
#

We have two flows on our client side - 1) Apple / Google Pay and then the credit card option.

#

Is is possible to create a customer object on the payment intent without a name and email entered?

fossil quest
#

Yes, you can create a Customer object without any initial information and attach it to the payment intent

#

And you can update the Customer later once you have that info

tidal patio
#

Ok, that's essentially how we have it for the credit card flow. Which has name and email inputs, and as the user enters that info, we patch the payment intent and the server side updates the customer object

#

However, with Apple and Google Pay, we do not request this separately, it's all done in the flow provided by Apple / Google Pay, where have requestPayerEmail / requestPayerName enabled.

#

So we won't have a chance to update the customer object.

#

So essentially, the payment does go through, but Stripe just creates a guest account

#

On our server side, we grab the name and email attributes and actually create a customer object then. However, seems like Stripe will not let us attach the payment method that's already associated with the guest account. We get the following error:

grim field
#

Hello! I'm taking over and catching up...

tidal patio
#

h Error occurrence: #501 InvalidRequestError: Request req_iWy7BjCUetDg2x: This PaymentMethod was previously used without being attached to a Customer or was detached from a Customer, and may not be used again.

tidal patio
grim field
#

What you need to do is create a Customer ahead of time. You don't need to specify anything up front; you can omit things like name and email, and then update the Customer later when you have that info.

tidal patio
#

Oh I see, so that would prevent Stripe from creating a guest account?

grim field
#

Yep.

tidal patio
#

as long as the payment intent has ANY customer object attached to it.

grim field
#

Yep.

#

🙂

tidal patio
#

Ok, we'll give that a try!

#

appreciate the help, this is great support!