OPPApplePayPaymentParams

@objc
public final class OPPApplePayPaymentParams : OPPPaymentParams

Class to encapsulate all necessary transaction parameters for performing an Apple Pay transaction.

  • UTF-8 encoded JSON dictionary of encrypted payment data. Ready for transmission to merchant’s e-commerce backend for decryption and submission to a payment processor’s gateway.

    Declaration

    Swift

    @objc
    public let tokenData: Data?
  • Creates an object representing an Apple Pay transaction with brand APPLEPAY.

    Throws

    The error that occurred while validating payment parameters. See code attribute (OPPErrorCode) and NSLocalizedDescription to identify the reason of failure.

    Declaration

    Swift

    @objc
    public static func applePayPaymentParams(checkoutID: String,
                                             tokenData: Data) throws -> OPPApplePayPaymentParams

    Parameters

    checkoutID

    The checkout ID of the transaction. Must be not nil or empty.

    tokenData

    UTF-8 encoded JSON dictionary of encrypted payment data.

    Return Value

    An object representing an Apple Pay transaction.

  • Creates an object representing an Apple Pay transaction.

    Throws

    the error that occurred while validating payment parameters. See code attribute (OPPErrorCode) and NSLocalizedDescription to identify the reason of failure.

    Declaration

    Swift

    @objc
    public static func applePayPaymentParams(checkoutID: String,
                                             paymentBrand: String,
                                             tokenData: Data) throws -> OPPApplePayPaymentParams

    Parameters

    checkoutID

    The checkout ID of the transaction. Must be not nil or empty.

    paymentBrand

    The payment brand of the transaction.

    tokenData

    UTF-8 encoded JSON dictionary of encrypted payment data.

    Return Value

    An object representing an Apple Pay transaction.

  • Creates an object representing an Apple Pay transaction with brand APPLEPAY.

    Throws

    The error that occurred while validating payment parameters. See code attribute (OPPErrorCode) and NSLocalizedDescription to identify the reason of failure.

    Declaration

    Swift

    @objc
    public static func applePayPaymentParams(checkoutID: String,
                                             tokenData: Data,
                                             billingContact: PKContact?,
                                             shippingContact: PKContact?) throws -> OPPApplePayPaymentParams

    Parameters

    checkoutID

    The checkout ID of the transaction. Must be not nil or empty.

    tokenData

    UTF-8 encoded JSON dictionary of encrypted payment data.

    billingContact

    Billing contact object of payment.

    shippingContact

    Shipping contact object of payment.

    Return Value

    An object representing an Apple Pay transaction.

  • Creates an object representing an Apple Pay transaction.

    Throws

    The error that occurred while validating payment parameters. See code attribute (OPPErrorCode) and NSLocalizedDescription to identify the reason of failure.

    Declaration

    Swift

    @objc
    public static func applePayPaymentParams(checkoutID: String,
                                             paymentBrand: String,
                                             tokenData: Data,
                                             billingContact: PKContact?,
                                             shippingContact: PKContact?) throws -> OPPApplePayPaymentParams

    Parameters

    checkoutID

    The checkout ID of the transaction. Must be not nil or empty.

    paymentBrand

    The payment brand of the transaction.

    tokenData

    UTF-8 encoded JSON dictionary of encrypted payment data.

    billingContact

    Billing contact object of payment.

    shippingContact

    Shipping contact object of payment.

    Return Value

    An object representing an Apple Pay transaction.

  • Creates an object representing an Apple Pay transaction.

    Throws

    The error that occurred while validating payment parameters. See code attribute (OPPErrorCode) and NSLocalizedDescription to identify the reason of failure.

    Declaration

    Swift

    @objc
    public static func applePayPaymentParams(checkoutID: String,
                                             paymentBrand: String,
                                             tokenData: Data,
                                             billingContact: PKContact?,
                                             shippingContact: PKContact?,
                                             cardType: PKPaymentMethodType,
                                             cardNetwork: PKPaymentNetwork?) throws -> OPPApplePayPaymentParams

    Parameters

    checkoutID

    The checkout ID of the transaction. Must be not nil or empty.

    paymentBrand

    The payment brand of the transaction.

    tokenData

    UTF-8 encoded JSON dictionary of encrypted payment data.

    billingContact

    Billing contact object of payment.

    shippingContact

    Shipping contact object of payment.

    cardType

    Type of card used for payment.

    cardNetwork

    Network of card used for payment.

    Return Value

    An object representing an Apple Pay transaction.

  • Creates an object representing an Apple Pay transaction with brand APPLEPAY.

    Throws

    The error that occurred while validating payment parameters. See code attribute (OPPErrorCode) and NSLocalizedDescription to identify the reason of failure.

    Declaration

    Swift

    @objc
    public convenience init(checkoutID: String,
                            tokenData: Data) throws

    Parameters

    checkoutID

    The checkout ID of the transaction. Must be not nil or empty.

    tokenData

    UTF-8 encoded JSON dictionary of encrypted payment data.

    Return Value

    An object representing an Apple Pay transaction.

  • Creates an object representing an Apple Pay transaction.

    Throws

    The error that occurred while validating payment parameters. See code attribute (OPPErrorCode) and NSLocalizedDescription to identify the reason of failure.

    Declaration

    Swift

    @objc
    public init(checkoutID: String,
                paymentBrand: String,
                tokenData: Data) throws

    Parameters

    checkoutID

    The checkout ID of the transaction. Must be not nil or empty.

    paymentBrand

    The payment brand of the transaction.

    tokenData

    UTF-8 encoded JSON dictionary of encrypted payment data.

    Return Value

    An object representing an Apple Pay transaction.

  • Creates an object representing an Apple Pay transaction with brand APPLEPAY.

    Throws

    The error that occurred while validating payment parameters. See code attribute (OPPErrorCode) and NSLocalizedDescription to identify the reason of failure.

    Declaration

    Swift

    @objc
    public convenience init(checkoutID: String,
                            tokenData: Data,
                            billingContact: PKContact?,
                            shippingContact: PKContact?) throws

    Parameters

    checkoutID

    The checkout ID of the transaction. Must be not nil or empty.

    tokenData

    UTF-8 encoded JSON dictionary of encrypted payment data.

    billingContact

    Billing contact object of payment.

    shippingContact

    Shipping contact object of payment.

    Return Value

    An object representing an Apple Pay transaction.

  • Creates an object representing an Apple Pay transaction.

    Throws

    The error that occurred while validating payment parameters. See code attribute (OPPErrorCode) and NSLocalizedDescription to identify the reason of failure.

    Declaration

    Swift

    @objc
    public init(checkoutID: String,
                paymentBrand: String,
                tokenData: Data,
                billingContact: PKContact?,
                shippingContact: PKContact?) throws

    Parameters

    checkoutID

    The checkout ID of the transaction. Must be not nil or empty.

    paymentBrand

    The payment brand of the transaction.

    tokenData

    UTF-8 encoded JSON dictionary of encrypted payment data.

    billingContact

    Billing contact object of payment.

    shippingContact

    Shipping contact object of payment.

    Return Value

    An object representing an Apple Pay transaction.

  • Creates an object representing an Apple Pay transaction.

    Throws

    The error that occurred while validating payment parameters. See code attribute (OPPErrorCode) and NSLocalizedDescription to identify the reason of failure.

    Declaration

    Swift

    @objc
    public init(checkoutID: String,
                paymentBrand: String,
                tokenData: Data,
                billingContact: PKContact?,
                shippingContact: PKContact?,
                cardType: PKPaymentMethodType,
                cardNetwork: PKPaymentNetwork?) throws

    Parameters

    checkoutID

    The checkout ID of the transaction. Must be not nil or empty.

    paymentBrand

    The payment brand of the transaction.

    tokenData

    UTF-8 encoded JSON dictionary of encrypted payment data.

    billingContact

    Billing contact object of payment.

    shippingContact

    Shipping contact object of payment.

    cardType

    Type of card used for payment.

    cardNetwork

    Network of card used for payment.

    Return Value

    An object representing an Apple Pay transaction.

  • Checks if the token data is valid to perform a transaction.

    Declaration

    Swift

    @objc
    public static func isTokenDataValid(_ tokenData: Data) -> Bool

    Parameters

    tokenData

    UTF-8 encoded JSON dictionary of encrypted payment data.

    Return Value

    true if the token data is not empty.