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
OPPTokenobject with provided card parameters.Declaration
Swift
@objc public init?(tokenID: String, paymentBrand: String, card: OPPCard?)Parameters
tokenIDThe identifier of the token that can be used to reference the token later.
paymentBrandThe payment brand.
cardShopper’s card details.
Return Value
Returns an
OPPTokenobject, ornilif parameters are empty. -
Creates an
OPPTokenobject with provided card parameters.Declaration
Swift
@objc public init?(tokenID: String, paymentBrand: String, bankAccount: OPPBankAccount?)Parameters
tokenIDThe identifier of the token that can be used to reference the token later.
paymentBrandThe payment brand.
bankAccountShopper’s bank account details.
Return Value
Returns an
OPPTokenobject, ornilif parameters are empty. -
Creates an
OPPTokenobject with provided card parameters.Declaration
Swift
@objc public init?(tokenID: String, paymentBrand: String, virtualAccount: OPPVirtualAccount?)Parameters
tokenIDThe identifier of the token that can be used to reference the token later.
paymentBrandThe payment brand.
virtualAccountShopper’s virtual account details.
Return Value
Returns an
OPPTokenobject, ornilif parameters are empty. -
Creates an
OPPTokenobject from JSON.Declaration
Swift
@objc public convenience init?(fromJSON JSON: [AnyHashable : Any])Return Value
Returns an
OPPTokenobject, ornilif JSON contains invalid values. -
Creates an
OPPTokenobject from JSON.Declaration
Swift
@objc public static func token(fromJSON JSON: [AnyHashable : Any]) -> `Self`?Parameters
JSONA dictionary with parameters received from the Server.
Return Value
Returns an
OPPTokenobject, ornilif JSON contains invalid values. -
Creates an
OPPTokenobject with provided card parameters.Declaration
Swift
@objc public static func token(tokenID: String, paymentBrand: String, card: OPPCard) -> Self?Parameters
tokenIDThe identifier of the token that can be used to reference the token later.
paymentBrandThe payment brand.
cardShopper’s card details.
Return Value
Returns an
OPPTokenobject, ornilif parameters are empty. -
Creates an
OPPTokenobject with provided card parameters.Declaration
Swift
@objc public static func token(tokenID: String, paymentBrand: String, bankAccount: OPPBankAccount) -> Self?Parameters
tokenIDThe identifier of the token that can be used to reference the token later.
paymentBrandThe payment brand.
bankAccountShopper’s bank account details.
Return Value
Returns an
OPPTokenobject, ornilif parameters are empty. -
Creates an
OPPTokenobject with provided card parameters.Declaration
Swift
@objc public static func token(tokenID: String, paymentBrand: String, virtualAccount: OPPVirtualAccount) -> Self?Parameters
tokenIDThe identifier of the token that can be used to reference the token later.
paymentBrandThe payment brand.
virtualAccountShopper’s virtual account details.
Return Value
Returns an
OPPTokenobject, ornilif parameters are empty.
OPPToken Class Reference