this is the solution for non-shameless ... I think only difference is regarding the payment details(non-shameless and shameless) ... only .
this is working for me I hope it will resolve ur issue ... and check that are u hitting the ccavenue server through ur mobile with in 120 sec or not after u getting the rsa key.u need to hit the ccavenue server(with in 120 sec) for billing page otherwise it will expire.
try this:
from server:
once u hit the ccavenue sever for RSA key with ur accesscode and orderID
u will get : rsa key for ur transaction.
u need to encrypt the key with base64 and AES-256 format.
before u encrypt u need to remove some unnecessary data in a key
1.double quotes in a key
- \n in the key
- \ in a key
// removing double quates
NSString * newReplacedString2 = [rsaKey stringByReplacingOccurrencesOfString:@"\"" withString:@""];
NSLog(@"%@",rsaKey);
//removing \n in the key
NSString * newReplacedString = [newReplacedString2 stringByReplacingOccurrencesOfString:@"\\n" withString:@""];
NSLog(@"%@",rsaKey);
//removing \ in the key
NSString * newReplacedString1 = [newReplacedString stringByReplacingOccurrencesOfString:@"\\" withString:@""];
NSLog(@"%@",newReplacedString1);
//and u need to divide the key for every 64 bits
NSString * abc = [NSString stringWithFormat:@"%@", newReplacedString1];
NSMutableString *sss=[NSMutableString new];
int j=(int)([abc length]/63);
for (int i=0; i<=j; i++) {
int k= i*63;
NSString * newString;
if (i != j) {
newString = [abc substringWithRange:NSMakeRange(k,63)];
NSLog(@"%lu",(unsigned long)newString.length);
newString=[NSString stringWithFormat:@"%@",newString];
}else{
newString = [abc substringWithRange:NSMakeRange(k,[abc length]-k)];
NSLog(@"%lu",(unsigned long)newString.length);
if (newString.length !=0)
newString=[NSString stringWithFormat:@"%@",newString];
}
if (newString.length !=0)
[sss appendString:[NSString stringWithFormat:@"%@\n",newString]];
}
NSLog(@"%@",sss);
//as per the documentation u can follow the process
rsaKey = [NSString stringWithFormat:@"-----BEGIN PUBLIC KEY-----\n%@-----END PUBLIC KEY-----\n",sss];
NSLog(@"%@",rsaKey);
//Encrypting Card Details
NSString *myRequestString = [NSString stringWithFormat:@"amount=%@¤cy=%@",amount,currency];
CCTool *ccTool = [[CCTool alloc] init];
NSLog(@"emcrpted data %@",[ccTool encryptRSA:myRequestString key:rsaKey]);