#pavlos-applepay

1 messages ยท Page 1 of 1 (latest)

full cradleBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

tiny hawk
#

However, the presentWithSetupIntent of the above has a Result that is completely empty. How should I retrieve the just-created payment method ID?

tulip aspen
#

Hi there ๐Ÿ‘‹ taking a look

tiny hawk
#

Thanks ๐Ÿ™

tulip aspen
#

Hm, based on what I'm seeing, it looks like we don't direclty give you the ID of the new Payment Method with this approach. I think you would need to retrieve the Setup Intent after it's succeeded and pull the ID of the Payment Method from it's payment_method field.

tiny hawk
#

I see. That is slightly inconvenient as it would require an extra call to Stripe

#

I guess the other option is to do this the way we did it before and make an extra call to Stripe to attach the payment method to the customer?

tulip aspen
#

Are you ever planning to work with Subscriptions? I'd strongly advise against proactively attaching Payment Methods to Customers if so.

tiny hawk
#

yes, we are already working with subscriptions!

tulip aspen
#

Gotcha, yeah, I would not recommend directly attaching Payment Methods to Customers then, there is some undesired behavior that you might encounter if you do and is best to just avoid that pattern. The intents you're using now will handle attaching the payment method to the customer.

tiny hawk
#

I see. Could we suggest that the Google Pay launcher returns the payment method ID as a possible improvement?

tulip aspen
#

I can certainly file that feedback with our teams.

tiny hawk
#

Thank you ๐Ÿ™

tiny hawk
#

Is this possible also in iOS?

#

When displaying the Apple Pay launcher, I don't see an option to pass a client secret ๐Ÿค”

tulip aspen
#

Can you share what you're using to launch that? It may not be intended to be used with Setup Intents.

full cradleBOT
tiny hawk
#

Sure

#
  let merchantIdentifier = "xyz"
  let paymentRequest = StripeAPI.paymentRequest(withMerchantIdentifier: merchantIdentifier, country: "GB", currency: currencyCode)

  paymentRequest.paymentSummaryItems = [PKPaymentSummaryItem(label: "Company", amount: amount)]
        
  let applePayContext = STPApplePayContext(paymentRequest: paymentRequest, delegate: self)
tulip aspen
#

Gotcha, yeah, I think that's only meant to be used Payment Requests (not Setup Intents) but let me see if I can confirm that.

tiny hawk
#

How are supposed to do setup intents with Apple Pay?

sly ledge
#

๐Ÿ‘‹ hopping in here since toby had to head out

full cradleBOT
#

pavlos-applepay