OPPApplePayPaymentParams

@interface OPPApplePayPaymentParams : OPPPaymentParams

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

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

    Declaration

    Objective-C

    + (nullable instancetype)
        applePayPaymentParamsWithCheckoutID:(nonnull NSString *)checkoutID
                                  tokenData:(nonnull NSData *)tokenData
                                      error:(NSError *_Nullable *_Nullable)error;

    Parameters

    checkoutID

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

    tokenData

    UTF-8 encoded JSON dictionary of encrypted payment data.

    error

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

    Return Value

    Returns an object representing an Apple Pay transaction, and nil if parameters are invalid.

  • Creates an object representing an Apple Pay transaction.

    Declaration

    Objective-C

    + (nullable instancetype)
        applePayPaymentParamsWithCheckoutID:(nonnull NSString *)checkoutID
                               paymentBrand:(nonnull NSString *)paymentBrand
                                  tokenData:(nonnull NSData *)tokenData
                                      error:(NSError *_Nullable *_Nullable)error;

    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.

    error

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

    Return Value

    Returns an object representing an Apple Pay transaction, and nil if parameters are invalid.

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

    Declaration

    Objective-C

    + (nullable instancetype)
        applePayPaymentParamsWithCheckoutID:(nonnull NSString *)checkoutID
                                  tokenData:(nonnull NSData *)tokenData
                             billingContact:(nullable PKContact *)billingContact
                            shippingContact:(nullable PKContact *)shippingContact
                                      error:(NSError *_Nullable *_Nullable)error;

    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.

    error

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

    Return Value

    Returns an object representing an Apple Pay transaction, and nil if parameters are invalid.

  • Creates an object representing an Apple Pay transaction.

    Declaration

    Objective-C

    + (nullable instancetype)
        applePayPaymentParamsWithCheckoutID:(nonnull NSString *)checkoutID
                               paymentBrand:(nonnull NSString *)paymentBrand
                                  tokenData:(nonnull NSData *)tokenData
                             billingContact:(nullable PKContact *)billingContact
                            shippingContact:(nullable PKContact *)shippingContact
                                      error:(NSError *_Nullable *_Nullable)error;

    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.

    error

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

    Return Value

    Returns an object representing an Apple Pay transaction, and nil if parameters are invalid.

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

    Declaration

    Objective-C

    - (nullable instancetype)initWithCheckoutID:(nonnull NSString *)checkoutID
                                      tokenData:(nonnull NSData *)tokenData
                                          error:
                                              (NSError *_Nullable *_Nullable)error;

    Swift

    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.

    error

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

    Return Value

    Returns an object representing an Apple Pay transaction, and nil if parameters are invalid.

  • Creates an object representing an Apple Pay transaction.

    Declaration

    Objective-C

    - (nullable instancetype)initWithCheckoutID:(nonnull NSString *)checkoutID
                                   paymentBrand:(nonnull NSString *)paymentBrand
                                      tokenData:(nonnull NSData *)tokenData
                                          error:
                                              (NSError *_Nullable *_Nullable)error;

    Swift

    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.

    error

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

    Return Value

    Returns an object representing an Apple Pay transaction, and nil if parameters are invalid.

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

    Declaration

    Objective-C

    - (nullable instancetype)
        initWithCheckoutID:(nonnull NSString *)checkoutID
                 tokenData:(nonnull NSData *)tokenData
            billingContact:(nullable PKContact *)billingContact
           shippingContact:(nullable PKContact *)shippingContact
                     error:(NSError *_Nullable *_Nullable)error;

    Swift

    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.

    error

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

    Return Value

    Returns an object representing an Apple Pay transaction, and nil if parameters are invalid.

  • Creates an object representing an Apple Pay transaction.

    Declaration

    Objective-C

    - (nullable instancetype)
        initWithCheckoutID:(nonnull NSString *)checkoutID
              paymentBrand:(nonnull NSString *)paymentBrand
                 tokenData:(nonnull NSData *)tokenData
            billingContact:(nullable PKContact *)billingContact
           shippingContact:(nullable PKContact *)shippingContact
                     error:(NSError *_Nullable *_Nullable)error;

    Swift

    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.

    error

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

    Return Value

    Returns an object representing an Apple Pay transaction, and nil if parameters are invalid.

  • 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

    Objective-C

    @property (nonatomic, copy, readonly) NSData *_Nonnull tokenData;

    Swift

    var tokenData: Data { get }
  • Checks if the token data is valid to perform a transaction.

    Declaration

    Objective-C

    + (BOOL)isTokenDataValid:(nonnull NSData *)tokenData;

    Swift

    class func isTokenDataValid(_ tokenData: Data) -> Bool

    Parameters

    tokenData

    UTF-8 encoded JSON dictionary of encrypted payment data.

    Return Value

    YES if the token data is not empty.