| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* @copyright © Melograno Venture Studio. All rights reserved. |
| 5 |
* @licence See LICENCE.md for license details. |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace IvyForms\Common\Constants; |
| 9 |
|
| 10 |
/** |
| 11 |
* ISO 4217 codes supported for form payment display (keep in sync with frontend `supportedCurrencies.ts`). |
| 12 |
*/ |
| 13 |
final class SupportedCurrencyCodes |
| 14 |
{ |
| 15 |
public const DEFAULT_CODE = 'USD'; |
| 16 |
|
| 17 |
/** |
| 18 |
* @var string[] |
| 19 |
*/ |
| 20 |
public const CODES = [ |
| 21 |
'USD', |
| 22 |
'EUR', |
| 23 |
'GBP', |
| 24 |
'CAD', |
| 25 |
'AUD', |
| 26 |
'AED', |
| 27 |
'JPY', |
| 28 |
'CHF', |
| 29 |
'SEK', |
| 30 |
'NOK', |
| 31 |
'DKK', |
| 32 |
'PLN', |
| 33 |
'CZK', |
| 34 |
'HUF', |
| 35 |
'NZD', |
| 36 |
'SGD', |
| 37 |
'HKD', |
| 38 |
'INR', |
| 39 |
'BRL', |
| 40 |
'MXN', |
| 41 |
'ZAR', |
| 42 |
]; |
| 43 |
|
| 44 |
/** |
| 45 |
* @param string $code |
| 46 |
* |
| 47 |
* @return bool |
| 48 |
*/ |
| 49 |
public static function isAllowed(string $code): bool |
| 50 |
{ |
| 51 |
return in_array($code, self::CODES, true); |
| 52 |
} |
| 53 |
} |
| 54 |
|