OPPToken

@objc
public final class OPPToken : NSObject

Class to encapsulate shopper’s payment details that have been tokenized.

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

    Declaration

    Swift

    @objc
    public private(set) var tokenID: String { get }
  • The payment brand of the transaction.

    Declaration

    Swift

    @objc
    public private(set) var paymentBrand: String { get }
  • Shopper’s card details.

    Declaration

    Swift

    @objc
    public private(set) var card: OPPCard? { get }
  • Shopper’s bank account details.

    Declaration

    Swift

    @objc
    public private(set) var bankAccount: OPPBankAccount? { get }
  • Shopper’s virtual account details.

    Declaration

    Swift

    @objc
    public private(set) var virtualAccount: OPPVirtualAccount? { get }
  • Creates an OPPToken object with provided card parameters.

    Declaration

    Swift

    @objc
    public init?(tokenID: String,
                 paymentBrand: String,
                 card: OPPCard?)

    Parameters

    tokenID

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

    paymentBrand

    The payment brand.

    card

    Shopper’s card details.

    Return Value

    Returns an OPPToken object, or nil if parameters are empty.

  • Creates an OPPToken object with provided card parameters.

    Declaration

    Swift

    @objc
    public init?(tokenID: String,
                 paymentBrand: String,
                 bankAccount: OPPBankAccount?)

    Parameters

    tokenID

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

    paymentBrand

    The payment brand.

    bankAccount

    Shopper’s bank account details.

    Return Value

    Returns an OPPToken object, or nil if parameters are empty.

  • Creates an OPPToken object with provided card parameters.

    Declaration

    Swift

    @objc
    public init?(tokenID: String,
                 paymentBrand: String,
                 virtualAccount: OPPVirtualAccount?)

    Parameters

    tokenID

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

    paymentBrand

    The payment brand.

    virtualAccount

    Shopper’s virtual account details.

    Return Value

    Returns an OPPToken object, or nil if parameters are empty.

  • Creates an OPPToken object from JSON.

    Declaration

    Swift

    @objc
    public convenience init?(fromJSON JSON: [AnyHashable : Any])

    Return Value

    Returns an OPPToken object, or nil if JSON contains invalid values.

  • Creates an OPPToken object from JSON.

    Declaration

    Swift

    @objc
    public static func token(fromJSON JSON: [AnyHashable : Any]) -> `Self`?

    Parameters

    JSON

    A dictionary with parameters received from the Server.

    Return Value

    Returns an OPPToken object, or nil if JSON contains invalid values.

  • Creates an OPPToken object with provided card parameters.

    Declaration

    Swift

    @objc
    public static func token(tokenID: String,
                             paymentBrand: String,
                             card: OPPCard) -> Self?

    Parameters

    tokenID

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

    paymentBrand

    The payment brand.

    card

    Shopper’s card details.

    Return Value

    Returns an OPPToken object, or nil if parameters are empty.

  • Creates an OPPToken object with provided card parameters.

    Declaration

    Swift

    @objc
    public static func token(tokenID: String,
                             paymentBrand: String,
                             bankAccount: OPPBankAccount) -> Self?

    Parameters

    tokenID

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

    paymentBrand

    The payment brand.

    bankAccount

    Shopper’s bank account details.

    Return Value

    Returns an OPPToken object, or nil if parameters are empty.

  • Creates an OPPToken object with provided card parameters.

    Declaration

    Swift

    @objc
    public static func token(tokenID: String,
                             paymentBrand: String,
                             virtualAccount: OPPVirtualAccount) -> Self?

    Parameters

    tokenID

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

    paymentBrand

    The payment brand.

    virtualAccount

    Shopper’s virtual account details.

    Return Value

    Returns an OPPToken object, or nil if parameters are empty.