Handle expiry date from insurance completed callback #761

This commit is contained in:
Ramon Gutierrez 2023-10-13 17:38:03 +08:00
parent 708e9a67cc
commit ac2cf864f2

View file

@ -72,11 +72,8 @@ class InsuranceController extends Controller
protected function handleAuthenticated($payload) protected function handleAuthenticated($payload)
{ {
$obj = $this->getApplication($payload['id']); $obj = $this->getApplication($payload['id']);
$now = new DateTime();
$now = new DateTime; $expiry = DateTime::createFromFormat("Y-m-d", $payload['expiry_date']);
// TODO: replacing this with actual callback response once provided
$expiry = $now->modify('+1 year');
if (!empty($obj)) { if (!empty($obj)) {
// mark as completed // mark as completed