在我的项目中,我正在尝试实施 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 错误 = 错误域 = NSCocoaErrorDomain 代码 = 3840“JSON 文本没有以数组或对象开头,并且不允许设置片段的选项。” UserInfo={NSDebugDescription=JSON 文本不以数组或对象开头,并且允许未设置片段的选项。} response= (null)