2023-12-12 16:51:15 +03:00
|
|
|
<?php
|
|
|
|
|
2024-04-29 11:44:31 +03:00
|
|
|
/**
|
|
|
|
* @category Integration
|
|
|
|
* @package Intaro\RetailCrm\Service
|
|
|
|
* @author RetailCRM <integration@retailcrm.ru>
|
|
|
|
* @license MIT
|
|
|
|
* @link http://retailcrm.ru
|
|
|
|
* @see http://retailcrm.ru/docs
|
|
|
|
*/
|
2023-12-12 16:51:15 +03:00
|
|
|
|
2024-04-29 11:44:31 +03:00
|
|
|
namespace Intaro\RetailCrm\Service;
|
2023-12-12 16:51:15 +03:00
|
|
|
|
2024-04-29 11:44:31 +03:00
|
|
|
/**
|
|
|
|
* Class CurrencyService
|
|
|
|
*
|
|
|
|
* @package Intaro\RetailCrm\Service
|
|
|
|
*/
|
2023-12-12 16:51:15 +03:00
|
|
|
class CurrencyService
|
|
|
|
{
|
|
|
|
public static function validateCurrency($cmsCurrency, $crmCurrency): string
|
|
|
|
{
|
|
|
|
$errorCode = '';
|
|
|
|
|
|
|
|
if ($cmsCurrency === null) {
|
|
|
|
$errorCode = 'ERR_CMS_CURRENCY';
|
|
|
|
} elseif ($crmCurrency === null) {
|
|
|
|
$errorCode = 'ERR_CRM_CURRENCY';
|
|
|
|
} elseif ($cmsCurrency !== $crmCurrency) {
|
|
|
|
$errorCode = 'ERR_CURRENCY_SITES';
|
|
|
|
}
|
|
|
|
|
|
|
|
return $errorCode;
|
|
|
|
}
|
|
|
|
}
|