From 3e976b86d101734654586acaedeb8960baffe4f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Thu, 19 Sep 2024 11:10:08 +0200 Subject: [PATCH] MAG2-316 - Added errormessage when profile request had an error --- Helper/Ratepay.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Helper/Ratepay.php b/Helper/Ratepay.php index edaf2146..843a7009 100644 --- a/Helper/Ratepay.php +++ b/Helper/Ratepay.php @@ -215,6 +215,10 @@ public function refreshProfiles($sMethodCode) $aShopIds = $this->getRatepayShopConfigByPaymentMethod($sMethodCode); foreach ($aShopIds as $aConfig) { $aResult = $this->profile->sendRequest($aConfig['shop_id'], $aConfig['currency'], $sMode); + if (!isset($aResult['status']) || $aResult['status'] != 'OK') { + throw new \Exception("An error occured".(!empty($aResult['errormessage']) ? ": ".$aResult['errormessage'] : "")); + } + $this->profileResource->updateProfileConfig($aConfig['shop_id'], $aResult); } }