Skip to content

Commit

Permalink
fix: corrige envio da telemetria e newsletter
Browse files Browse the repository at this point in the history
  • Loading branch information
valdeir2000 committed Sep 23, 2020
1 parent 2ae723c commit ef42e83
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions upload/admin/controller/extension/payment/pagseguro.php
Expand Up @@ -589,13 +589,19 @@ private function telemetry()
'data' => $data
];

ob_start();
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_USERAGENT, 'PagSeguro Checkout Transparente for OpenCart');
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($fields));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, false);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
'Content-Type: application/json'
]);
curl_exec($curl);
curl_close($curl);
ob_end_clean();
}
}

Expand Down Expand Up @@ -624,14 +630,19 @@ private function newsletter()
$url .= '/' . $fields['ref'];
}

ob_start();
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_USERAGENT, 'PagSeguro Checkout Transparente for OpenCart');
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($fields));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, false);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
'Content-Type: application/json'
]);
curl_exec($curl);
curl_close($curl);
ob_end_clean();
}

/**
Expand Down

0 comments on commit ef42e83

Please sign in to comment.