STPAPIClient
extension STPAPIClient
STPAPIClient extensions to create Stripe Tokens, Sources, or PaymentMethods from Apple Pay PKPayment objects.
-
Converts Stripe errors into the appropriate Apple Pay error, for use in
PKPaymentAuthorizationResult
. If the error can be fixed by the customer within the Apple Pay sheet, we return an NSError that can be displayed in the Apple Pay sheet. Otherwise, the original error is returned, resulting in the Apple Pay sheet being dismissed. You should display the error message to the customer afterwards. Currently, we convert billing address related errors into a PKPaymentError that helpfully points to the billing address field in the Apple Pay sheet. Note that Apple Pay should prevent most card errors (e.g. invalid CVC, expired cards) when you add a card to the wallet.Declaration
Swift
@objc(pkPaymentErrorForStripeError:) public class func pkPaymentError(forStripeError stripeError: Error?) -> Error?
Parameters
stripeError
An error from the Stripe SDK.