OPPTokenPaymentParams

@interface OPPTokenPaymentParams : OPPBaseCardPaymentParams

Class to encapsulate all necessary transaction parameters for performing a token transaction.

  • Creates an object representing a token transaction.

    Declaration

    Objective-C

    + (nullable instancetype)
        tokenPaymentParamsWithCheckoutID:(nonnull NSString *)checkoutID
                                 tokenID:(nonnull NSString *)tokenID
                            paymentBrand:(nullable NSString *)paymentBrand
                                   error:(NSError *_Nullable *_Nullable)error;

    Parameters

    checkoutID

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

    tokenID

    The identifier of the token that can be used to reference the token later.

    paymentBrand

    Payment brand of the tokenized transaction.

    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 a token transaction, and nil if parameters are invalid.

  • Creates an object representing a token transaction.

    Declaration

    Objective-C

    + (nullable instancetype)
        tokenPaymentParamsWithCheckoutID:(nonnull NSString *)checkoutID
                                 tokenID:(nonnull NSString *)tokenID
                        cardPaymentBrand:(nullable NSString *)cardPaymentBrand
                                     CVV:(nullable NSString *)CVV
                                   error:(NSError *_Nullable *_Nullable)error;

    Parameters

    checkoutID

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

    tokenID

    The identifier of the token that can be used to reference the token later.

    cardPaymentBrand

    The payment brand of the tokenized card.

    CVV

    The CVV code found on the card.

    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 a token transaction, and nil if parameters are invalid.

  • Creates an object representing a token transaction.

    Declaration

    Objective-C

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

    Swift

    init(checkoutID: String, tokenID: String, paymentBrand: String?) throws

    Parameters

    checkoutID

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

    tokenID

    The identifier of the token that can be used to reference the token later.

    paymentBrand

    Payment method brand.

    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 a token transaction, and nil if parameters are invalid.

  • Creates an object representing a token transaction.

    Declaration

    Objective-C

    - (nullable instancetype)
        initWithCheckoutID:(nonnull NSString *)checkoutID
                   tokenID:(nonnull NSString *)tokenID
          cardPaymentBrand:(nullable NSString *)cardPaymentBrand
                       CVV:(nullable NSString *)CVV
                     error:(NSError *_Nullable *_Nullable)error;

    Swift

    init(checkoutID: String, tokenID: String, cardPaymentBrand: String?, cvv CVV: String?) throws

    Parameters

    checkoutID

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

    tokenID

    The identifier of the token that can be used to reference the token later.

    cardPaymentBrand

    The payment brand of the tokenized card.

    CVV

    The CVV code found on the card.

    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 a token transaction, and nil if parameters are invalid.

  • The identifier of the token that can be used to reference the token later.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSString *_Nonnull tokenID;

    Swift

    var tokenID: String { get }
  • Checks if the token identifier is valid to perform a transaction.

    Declaration

    Objective-C

    + (BOOL)isTokenIDValid:(nonnull NSString *)tokenID;

    Swift

    class func isTokenIDValid(_ tokenID: String) -> Bool

    Parameters

    tokenID

    The identifier of the token that can be used to reference the token later.

    Return Value

    YES if token identifier is alpha-numeric string of length 32.