【问题标题】:CCAvenue "Error Encountered.ERRORCCAvenue“遇到错误。错误
【发布时间】:2017-10-11 06:39:15
【问题描述】:

我已将 CCAvenue 集成到我的应用程序中,但问题是代码何时运行

https://secure.ccavenue.com/transaction/initTrans

下面是代码:

NSString *encryptedStr = [NSString stringWithFormat:@"Merchant_Id=%@&Order_Id=%@&redirect_url=%@&cancel_url=%@&enc_val=%@&access_code=AVSB00EA86CN75BSNC&billing_name=%@&billing_address =%@&billing_city=%@&billing_state=%@&billing_zip=%@&billing_country=%@&billing_email=%@&billing_tel=%@",MerchantID,_order_id,redirectUrl,cancelUrl,encVal,self.billing_name,self.billing_address,self.billing_city,self.billing_state,self.billing_zip,self.billing_country,self.billing_email,self.billing_tel];
NSData *myRequestData = [NSData dataWithBytes: [encryptedStr UTF8String] length: [encryptedStr length]];
NSMutableURLRequest *requestN = [[NSMutableURLRequest alloc] initWithURL: [NSURL URLWithString: urlAsString]];
[requestN setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"content-type"];
[requestN setValue:urlAsString forHTTPHeaderField:@"Referer"];
[requestN setHTTPMethod: @"POST"];
[requestN setHTTPBody: myRequestData];
[self.webView loadRequest:requestN];

每次返回

遇到错误。错误!!解密应用请求的问题

【问题讨论】:

  • 我已经集成了 ccavenue 非无耻方法......那里的文档不清楚......为此......我想你也面临同样的问题
  • 你检查过@Anjali Singh

标签: ios objective-c


【解决方案1】:

这是非无耻的解决方案......我认为唯一的区别在于付款细节(非无耻和无耻)......只有。 这对我有用,我希望它能解决您的问题...并检查您是否在获得 rsa 密钥后 120 秒内通过您的手机访问 ccavenue 服务器。您需要访问 ccavenue 服务器(在120 秒)用于计费页面,否则它将过期。

试试这个:

来自服务器:

一旦你用你的访问码和 orderID 访问 RSA 密钥的 ccavenue 服务器

您将获得:您的交易的 rsa 密钥。

您需要使用 base64AES-256 格式加密密钥。

在加密之前,您需要删除密钥中的一些不必要的数据

1.key中的双引号

  1. \n 在键中
  2. \在一个键中
   // 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=%@&currency=%@",amount,currency];
        CCTool *ccTool = [[CCTool alloc] init];


    NSLog(@"emcrpted data %@",[ccTool encryptRSA:myRequestString key:rsaKey]);

【讨论】:

    【解决方案2】:

    Swift 中非无缝集成的解决方案。

    就我而言,我收到了同样的信息。

    遇到错误。错误!!解密应用请求的问题

    如有任何问题,您需要致电/邮寄ccavenue支持团队

    他们将为您提供解决方案或新的集成工具包。

    CCAvenue Support Mail

    【讨论】:

      猜你喜欢
      • 2014-10-19
      • 1970-01-01
      • 1970-01-01
      • 2014-01-26
      • 2015-11-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-09
      相关资源
      最近更新 更多