Tokenize Without Authorization (Non-UI)
We are supporting Tokenize Without Authorization (TWA) for store credit card without making payment.
Full Sample Code
- (void)payment {
//set mandatory fields
paymentSDK.merchantID = @"JT01";
paymentSDK.pan = @"5105105105105100";
paymentSDK.cardExpireMonth = 12;
paymentSDK.cardExpireYear = 2019;
paymentSDK.cardHolderName = @"Mr. John";
paymentSDK.secretKey = @"123456";
paymentSDK.tokenizeWithoutAuthorization = YES;
paymentSDK.paymentUI = NO;
//optional for TWA
paymentSDK.cardHolderEmail = @"user@domain.com";
paymentSDK.panCountry = @"SG";
paymentSDK.panBank = @"2c2p Bank";
paymentSDK.request3DS = @"Y";
[paymetnSDK requestWithTarget:self onResponse:^(NSDictionary *response)
{
NSLog(@"%@",response);
if([response[@"respCode"] isEqualToString:@"32"])
{
message = @"Success";
}
else {
message = response[@"failReason"];
}
NSLog(@"Payment status: %@",message);
} onFail:^(NSError *error) {
if(error) {
NSLog(@"%@",error);
}
else {
NSLog(@"Cancel The Payment From OTP");
}
}];
}
func payment() {
//set mandatory fields
paymentSDK.merchantID = "JT01"
paymentSDK.pan = "5105105105105100"
paymentSDK.cardExpireMonth = 12
paymentSDK.cardExpireYear = 2019
paymentSDK.cardHolderName = "Mr. John"
paymentSDK.secretKey = "123456"
paymentSDK.tokenizeWithoutAuthorization = true
paymentSDK.paymentUI = false
//optional for TWA
paymentSDK.cardHolderEmail = "user@domain.com"
paymentSDK.panCountry = "SG"
paymentSDK.panBank = "2c2p Bank"
paymentSDK.request3DS = "Y"
paymentSDK.request(withTarget: self, onResponse: { (response) in
print("response: \(String(describing: response))")
}) { (error) in
if error != nil {
print("error: \(String(describing: error?.localizedDescription))")
}else{
print("user cancel payment")
}
}
}
Check the full Payment Request example and response at Response Dictionary.