From ac2cf864f20a952751bc22f7d5253eab60bd5fcc Mon Sep 17 00:00:00 2001 From: Ramon Gutierrez Date: Fri, 13 Oct 2023 17:38:03 +0800 Subject: [PATCH] Handle expiry date from insurance completed callback #761 --- src/Controller/InsuranceController.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Controller/InsuranceController.php b/src/Controller/InsuranceController.php index 63dc8649..97744d27 100644 --- a/src/Controller/InsuranceController.php +++ b/src/Controller/InsuranceController.php @@ -72,11 +72,8 @@ class InsuranceController extends Controller protected function handleAuthenticated($payload) { $obj = $this->getApplication($payload['id']); - - $now = new DateTime; - - // TODO: replacing this with actual callback response once provided - $expiry = $now->modify('+1 year'); + $now = new DateTime(); + $expiry = DateTime::createFromFormat("Y-m-d", $payload['expiry_date']); if (!empty($obj)) { // mark as completed