Implementation Guide
Before starting implementation you should have finished Installation of the MCD SDK. MTC SDK provides functionality to find all the cardholder tokens, and token control. MTC SDK methods support asynchronous invocation only.
Main Interface
MeaTokenControl
is the main interface of MTC SDK.
Card Data Parameters
- swift
- objective-c
let cardId = "<value>"
let cardSecret = "<value>"
let cardParams = MtcCardDataParameters.init(cardId: cardId, cardSecret: cardSecret)
NSString *cardId = @"<value>";
NSString *cardSecret = @"<value>";
MppCardDataParameters *cardParams = [MtcCardDataParameters cardDataParametersWithCardId:cardId cardSecret:cardSecret];
Get Tokens
- swift
- objective-c
let cardParams = "<value>"
let cardParams = MeaTokenControl.getTokens(mppCardParameters) { (data, error) in
...
}
MppCardDataParameters *cardParams = @"<value>";
[MeaTokenControl getTokens:cardParams completionHandler: ^(MtcSearchTokenResponseData *data, NSError *error) {
...
}];
Suspend Token
- swift
- objective-c
let cardParams = "<value>"
let cardParams = MeaTokenControl.suspendToken(tokenUniqueReference) { (data, error) in
...
}
MppCardDataParameters *cardParams = @"<value>";
[MeaTokenControl suspendToken:tokenUniqueReference completionHandler: ^(MtcTokenResponseData *data, NSError *error) {
...
}];
Unsuspend Token
- swift
- objective-c
let cardParams = "<value>"
let cardParams = MeaTokenControl.unsuspendToken(tokenUniqueReference) { (data, error) in
...
}
MppCardDataParameters *cardParams = @"<value>";
[MeaTokenControl unsuspendToken:tokenUniqueReference completionHandler: ^(MtcTokenResponseData *data, NSError *error) {
...
}];
Delete Token
- swift
- objective-c
let cardParams = "<value>"
let cardParams = MeaTokenControl.deleteToken(tokenUniqueReference) { (data, error) in
...
}
MppCardDataParameters *cardParams = @"<value>";
[MeaTokenControl deleteToken:tokenUniqueReference completionHandler: ^(MtcTokenResponseData *data, NSError *error) {
...
}];
Get Token Status History
- swift
- objective-c
let cardParams = "<value>"
let cardParams = MeaTokenControl.getTokenStatusHistory(tokenUniqueReference) { (data, error) in
...
}
MppCardDataParameters *cardParams = @"<value>";
[MeaTokenControl getTokenStatusHistory:tokenUniqueReference completionHandler: ^(MtcGetTokenStatusHistoryResponseData *data, NSError *error) {
...
}];
Debugging
Use setDebugLoggingEnabled
method to enable/disable logging to console. Use versionName
and versionCode
methods to check the version of the SDK, when necessary.
- swift
- objective-c
import MeaTokenControl
...
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
MeaTokenControl.setDebugLoggingEnabled(true)
print(String(format: "SDK version: %@, code: %@", MeaTokenControl.versionName(), MeaTokenControl.versionCode()))
...
return true
}
#import <MeaTokenControl/MeaTokenControl.h>
...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[MeaTokenControl setDebugLoggingEnabled:YES];
NSLog(@"SDK version: %@, code: %@", [MeaTokenControl versionName], [MeaTokenControl versionCode]);
...
return YES;
}