From b3548fcc50646f43321069bd706519d1cee92847 Mon Sep 17 00:00:00 2001 From: Ramon Gutierrez Date: Mon, 12 Aug 2024 06:52:13 +0800 Subject: [PATCH] Add null check for subscription fee on paymongo connector #799 --- src/Service/PayMongoConnector.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Service/PayMongoConnector.php b/src/Service/PayMongoConnector.php index 5b4c4b9f..92eda90d 100644 --- a/src/Service/PayMongoConnector.php +++ b/src/Service/PayMongoConnector.php @@ -99,7 +99,7 @@ class PayMongoConnector $body = [ 'data' => [ 'attributes' => [ - 'amount' => (int)$plan_data['amount'], + 'amount' => $plan_data['amount'], 'currency' => 'PHP', 'description' => $plan_data['description'], 'interval' => $plan_data['interval'], @@ -118,7 +118,7 @@ class PayMongoConnector $body = [ 'data' => [ 'attributes' => [ - 'amount' => (int)$plan_data['amount'], + 'amount' => $plan_data['amount'], ], ], ]; @@ -154,7 +154,7 @@ class PayMongoConnector // create new plan $result = $this->createPlan([ 'name' => "RESQ Subscription", - 'amount' => bcmul($bsize->getSubRecurringFee(), 100), + 'amount' => (int)bcmul($bsize->getSubRecurringFee() ?? 0, 100), 'description' => "Motolite Battery Subscription Plan", 'interval' => 'monthly', 'interval_count' => 1,