Skip to content

Commit 43728c2

Browse files
committed
[10.x] Feature. Currency Strict Mode
1 parent 81db097 commit 43728c2

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

config/config.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@
7878
'seconds' => env('WALLET_LOCK_TTL', 1),
7979
],
8080

81+
/**
82+
* Feature flags for experiments.
83+
*/
84+
'features' => [
85+
/**
86+
* Mode of strict work with currencies.
87+
*/
88+
'currency_strict' => false,
89+
],
90+
8191
/**
8292
* Internal services that can be overloaded.
8393
*/
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Bavix\Wallet\Internal\Service;
6+
7+
/**
8+
* @internal
9+
*/
10+
final class FeatureService implements FeatureServiceInterface
11+
{
12+
public function isCurrencyStrictMode(): bool
13+
{
14+
/**
15+
* @var $value bool|int
16+
*/
17+
$value = config('wallet.features.currency_strict', false);
18+
19+
return (bool) $value;
20+
}
21+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Bavix\Wallet\Internal\Service;
6+
7+
interface FeatureServiceInterface
8+
{
9+
/**
10+
* The mode prohibits work between wallets 1:1 for different currencies.
11+
*/
12+
public function isCurrencyStrictMode(): bool;
13+
}

0 commit comments

Comments
 (0)