This commit is contained in:
2024-01-28 21:22:45 +05:00
parent 1dc69a615d
commit 819c842ae0
8 changed files with 165 additions and 20 deletions

View File

@@ -4,13 +4,26 @@ namespace App\Repos\Payment;
use App\Models\Payment\ApiKeyHalkbank;
use App\Models\Payment\OnlinePaymentHistory;
use App\Repos\Order\OrderRepo;
use Exception;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
class OnlinePaymentRepo
{
/**
* Pending orders are brand new orders that have not been processed yet.
*/
public const PENDING = 'pending';
/**
* Failed orders are existing orders that could be paid
*/
public const FAILED = 'failed';
/**
* Paid orders are existing order that could be paid successfully
*/
public const PAID = 'paid';
/**
* Pay card order
*
@@ -58,7 +71,7 @@ class OnlinePaymentRepo
'errorUrl' => route('online-payment-store'),
'api_client' => config('app.url'),
'username' => $resource->branch->billing_username,
'paymentStatus' => OrderRepo::PENDING,
'paymentStatus' => self::PENDING,
]);
return [
@@ -74,4 +87,12 @@ class OnlinePaymentRepo
{
return ApiKeyHalkbank::generateOrderNumber($resource);
}
/**
* Status view
*/
public static function statusView(): string
{
return 'orders.cards.online-payment.status';
}
}