#LEOLIU

1 messages · Page 1 of 1 (latest)

mossy stag
#

Hi, how can we help?

wanton palm
#

Hi there

#

As for Apple Pay payment, the payment flow would be 1. we must retrieve a new PaymentMethodID from Stripe's SDK, 2. attach it to a particular customerID, 3. invoke Create PaymentIntent API to complete the Apple Pay payment

#

We're wondering if we can switch the order of the payment flow, that after completing #1, we proceed to #3 and then #2?

#

Would the PaymentMethodID still be available to be attached to a customer?

mossy stag
#

I think it's possible if in #3 you don't specify a Customer for the PaymentIntent

#

But you would want to test it in Test mode

wanton palm
#

noted on that

#

so my understanding is, once a PaymentMethodID is created, it won't be discarded and deprecated by Stripe, it can always be attached to a customer, regardless of whether it is originally used for ApplePay or card payments

#

Pls correct me if I misunderstand

mossy stag
#

Hey I think I was incorrect. Just tried it and it errored

The payment method you provided is currently attached to a PaymentIntent. Please save it to a customer using the setup_future_usage parameter when updating or confirming that PaymentIntent

#

TLDR; if you use a PaymentMethod in a PaymentIntent, you would need to "save it" differently by that setup_future_usage and specifying customer on the PaymentIntent

wanton palm
#

May I know what error prompts?

mossy stag
#

I shared the error message above!

wanton palm
#

Oh I see

#

seems if a PaymentMethod is not being assigned to a customer before and during the payment, then it will be automatically attached to a PaymentIntent?

mossy stag
wanton palm
#

Noted on that