PayTm:错误域= NSCocoaErrorDomain代码= 3840" JSON文本未启动

时间:2018-01-19 08:54:49

标签: ios objective-c xcode payment-gateway paytm

在我的项目中,我正在尝试实施PayTm支付网关。我将所有必需的文件和库导入我的应用程序。但现在我正在尝试导航到payTm页面,它会出现以下错误和应用程序崩溃。

我正在使用以下代码:

- (IBAction)submitAction:(id)sender
{
    //[self CallWebservice];
    //[self methodForChrckSumHash];

    //Step 1: Create a default merchant config object
    PGMerchantConfiguration *mc = [PGMerchantConfiguration defaultConfiguration];

    //Step 2: Create the order with whatever params you want to add. But make sure that you include the merchant mandatory params
    NSMutableDictionary *orderDict = [NSMutableDictionary new];
    //Merchant configuration in the order object
    orderDict[@"MID"] = @"Natur******";
    orderDict[@"ORDER_ID"] = @"****11008";
    orderDict[@"CUST_ID"] = @"0012";
    orderDict[@"INDUSTRY_TYPE_ID"] = @"Retail";
    orderDict[@"CHANNEL_ID"] = @"WAP";
    orderDict[@"TXN_AMOUNT"] = @"0";
    orderDict[@"WEBSITE"] = @"WEB_STAGING";
    orderDict[@"CALLBACK_URL"] = @"http://www.**********.in/new/paytm/pgResponse.php";
    orderDict[@"CHECKSUMHASH"] = @"*****************zvBRbqTfastx07J5HucJ9jIodi42YWqSdQCk2g45ESsp9WvHnbkoVob718=";
    orderDict[@"MERCHANT_KEY"] = @"**********";


    PGOrder *order = [PGOrder orderWithParams:orderDict];


    [PGServerEnvironment selectServerDialog:self.view completionHandler:^(ServerType eServerTypeProduction)
     {
         PGTransactionViewController *txnController = [[PGTransactionViewController alloc] initTransactionForOrder:order];

         //txnController.merchant = [PGMerchantConfiguration defaultConfiguration];

         txnController.serverType = eServerTypeProduction;
         txnController.merchant = mc;
         txnController.delegate = self;
         txnController.loggingEnabled = YES;
         [self showController:txnController];

     }];
}

现在使用这些参数我得到以下响应

  

[5890:352298] ViewController :: didFailTransaction error =错误   Domain = NSCocoaErrorDomain Code = 3840" JSON文本没有以   数组或对象以及允许未设置片段的选项。"   UserInfo = {NSDebugDescription = JSON文本不是以数组或   允许片段未设置的对象和选项。} response =(null)

0 个答案:

没有答案