Fix Payment Portal bug in php based software
Budget: $30 – $250 USD
Is a php based software with an already configured payment portal,
I am having a problem during success payment redirection.
It should change a flag from non-payed to payed. and use POST method to repeat two column data to webhook.
The problem is that the session is being crashed and even the payment is successful it is not updating flag
Code section to modify:
public function redpay_success()
{
$params = $this->session->userdata('params');
$amount = $_SESSION['red_amount'];
$red_pay_api = $_SESSION['redpay_api'];
$referenceNumber = $_SESSION['referenceNumber'];
//$amount = 123;
//$red_pay_api = 'ZTA1NTQ5NDUtODViZi00NjRmLTg2MTItNTU5MzM4NjUzNjlmOjR5eWszbSs1cFE=';
//$referenceNumber = time();
// echo $referenceNumber;
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://modular-api.contabilizate.com/api/Webhook/autofacturacion/lecto",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => array('referenceNumber' => $referenceNumber,'amount' => $amount),
// CURLOPT_POSTFIELDS => "{\r\n \"amount\":$amount,\r\n \"referenceNumber\":\"$referenceNumber\"\r\n}\r\n",
CURLOPT_HTTPHEADER => array(
"authorization: Basic ".$config['redpay_api'],
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
I am having a problem during success payment redirection.
It should change a flag from non-payed to payed. and use POST method to repeat two column data to webhook.
The problem is that the session is being crashed and even the payment is successful it is not updating flag
Code section to modify:
public function redpay_success()
{
$params = $this->session->userdata('params');
$amount = $_SESSION['red_amount'];
$red_pay_api = $_SESSION['redpay_api'];
$referenceNumber = $_SESSION['referenceNumber'];
//$amount = 123;
//$red_pay_api = 'ZTA1NTQ5NDUtODViZi00NjRmLTg2MTItNTU5MzM4NjUzNjlmOjR5eWszbSs1cFE=';
//$referenceNumber = time();
// echo $referenceNumber;
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://modular-api.contabilizate.com/api/Webhook/autofacturacion/lecto",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => array('referenceNumber' => $referenceNumber,'amount' => $amount),
// CURLOPT_POSTFIELDS => "{\r\n \"amount\":$amount,\r\n \"referenceNumber\":\"$referenceNumber\"\r\n}\r\n",
CURLOPT_HTTPHEADER => array(
"authorization: Basic ".$config['redpay_api'],
),
));
$response = curl_exec($curl);
$err = curl_error($curl);