Files
site/app/Domain/PaymentGateway/Services/QiwiService.php
2025-04-21 16:03:20 +02:00

28 lines
735 B
PHP

<?php
namespace App\Domain\PaymentGateway\Services;
class QiwiService
{
public static function payments_link($amount, $order, $user)
{
$publicKey = env('QIWI_PUBLIC');
$SECRET_KEY = env('QIWI_SECRET');
$billPayments = new \Qiwi\Api\BillPayments($SECRET_KEY);
$success_url = env('APP_URL') . '/qiwi-to-payments/status/' . $order->number;
$params = [
'publicKey' => $publicKey,
'amount' => $amount,
'billId' => $order->number,
'successUrl' => $success_url,
'email' => $user->email,
'comment' => 'Пополнение баланса',
];
return $billPayments->createPaymentForm($params);
}
}