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 token selection screen as a token.

    Declaration

    Swift

    public var showApplePayAsToken: Bool
  • Use this option to show Apple Pay as a payment button instead of a listed payment method.

    Declaration

    Swift

    public var showLargeButton: Bool
  • Although the library automatically hides Apple Pay if no cards are supported, this shows if Apple Pay is available for the specified card acquirers.

    Declaration

    Swift

    public class func hasApplePay(withSupportedNetworks supportedNetworks: [PKPaymentNetwork]) -> Bool

    Parameters

    supportedNetworks

    Supported card acquirers.

    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

  • Refer to the NSCopying protocol

    Declaration

    Swift

    public func copy(with zone: NSZone? = nil) -> Any