Set insurance callback handler to process raw json body #761

This commit is contained in:
Ramon Gutierrez 2023-10-09 15:48:05 +08:00
parent e3a79361bd
commit cbe84d1cc8
2 changed files with 4 additions and 1 deletions

View file

@ -25,7 +25,7 @@ class InsuranceController extends Controller
public function listen(Request $req)
{
$payload = $req->request->all();
$payload = json_decode($req->getContent(), true);
// DEBUG
@file_put_contents(__DIR__ . '/../../var/log/insurance.log', print_r($payload, true) . "\r\n----------------------------------------\r\n\r\n", FILE_APPEND);
@ -41,6 +41,8 @@ class InsuranceController extends Controller
// if no transaction code given, silently fail
if (empty($attr['transaction_code'])) {
error_log("Invalid insurance callback received: " . print_r($payload, true));
return $this->json([
'success' => true,
]);

View file

@ -36,6 +36,7 @@ class PayMongoController extends Controller
// if no event type given, silently fail
if (empty($attr['type'])) {
error_log("Invalid paymongo callback received: " . print_r($payload, true));
return $this->json([
'success' => true,
]);