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

No files matched your search

+24 -3
View File
@@ -4,13 +4,26 @@
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 @@ public function payCardOrder($resource): array
'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 @@ public function generateOrderNumber($resource): int
{
return ApiKeyHalkbank::generateOrderNumber($resource);
}
/**
* Status view
*/
public static function statusView(): string
{
return 'orders.cards.online-payment.status';
}
}