work on payments
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Modules\OnlinePayment\Repositories;
|
||||
|
||||
use App\Modules\CardOrder\Models\CardOrder;
|
||||
use App\Modules\HalkbankOnlinePayment\Repositories\HalkbankOnlinePaymentRepository;
|
||||
use App\Modules\OnlinePayment\Models\OnlinePayment;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
@@ -24,7 +25,7 @@ class OnlinePaymentRepository
|
||||
*/
|
||||
public const PAID = 'paid';
|
||||
|
||||
/**
|
||||
/**
|
||||
* Status Values
|
||||
*
|
||||
* @return array<null|string, string>
|
||||
@@ -39,14 +40,6 @@ class OnlinePaymentRepository
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Set price
|
||||
*/
|
||||
public function getPrice(int|float|string $price): string
|
||||
{
|
||||
return number_format(floatval($price), 2, '', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Pay card order
|
||||
*
|
||||
@@ -57,6 +50,18 @@ class OnlinePaymentRepository
|
||||
{
|
||||
$orderNumber = $this->generateOrderNumber();
|
||||
|
||||
$response = HalkbankOnlinePaymentRepository::make()
|
||||
->setUsername()
|
||||
->setPassword()
|
||||
->setAmount()
|
||||
->setOrderNumber()
|
||||
->returnUrl()
|
||||
->description()
|
||||
->onError()
|
||||
->onResponseFail()
|
||||
->onResponseSuccess()
|
||||
->sendRequest();
|
||||
|
||||
// $paymentResponse = Http::get('https://mpi.gov.tm/payment/rest/register.do', [
|
||||
// 'orderNumber' => $orderNumber,
|
||||
// 'amount' => $this->getPrice($resource->priceAmount()),
|
||||
|
||||
Reference in New Issue
Block a user