Error in CCAvenue Occure When Use CCAvenue Refund API

157 views Asked by At

Error Occure In CCAvenue API : status=1&enc_response=You are not allowed to perform this operation

how to fixed, What is This Error Any Code Error OR Account related Error ?

$version = '1.2'; 
$working_key = config('cca.CCA_WORKING_KEY'); 
$access_code = config('cca.CCA_ACCESS_CODE');
$post_data = ['reference_no' => '113030111039', 'refund_amount' => '1.0','refund_ref_no' => 'API0210'];

$merchant_data = json_encode($post_data);        
   
// Encrypt merchant data with working key shared by ccavenue
$encrypted_data = $this->encrypt($merchant_data, $working_key);
           
$command = "refundOrder";
$final_data = "request_type=JSON&access_code=" . $access_code . "&command=" . $command . "&response_type=JSON&enc_request=" . $encrypted_data;        
             
$URL = 'https://api.ccavenue.com/apis/servlet/DoWebTrans';           

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $final_data);

// Set the Content-Type header
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));

$result = curl_exec($ch);
curl_close($ch);`

How to Fixed What Is Error ?

0

There are 0 answers