ApplePayConfig
@objc(DTApplePayConfig)
@objcMembers
public class ApplePayConfig : NSObject, NSCopying
Configuration object for Apple Pay transactions.
-
Delegate object for callbacks during Apple Pay authorization
Declaration
Swift
public weak var delegate: DTApplePayDelegate?
-
Use this label to configure the final summary of the purchase. The default label is “Total”, but you can also replace it with the name of your shop. The string will then read: PAY YOURSHOP: XX.XX
Declaration
Swift
public var finalSummaryItemLabel: String?
-
The request object for further configuration of Apple Pay. Please refer to the official Apple Pay documentation for more information.
Declaration
Swift
public private(set) var request: PKPaymentRequest { get }
-
Shows Apple Pay additionally on the saved payment method selection screen.
Declaration
Swift
public var showApplePayAsSavedPaymentMethod: Bool
-
Use this option to show Apple Pay as a payment button instead of a listed payment method.
Declaration
Swift
public var showLargeButton: Bool
-
Use this option to hide and disable Apple Pay when the user hasn’t yet set up a supported card with Apple Pay. By default Apple Pay is shown in any case.
Declaration
Swift
public var existingCardRequired: Bool
-
Use this method to determine the availability of Apple Pay for the specified parameters on a given device. Note that while the SDK automatically manages the visibility of Apple Pay and hides it when not available, if Apple Pay is the only payment option and it is not available, an error will be thrown.
This method is commonly employed in scenarios where Apple Pay is presented as a fast checkout option on a product page or when the merchant displays the list of available payment methods.
Declaration
Swift
public class func hasApplePay(withSupportedNetworks supportedNetworks: [PKPaymentNetwork], existingCardRequired: Bool) -> Bool
Parameters
supportedNetworks
Supported card acquirers.
existingCardRequired
Determines whether Apple Pay should be exclusively available when at least one supported card is already set up by the user.
Return Value
True if Apple Pay is available on the device, false if it is unavailable.
-
Creates a new Apple Pay configuration object with an Apple Pay country code. If no countryCode is specified, the SDK will set Switzerland as the country code.
Declaration
Swift
public init(applePayMerchantId: String, supportedNetworks: [PKPaymentNetwork], countryCode: String)
Parameters
applePayMerchantId
The merchant identifier (Merchant ID) at Apple, which you created together with the CSR file provided by Datatrans.
supportedNetworks
Supported card acquirers.
countryCode
Apple Pay country code