move into sonardesk
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Commerce\Contracts;
|
||||
|
||||
use Modules\Commerce\Models\Product;
|
||||
|
||||
interface InventoryProvider
|
||||
{
|
||||
public function adjust(Product $product, int $quantity, string $reason, ?int $userId = null): void;
|
||||
|
||||
public function available(Product $product): int;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Commerce\Contracts;
|
||||
|
||||
use Modules\Commerce\Models\Order;
|
||||
|
||||
interface PaymentProvider
|
||||
{
|
||||
public function charge(Order $order, array $data = []): array;
|
||||
|
||||
public function refund(Order $order, float $amount): array;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Commerce\Contracts;
|
||||
|
||||
interface ShippingProvider
|
||||
{
|
||||
public function quote(array $address, float $subtotal): float;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Commerce\Contracts;
|
||||
|
||||
interface TaxProvider
|
||||
{
|
||||
public function calculate(float $subtotal, array $address = []): float;
|
||||
}
|
||||
Reference in New Issue
Block a user