Examples
Adjusting a Transaction
The following example can be used to add a tip to a transaction. Please note that this will only work on an EMV transaction if the Terminal Config has been set to tipadjust. RefNum is the value received during the original authorization.
-(void)adjustTransaction :(NSString *)adjustAmntInput
{
double adjustAmntValue = [adjustAmntInput double];
NSMutableDictionary *transDict = [NSMutableDictionary new];
[transDict setObject:@"cc:adjust" forKey:@"command"];
[transDict setObject:@"Put transaction refNum here" forKey:@"refnum"];
[transDict setObject:adjustAmntInput forKey:@"tip"];
double totalTransAmount = [[transInfoDict objectForKey:@"amount" ] doubleValue];
totalTransAmount += adjustAmntValue;
NSString *totalTransAmntString = [NSString stringWithFormat:@"%@", totalTransAmount];
[transDict setObject: totalTransAmntString forKey:@"amount"];
[middleware startTransaction:transDict];
}
Voiding a Transaction
The following example demonstrates voiding a transaction and releasing the held funds back to the cardholder. The refNum is the value received during the original authorization.
-(void)voidTransaction
{
NSMutableDictionary *transDict = [NSMutableDictionary new];
[transDict setObject:@"cc:void" forKey:@"command"];
[transDict setObject:@"Put transaction refNum here" forKey:@"refnum"];
[middleware startTransaction:transDict];
}