Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Input Error code 18 #82

Open
venkateshc75 opened this issue Jun 5, 2019 · 0 comments
Open

Invalid Input Error code 18 #82

venkateshc75 opened this issue Jun 5, 2019 · 0 comments

Comments

@venkateshc75
Copy link

Hey

I was able to login successfully, however when i try to charge an account, i keep getting
Error Code
Transaction failed, invalid input.
Error Code 18

Code
-(void)mobileDeviceLoginSucceeded:(MobileDeviceLoginResponse *)response{
NSString *sessionToken=[response sessionToken];
KioskUtils *myUtils=[[KioskUtils alloc]init];
NSMutableDictionary *tableDict=[[[NSUserDefaults standardUserDefaults] objectForKey:@"ticketData"] mutableCopy];
NSString *totalStr=@"0.01";//[NSString stringWithFormat:@"%.2f",[[tableDict objectForKey:@"total"] doubleValue] ];
NSString *tipAmtStr=@"0.01";//[NSString stringWithFormat:@"%.2f",[[tableDict objectForKey:@"tip"] doubleValue] ];
NSString *taxAmtStr=@"0.00";//[NSString stringWithFormat:@"%.2f",[[tableDict objectForKey:@"tax"] doubleValue] ];
AnetEMVManager *manager= [AnetEMVManager initWithCurrecyCode:@"USD" terminalID:@"xxxxxx" skipSignature:TRUE showReceipt:FALSE];
[manager setLoggingEnabled:TRUE];
[manager setTerminalMode:AnetEMVModeInsertOrSwipe];
LineItemType *lineItem=[LineItemType lineItem];
[lineItem setItemName:@"Test"];
[lineItem setItemID:@"1"];
[lineItem setItemQuantity:@"1"];
AnetEMVTransactionRequest *request=[AnetEMVTransactionRequest transactionRequest];
NSMutableArray *lineItems=[NSMutableArray new];
[lineItems addObject:lineItem];
[request setLineItems:lineItems];
ANetApiRequest *apiRequest=[ANetApiRequest anetApiRequest];
MerchantAuthenticationType *auth=[MerchantAuthenticationType merchantAuthentication];
[auth setSessionToken:sessionToken];
[auth setMobileDeviceId:[myUtils getMacAddress]];

[apiRequest setMerchantAuthentication:auth];
[request setAnetApiRequest:apiRequest];
int r = arc4random_uniform(1000000000) + 1;
OrderType *orderType=[OrderType order];
[orderType setInvoiceNumber:[NSString stringWithFormat:@"%d",r]];
[orderType setOrderDescription:@"Gold Coast valet"];
[request setOrder:orderType];
[request setAmount:totalStr];
ExtendedAmountType *tip=[ExtendedAmountType extendedAmountType];
[tip setAmount:tipAmtStr];
[tip setName:@"tip"];
ExtendedAmountType *tax=[ExtendedAmountType extendedAmountType];
[tax setName:@"tax"];
[tax setAmount:taxAmtStr];
//[request setTip:tip];
//[request setTax:tax];
[request setEmvTransactionType:EMVTransactionType_Payment];
[manager setConnectionMode:AnetEMVConnectionModeBluetooth];

[manager startQuickChipWithTransactionRequest:request forPaperReceiptCase:false presentingViewController:self completionBlock:^(AnetEMVTransactionResponse * _Nullable response, AnetEMVError * _Nullable error) {
if([response isTransactionSuccessful]){
................
}
}else{
NSLog(@"failed ..");
}
} andCancelActionBlock:^{
NSLog(@"failed ..");
}];

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant