mercredi 17 juillet 2019

In transaction express when i post user payment info via curl in php it show me 50012 response

SANDBOX API URL

      $url ='https://cert.web.transaction.transactionexpress.com/TransFirst.Transaction.Web/api/SendTran';

create a new cURL resource

    $ch = curl_init($url);
    $merc = array(
        'id' => env('ECHECK_GATEWAY_ID'),
        'regKey' => env('ECHECK_REG_KEY'),
        'inType' => 1,
    );
    $input = json_encode(array('merc' => $merc, 
        'tranCode' => 11, 
        'contact' => $data['name'], 
        'reqAmt' => $data['reqAmt'], 
        'achEcheck' => $data['check']));
    curl_setopt($ch, CURLOPT_POSTFIELDS, $input);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0); 
    curl_setopt($ch, CURLOPT_TIMEOUT, 600);

set the content type to application/json

    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));

return response instead of outputting

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    //execute the POST request
    $response = curl_exec($ch);
    $status_code = @curl_getinfo($ch, CURLINFO_HTTP_CODE); 
    $error = curl_error($ch);

close cURL resource

    curl_close($ch);
    if($status_code==200)
    {
        return $response;
    }
    else {
        return $response;
    }

enter image description here



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire