Skip to content

Commit 26f34a1

Browse files
committed
Revert "[10.x] Start of work towards multi-currency prices."
This reverts commit 3c7757c.
1 parent 0ca43bb commit 26f34a1

File tree

14 files changed

+14
-37
lines changed

14 files changed

+14
-37
lines changed

config/config.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,4 @@
199199
'meta' => [],
200200
],
201201
],
202-
203-
/**
204-
* Setting over ProductCurrencyStrict.
205-
*/
206-
'product' => [
207-
'name_format' => 'Default Wallet {name}',
208-
'slug_format' => 'default_{slug}',
209-
],
210202
];

src/Interfaces/ProductCurrencyStrictInterface.php

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/Interfaces/ProductInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
interface ProductInterface extends Wallet
88
{
9-
public function getAmountProduct(Customer $customer, ?string $currency = null): int|string;
9+
public function getAmountProduct(Customer $customer): int|string;
1010

1111
/**
1212
* @return array<mixed>|null

src/Services/EagerLoaderService.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Bavix\Wallet\Services;
66

7-
use Bavix\Wallet\Interfaces\Customer;
87
use Bavix\Wallet\Internal\Dto\BasketDtoInterface;
98
use Bavix\Wallet\Internal\Repository\WalletRepositoryInterface;
109
use Bavix\Wallet\Models\Wallet;
@@ -20,7 +19,7 @@ public function __construct(
2019
) {
2120
}
2221

23-
public function loadWalletsByBasket(Customer $customer, BasketDtoInterface $basketDto): void
22+
public function loadWalletsByBasket(BasketDtoInterface $basketDto): void
2423
{
2524
$products = [];
2625
/** @var array<array-key, array<array-key, int|string>> $productGroupIds */

src/Services/EagerLoaderServiceInterface.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Bavix\Wallet\Services;
66

7-
use Bavix\Wallet\Interfaces\Customer;
87
use Bavix\Wallet\Internal\Dto\BasketDtoInterface;
98

109
/**
@@ -14,5 +13,5 @@
1413
*/
1514
interface EagerLoaderServiceInterface
1615
{
17-
public function loadWalletsByBasket(Customer $customer, BasketDtoInterface $basketDto): void;
16+
public function loadWalletsByBasket(BasketDtoInterface $basketDto): void;
1817
}

src/Traits/CartPay.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function payFreeCart(CartInterface $cart): array
5454
$basketDto = $cart->getBasketDto();
5555
$basketService = app(BasketServiceInterface::class);
5656
$availabilityAssembler = app(AvailabilityDtoAssemblerInterface::class);
57-
app(EagerLoaderServiceInterface::class)->loadWalletsByBasket($this, $basketDto);
57+
app(EagerLoaderServiceInterface::class)->loadWalletsByBasket($basketDto);
5858
if (! $basketService->availability($availabilityAssembler->create($this, $basketDto, false))) {
5959
throw new ProductEnded(
6060
app(TranslatorServiceInterface::class)->get('wallet::errors.product_stock'),
@@ -112,7 +112,7 @@ public function payCart(CartInterface $cart, bool $force = false): array
112112
$basketDto = $cart->getBasketDto();
113113
$basketService = app(BasketServiceInterface::class);
114114
$availabilityAssembler = app(AvailabilityDtoAssemblerInterface::class);
115-
app(EagerLoaderServiceInterface::class)->loadWalletsByBasket($this, $basketDto);
115+
app(EagerLoaderServiceInterface::class)->loadWalletsByBasket($basketDto);
116116
if (! $basketService->availability($availabilityAssembler->create($this, $basketDto, $force))) {
117117
throw new ProductEnded(
118118
app(TranslatorServiceInterface::class)->get('wallet::errors.product_stock'),
@@ -190,7 +190,7 @@ public function refundCart(CartInterface $cart, bool $force = false, bool $gifts
190190
{
191191
return app(AtomicServiceInterface::class)->block($this, function () use ($cart, $force, $gifts) {
192192
$basketDto = $cart->getBasketDto();
193-
app(EagerLoaderServiceInterface::class)->loadWalletsByBasket($this, $basketDto);
193+
app(EagerLoaderServiceInterface::class)->loadWalletsByBasket($basketDto);
194194
$transfers = app(PurchaseServiceInterface::class)->already($this, $basketDto, $gifts);
195195
if (count($transfers) !== $basketDto->total()) {
196196
throw new ModelNotFoundException(

tests/Infra/Models/Item.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function canBuy(Customer $customer, int $quantity = 1, bool $force = fals
4242
return $result && ! $customer->paid($this);
4343
}
4444

45-
public function getAmountProduct(Customer $customer, ?string $currency = null): int
45+
public function getAmountProduct(Customer $customer): int
4646
{
4747
/** @var Wallet $wallet */
4848
$wallet = app(CastService::class)->getWallet($customer);

tests/Infra/Models/ItemDiscount.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function canBuy(Customer $customer, int $quantity = 1, bool $force = fals
4444
return $result && ! $customer->paid($this);
4545
}
4646

47-
public function getAmountProduct(Customer $customer, ?string $currency = null): int
47+
public function getAmountProduct(Customer $customer): int
4848
{
4949
/** @var Wallet $wallet */
5050
$wallet = app(CastService::class)->getWallet($customer);

tests/Infra/Models/ItemDiscountTax.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function canBuy(Customer $customer, int $quantity = 1, bool $force = fals
4545
return $result && ! $customer->paid($this);
4646
}
4747

48-
public function getAmountProduct(Customer $customer, ?string $currency = null): int
48+
public function getAmountProduct(Customer $customer): int
4949
{
5050
/** @var Wallet $wallet */
5151
$wallet = app(CastService::class)->getWallet($customer);

tests/Infra/Models/ItemMaxTax.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function canBuy(Customer $customer, int $quantity = 1, bool $force = fals
4444
return $result && ! $customer->paid($this);
4545
}
4646

47-
public function getAmountProduct(Customer $customer, ?string $currency = null): int
47+
public function getAmountProduct(Customer $customer): int
4848
{
4949
/** @var Wallet $wallet */
5050
$wallet = app(CastService::class)->getWallet($customer);

0 commit comments

Comments
 (0)