ApplePayComponent
public class ApplePayComponent : NSObject, PresentableComponent, PaymentComponent, Localizable, FinalizableComponent
A component that handles Apple Pay payments.
-
The Apple Pay payment method.
Declaration
Swift
public var paymentMethod: PaymentMethod { get }
-
The delegate of the component.
Declaration
Swift
public weak var delegate: PaymentComponentDelegate?
-
Initializes the component.
Warning
didFinalize() must be called before dismissing this component.
Throws
ApplePayComponent.Error.userCannotMakePayment
. if user can’t make payments on any of the payment request’s supported networks.Throws
ApplePayComponent.Error.deviceDoesNotSupportApplyPay
if the current device’s hardware doesn’t support ApplePay.Throws
ApplePayComponent.Error.emptySummaryItems
if the summaryItems array is empty.Throws
ApplePayComponent.Error.negativeGrandTotal
if the grand total is negative.Throws
ApplePayComponent.Error.invalidSummaryItem
if at least one of the summary items has an invalid amount.Throws
ApplePayComponent.Error.invalidCountryCode
if thepayment.countryCode
is not a valid ISO country code.Throws
ApplePayComponent.Error.invalidCurrencyCode
if theAmount.currencyCode
is not a valid ISO currency code.Declaration
Swift
public init(paymentMethod: ApplePayPaymentMethod, apiContext: APIContext, payment: Payment, configuration: Configuration) throws
Parameters
paymentMethod
The Apple Pay payment method. Must include country code.
apiContext
The API environment and credentials.
payment
The describes the current payment.
configuration
Apple Pay component configuration
-
Finalizes ApplePay payment after being processed by payment provider.
Declaration
Swift
public func didFinalize(with success: Bool)
Parameters
success
The status of the payment.
-
Describes the error that can occur during Apple Pay payment.
See moreDeclaration
Swift
public enum Error : Swift.Error, LocalizedError
-
Apple Pay component configuration.
See moreDeclaration
Swift
public struct Configuration