Getting validation errors from the applePayContext on completion, when passed a SetupIntent clientSecret in the style of seti_ , the comments is misleading, also keen to be able to use SetupIntents for apple pay.
Use SetupIntent style clientSecret as the param in the below
func applePayContext(_ context: STPApplePayContext, didCreatePaymentMethod paymentMethod: STPPaymentMethod, paymentInformation: PKPayment, completion: @escaping STPIntentClientSecretCompletionBlock) {
let clientSecret = ... // Retrieve the PaymentIntent client secret from your backend (see Server-side step above)
// Call the completion block with the client secret or an error
completion(clientSecret, error);
}
19.3.0
@maxhungry
@justinsoong hello! Thanks for flagging this!
The intention is for STPApplePayContext to support both PaymentIntents and SetupIntents down the road but you are correct, it currently supports PaymentIntents only.
We'll get that doc comment fixed.
@aliriaz-stripe thanks, is the support for SetupIntents already available server side at stripe, and it's just the validation that's stopping us using seti? Happy to raise a PR validate both pi and seti
@justinsoong STPApplePayContext support for SetupIntents is on the radar of the Mobile team but there's no timeline for that yet!
For now the workarounds are to integrate against PKPaymentAuthorizationViewController directly, create a Token off the resulting PKPayment object, create a PaymentMethod off the Token, then use that PaymentMethod on a SetupIntent.
reopening. @yuki-stripe is going to take a look at this :)
Any news on this?
Hey @antoinelamy,
We've just started work on this - you can expect this feature in the next release of the SDK
This was added in version 21.4.0.
Most helpful comment
Hey @antoinelamy,
We've just started work on this - you can expect this feature in the next release of the SDK