访问Payeezy网址时出现kCFErrorDomainCFNetwork错误

时间:2019-02-21 06:22:13

标签: ios objective-c firstdata payeezy

我正在使用Payeezy SDK集成来获取第一个数据payeezy github。 &使用他们的方法对卡进行标记:

[myClient submitPostFDTokenForCreditCard: credit_card[@"type"] cardHolderName: credit_card[@"cardholdername"] cardNumber:credit_card[@"cardnumber"] cardExpirymMonthAndYear:credit_card[@"expdate"] cardCVV:credit_card[@"cvv"] type:@"FDToken" auth:@"false" ta_token:taToken completion:^(NSDictionary *dict, NSError *error){

    if (error == nil) {
        NSDictionary *resDict = [dict valueForKey:@"token"];
        self->fdTokenValue = [NSString stringWithFormat:@"%@", [resDict valueForKey:@"value"]];
        [self authorizeToken];
    }
    else{
        NSLog(@"error : %@",error.debugDescription);
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"First Data Payment Authorization"
        message: error.localizedDescription delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil];
        [alert show];
    }
}];

其中KURL为@“ https://api-cert.payeezy.com/v1/transactions/tokens

我遇到此错误:

 error value : The operation couldn’t be completed. (NSURLErrorDomain error -1012.)
2019-02-20 14:28:53.387187+0530 AppName[28055:1980864] error value extra : Error Domain=NSURLErrorDomain Code=-1012 "(null)" UserInfo={NSErrorFailingURLStringKey=https://api.payeezy.com/v1/transactions/tokens, NSUnderlyingError=0x282075ec0 {Error Domain=kCFErrorDomainCFNetwork Code=-1012 "(null)" UserInfo={_kCFURLErrorAuthFailedResponseKey=<CFURLResponse 0x2800e3680 [0x1c3409610]>{url = https://api.payeezy.com/v1/transactions/tokens}}}, NSErrorFailingURLKey=https://api.payeezy.com/v1/transactions/tokens}

它不像任何库调用之类的东西。它只是这个网址引发错误。我也检查了实时网址,但结果相同。可能是什么原因?

1 个答案:

答案 0 :(得分:0)

确保将所有必需的auth标头字段传递给有效值。错误代码似乎从API端取消了身份验证。