Reply
Highlighted
Member
Posts: 1
Registered: ‎03-07-2019

Help Fix Create Visa Checkout Transaction Response Error

I am getting response error when  I use "Create Visa Checkout"

 

Here is my request sample PHP code

 

 VisaCheckoutForAuthorizeNet();
unction VisaCheckoutForAuthorizeNet(){

$data->createTransactionRequest->merchantAuthentication->name = 'myIPname';
$data->createTransactionRequest->merchantAuthentication->transactionKey = 'myTransactionKey';
$data->createTransactionRequest->refId = uniqid();
$data->createTransactionRequest->transactionRequest->transactionType = 'authCaptureTransaction';
$data->createTransactionRequest->transactionRequest->amount = '85.00';
$data->createTransactionRequest->transactionRequest->payment->opaqueData->dataDescriptor = 'COMMON.VCO.ONLINE.PAYMENT';
$data->createTransactionRequest->transactionRequest->payment->opaqueData->dataValue = $_POST['EncPaymentData'];
$data->createTransactionRequest->transactionRequest->payment->opaqueData->dataKey = $_POST['EncKey'];
$data->createTransactionRequest->transactionRequest->callId = $_POST['Callid'];

$data = json_encode($data);

$url = 'https://apitest.authorize.net/xml/v1/request.api';
$header = (array("Accept: application/json","Content-Type: application/json"));
 $options = array('http' => array('header' => $header, 'method' => 'POST', 'content' => $data ));

 $context  = stream_context_create($options);
      $result = file_get_contents($url, false, $context);


      if ($http_response_header[0] != 'HTTP/1.1 200 OK'){
              
         // Email or Log technical notice
         
      }
      else{
         echo $result;
      }

}

Here is the Response Result:

 

{
    "transactionResponse": {
        "responseCode": "3",
        "authCode": "000000",
        "avsResultCode": "P",
        "cvvResultCode": "",
        "cavvResultCode": "",
        "transId": "0",
        "refTransID": "",
        "transHash": "",
        "testRequest": "1",
        "accountNumber": "",
        "accountType": "",
        "errors": [
            {
                "errorCode": "261",
                "errorText": "An error occurred during processing.  Please try again."
            }
        ]      
    },
    "refId": "123456",
    "messages": {
        "resultCode": "Error",
        "message": [
            {
                "code": "E00027",
                "text": "The transaction was unsuccessful."
            }
        ]
    }
}

When I try to send request, I always get a response error mesage "An error occurred during processing. Please try again". Please help me fix these problem quickly or as soon as possible.

 

Thank you.