OPPToken
@interface 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
Objective-C
@property (nonatomic, copy, readonly) NSString *_Nonnull tokenID;
Swift
var tokenID: String { get }
-
The payment brand of the transaction.
Declaration
Objective-C
@property (nonatomic, copy, readonly) NSString *_Nonnull paymentBrand;
Swift
var paymentBrand: String { get }
-
Shopper’s bank account details.
Declaration
Objective-C
@property (nonatomic, readonly, nullable) OPPBankAccount *bankAccount;
Swift
var bankAccount: OPPBankAccount? { get }
-
Shopper’s virtual account details.
Declaration
Objective-C
@property (nonatomic, readonly, nullable) OPPVirtualAccount *virtualAccount;
Swift
var virtualAccount: OPPVirtualAccount? { get }
-
Creates an
OPPToken
object from JSON.Declaration
Objective-C
+ (nullable instancetype)tokenFromJSON:(nonnull NSDictionary *)JSON;
Swift
convenience init?(fromJSON JSON: [AnyHashable : Any])
Parameters
JSON
A dictionary with parameters received from the Server.
Return Value
Returns an
OPPToken
object, ornil
if JSON contains invalid values. -
Creates an
OPPToken
object with provided card parameters.Declaration
Objective-C
+ (nullable instancetype)tokenWithTokenID:(nonnull NSString *)tokenID paymentBrand:(nonnull NSString *)paymentBrand card:(nonnull OPPCard *)card;
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, ornil
if parameters are empty. -
Creates an
OPPToken
object with provided bank account parameters.Declaration
Objective-C
+ (nullable instancetype)tokenWithTokenID:(nonnull NSString *)tokenID paymentBrand:(nonnull NSString *)paymentBrand bankAccount:(nonnull OPPBankAccount *)bankAccount;
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, ornil
if parameters are empty. -
Creates an
OPPToken
object with provided virtual account parameters.Declaration
Objective-C
+ (nullable instancetype)tokenWithTokenID:(nonnull NSString *)tokenID paymentBrand:(nonnull NSString *)paymentBrand virtualAccount: (nonnull OPPVirtualAccount *)virtualAccount;
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, ornil
if parameters are empty. -
Creates an
OPPToken
object with provided card parameters.Declaration
Objective-C
- (nullable instancetype)initWithTokenID:(nonnull NSString *)tokenID paymentBrand:(nonnull NSString *)paymentBrand card:(nonnull OPPCard *)card;
Swift
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, ornil
if parameters are empty. -
Creates an
OPPToken
object with provided bank account parameters.Declaration
Objective-C
- (nullable instancetype)initWithTokenID:(nonnull NSString *)tokenID paymentBrand:(nonnull NSString *)paymentBrand bankAccount:(nonnull OPPBankAccount *)bankAccount;
Swift
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, ornil
if parameters are empty. -
Creates an
OPPToken
object with provided virtual account parameters.Declaration
Objective-C
- (nullable instancetype)initWithTokenID:(nonnull NSString *)tokenID paymentBrand:(nonnull NSString *)paymentBrand virtualAccount: (nonnull OPPVirtualAccount *)virtualAccount;
Swift
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, ornil
if parameters are empty.