Skip to content

Commit 3e976b8

Browse files
committed
MAG2-316 - Added errormessage when profile request had an error
1 parent b5f4c07 commit 3e976b8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Helper/Ratepay.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,10 @@ public function refreshProfiles($sMethodCode)
215215
$aShopIds = $this->getRatepayShopConfigByPaymentMethod($sMethodCode);
216216
foreach ($aShopIds as $aConfig) {
217217
$aResult = $this->profile->sendRequest($aConfig['shop_id'], $aConfig['currency'], $sMode);
218+
if (!isset($aResult['status']) || $aResult['status'] != 'OK') {
219+
throw new \Exception("An error occured".(!empty($aResult['errormessage']) ? ": ".$aResult['errormessage'] : ""));
220+
}
221+
218222
$this->profileResource->updateProfileConfig($aConfig['shop_id'], $aResult);
219223
}
220224
}

0 commit comments

Comments
 (0)