Search code examples
iosobjective-cfirstdatapayeezy

kCFErrorDomainCFNetwork error in accessing Payeezy Url


I am using Payeezy SDK Integration for first data payeezy github. & Using their method for tokenizing the card :

[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];
    }
}];

where KURL is @"https://api-cert.payeezy.com/v1/transactions/tokens"

I am getting this error :

 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}

It not like any library call or something. Its just this Url is throwing error. I checked with live url as well but same result. What could be the reason for this?


Solution

  • Make sure to pass all the required auth header fields with valid values. The error code seems like authentication cancelled from API side.