#pavlos-applepay
1 messages ยท Page 1 of 1 (latest)
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.
- pavlos_91429, 5 minutes ago, 12 messages
- pavlos_91429, 1 day ago, 16 messages
Just for context, before, to setup a Google Pay payment method, we were using this: https://stripe.dev/stripe-android/payments-core/com.stripe.android.googlepaylauncher/-google-pay-payment-method-launcher/index.html
The suggestion was to use this instead: https://stripe.dev/stripe-android/payments-core/com.stripe.android.googlepaylauncher/-google-pay-launcher/index.html
By calling presentWithSetupIntent, and passing a client secret to it so that the created payment method is attached to a customer.
However, the presentWithSetupIntent of the above has a Result that is completely empty. How should I retrieve the just-created payment method ID?
Hi there ๐ taking a look
Thanks ๐
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.
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?
Are you ever planning to work with Subscriptions? I'd strongly advise against proactively attaching Payment Methods to Customers if so.
yes, we are already working with subscriptions!
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.
I see. Could we suggest that the Google Pay launcher returns the payment method ID as a possible improvement?
I can certainly file that feedback with our teams.
Thank you ๐
Is this possible also in iOS?
When displaying the Apple Pay launcher, I don't see an option to pass a client secret ๐ค
Can you share what you're using to launch that? It may not be intended to be used with Setup Intents.
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)
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.
It looks like that is the case, that STPApplePayContext can only be initialized with a payment request:
https://stripe.dev/stripe-ios/stripe/documentation/stripe/stpapplepaycontext/init(paymentrequest:delegate:)
How are supposed to do setup intents with Apple Pay?
๐ hopping in here since toby had to head out
pavlos-applepay