Card Order
This commit is contained in:
committed by
GitHub
parent
8aff8fab10
commit
009c3ac381
@@ -117,8 +117,7 @@ class CardOrder extends Model
|
|||||||
*/
|
*/
|
||||||
public function priceAmount(): float
|
public function priceAmount(): float
|
||||||
{
|
{
|
||||||
return 1;
|
return $this->cardType->price ?? 32;
|
||||||
// return floatval($this->cardType->price);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -24,6 +24,16 @@ class OnlinePaymentRepo
|
|||||||
*/
|
*/
|
||||||
public const PAID = 'paid';
|
public const PAID = 'paid';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set price
|
||||||
|
*
|
||||||
|
* @param int $price
|
||||||
|
*/
|
||||||
|
public function getPrice(int|float|string $price): int
|
||||||
|
{
|
||||||
|
return intval(number_format($price, 2, "", ""));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pay card order
|
* Pay card order
|
||||||
*/
|
*/
|
||||||
@@ -33,7 +43,7 @@ class OnlinePaymentRepo
|
|||||||
|
|
||||||
$paymentResponse = Http::get('https://mpi.gov.tm/payment/rest/register.do', [
|
$paymentResponse = Http::get('https://mpi.gov.tm/payment/rest/register.do', [
|
||||||
'orderNumber' => $orderNumber,
|
'orderNumber' => $orderNumber,
|
||||||
'amount' => '00'.$resource->priceAmount(),
|
'amount' => getPrice($resource->priceAmount()),
|
||||||
'currency' => 934,
|
'currency' => 934,
|
||||||
'language' => 'ru',
|
'language' => 'ru',
|
||||||
'userName' => $resource->branch->billing_username,
|
'userName' => $resource->branch->billing_username,
|
||||||
|
|||||||
Reference in New Issue
Block a user