OPPVirtualAccount

@interface OPPVirtualAccount : NSObject

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

  • The name of virtual account holder.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSString *holder;

    Swift

    var holder: String? { get set }
  • The identifier of the virtual account.

    Declaration

    Objective-C

    @property (nonatomic, copy) NSString *_Nonnull accountId;

    Swift

    var accountId: String { get set }
  • Creates an OPPVirtualAccount object from the JSON.

    Declaration

    Objective-C

    + (nullable instancetype)virtualAccountFromJSON:(nonnull NSDictionary *)JSON;

    Swift

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

    Parameters

    JSON

    A dictionary with parameters received from the Server.

    Return Value

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

  • Creates an OPPVirtualAccount object with the provided values.

    Declaration

    Objective-C

    + (nullable instancetype)virtualAccountWithHolder:(nullable NSString *)holder
                                            accountId:(nonnull NSString *)accountId;

    Parameters

    holder

    The name of virtual account holder.

    accountId

    The identifier of the virtual account.

    Return Value

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

  • Creates an OPPVirtualAccount object with the provided values.

    Declaration

    Objective-C

    - (nullable instancetype)initWithHolder:(nullable NSString *)holder
                                  accountId:(nonnull NSString *)accountId;

    Swift

    init?(holder: String?, accountId: String)

    Parameters

    holder

    The name of virtual account holder.

    accountId

    The identifier of the virtual account.

    Return Value

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