Последняя версия с сервера прошлого разработчика

This commit is contained in:
2025-07-10 04:35:51 +00:00
commit c731570032
1174 changed files with 134314 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<?php
namespace App\Domain\PaymentGateway\Services;
class InterkassaService
{
public static function payments_link($amount, $order_id)
{
$configuration = new \Interkassa\Helper\Config();
$configuration->setCheckoutSecretKey(env('INTERKASSA_SECRET_KEY'));
$configuration->setAuthorizationKey(env('INTERKASSA_AUTH_KEY'));
$configuration->setAccountId(env('INTERKASSA_ACCOUNT_ID'));
$SDKClient = new \Interkassa\Interkassa($configuration);
$invoiceRequest = new \Interkassa\Request\GetInvoiceRequest();
$invoiceRequest
->setCheckoutId(env('INTERKASSA_ID'))
->setPaymentNumber($order_id)
->setAmount($amount)
->setCurrency('RUB')
->setDescription('Пополнение баланса');
return $SDKClient->makeInvoiceSciLink($invoiceRequest);
}
}

View File

@@ -0,0 +1,27 @@
<?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);
}
}

View File

@@ -0,0 +1,66 @@
<?php
namespace App\Domain\PaymentGateway\Services;
use UnitPay;
use CashItem;
class UnitpayService
{
public static function payments_link($amount, $order_id)
{
// Project Data
$domain = 'unitpay.ru';// Your working domain: unitpay.ru or address provided by unitpay support service
$secretKey = '72449d551500fb99bb66499203ed1ccb';// Project secret key
$publicId = 'demo';
// $publicId = '438925-9eafe';
// My item Info
$itemName = 'Пополнение баланса';
// My Order Data
$orderId = $order_id;
$orderSum = $amount;
$orderDesc = 'Payment for item "' . $itemName . '"';
$orderCurrency = 'RUB';
$unitpay = new UnitPay($domain, $secretKey);
// ->setCustomerEmail('customer@domain.com')
// ->setCustomerPhone('79001235555')
$unitpay
->setBackUrl('https://teeaseer.com')
->setCashItems([
new CashItem($itemName, 1, $orderSum)
]);
$redirectUrl = $unitpay->form(
$publicId,
$orderSum,
$orderId,
$orderDesc,
$orderCurrency
);
return $redirectUrl;
// $configuration = new \Interkassa\Helper\Config();
// $configuration->setCheckoutSecretKey(env('INTERKASSA_SECRET_KEY'));
// $configuration->setAuthorizationKey(env('INTERKASSA_AUTH_KEY'));
// $configuration->setAccountId(env('INTERKASSA_ACCOUNT_ID'));
// $SDKClient = new \Interkassa\Interkassa($configuration);
// $invoiceRequest = new \Interkassa\Request\GetInvoiceRequest();
// $invoiceRequest
// ->setCheckoutId(env('INTERKASSA_ID'))
// ->setPaymentNumber($order_id)
// ->setAmount($amount)
// ->setCurrency('RUB')
// ->setDescription('Пополнение баланса');
// return $SDKClient->makeInvoiceSciLink($invoiceRequest);
}
}

View File

@@ -0,0 +1,65 @@
<?php
namespace App\Domain\PaymentGateway\Services;
use YooKassa\Client;
class YookassaService
{
public static function payments_link($amount, $order, $user)
{
$YOOKASSA_SHOP_ID = env('YOOKASSA_SHOP_ID');
$YOOKASSA_KEY = env('YOOKASSA_KEY');
$idempotenceKey = $order->number;
$client = new Client();
$client->setAuth($YOOKASSA_SHOP_ID, $YOOKASSA_KEY);
$success_url = env('APP_URL') . '/payments/status/' . $order->number;
$response = $client->createPayment(
[
'amount' => [
'value' => $amount,
'currency' => 'RUB',
],
'capture' => true,
'payment_method_data' => [
'type' => 'sbp',
],
'confirmation' => [
'type' => 'redirect',
'return_url' => $success_url,
],
'receipt' => [
'customer' => [
'full_name' => $user->name ?? $user->username,
'phone' => $user->phone,
"email" => $user->email
],
'items' => [
[
'description' => 'оплата бонусов тизер',
'quantity' => 1.00,
'amount' => [
'value' => $amount,
'currency' => 'RUB',
],
'vat_code' => 1,
'payment_mode' => 'full_payment'
]
]
],
'description' => 'Заказ №' . $order->id,
],
$idempotenceKey
);
$order->system_payment_id = $response->getId();
$order->save();
$confirmationUrl = $response->getConfirmation()->getConfirmationUrl();
return $confirmationUrl;
}
}