Compare commits
144 Commits
1746ba4a60
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| aaacac26d6 | |||
| 377acc18cf | |||
| c05a6972b8 | |||
| 1b27664780 | |||
| 03c692adbb | |||
| 2bd2c45ddb | |||
| e98674aa26 | |||
| d0d49d6517 | |||
| 45ca714b17 | |||
| 924ed64527 | |||
| ca2112d0e6 | |||
| 395e400b7f | |||
| 4d562baacd | |||
| 3e7d246273 | |||
| e6488343c1 | |||
| e5b600df5b | |||
| db3800921e | |||
| 2b2704f6d2 | |||
| 8ecf58de7c | |||
| f81acada2c | |||
| c336af2b6f | |||
| 9fc7d5c1e4 | |||
| 3c3d74ec34 | |||
| 33ec2e11e6 | |||
| 475c21af85 | |||
| fa41d7b9b0 | |||
| 328c2829f7 | |||
| 9b961ef647 | |||
| e736b8501d | |||
| 07a6679e9f | |||
| 50996ddacd | |||
| ef7c30a235 | |||
| 7ca24207fb | |||
| e64cf34c90 | |||
| 673042dd32 | |||
| 84348a1807 | |||
| 9f22e506b2 | |||
| 067ae91c2e | |||
| 82c17b41f6 | |||
| 4b0334fc48 | |||
| 5245f484a0 | |||
| 19f87050dd | |||
| 23ee71f4a4 | |||
| 5896fe4d56 | |||
| 76f6f1c3a3 | |||
| a622f7651a | |||
| a1521ace7a | |||
| d157c21883 | |||
| 6dab1a38c6 | |||
| a5e086237e | |||
| 44613f944e | |||
| 4ff92fe530 | |||
| 051ec52547 | |||
| 9cecd6c465 | |||
| 71e0f1c18d | |||
| 741de26eea | |||
| 574176e4b2 | |||
| 8d7633048b | |||
| 3a6a871c2f | |||
| bf21918a5a | |||
| f138a6c7cb | |||
| f2a94c3c49 | |||
| 4d4a499a56 | |||
| d89f86a534 | |||
| b8bdea33cb | |||
| 5a4759a137 | |||
| 161f993099 | |||
| d4a4c3d3f4 | |||
| 146266226b | |||
| 2e82b19563 | |||
| fc95d6c9f9 | |||
| 2368ea2a50 | |||
| 6aa44e3fa5 | |||
| f610474328 | |||
| 4f1dd64fba | |||
| 6abfc4ac48 | |||
| 7617e08632 | |||
| 84c0e99004 | |||
| 548d1040bb | |||
| df2f2979b5 | |||
| 5c6aff312a | |||
| 7513d6a9a9 | |||
| ffd43d32c2 | |||
| b5e57bccc8 | |||
| 1c00a28744 | |||
| c0dd8f269a | |||
| b3ed503742 | |||
| 014da27f66 | |||
| 2453fac7cf | |||
| fa04f374aa | |||
| 96c3122b2a | |||
| 78d7065b86 | |||
| daaa3bc360 | |||
| 3e04b17edf | |||
| ed65172b07 | |||
| 40565033b6 | |||
| 5cb2f9027c | |||
| 0b63d9098e | |||
| 4e1f286eb5 | |||
| 7efad097ef | |||
| 03d3e03f35 | |||
| 9186bc73e1 | |||
| 840358cc6a | |||
| 90c053689b | |||
| c7d6d947c9 | |||
| 9a330c18ad | |||
| cc31403a8a | |||
| 1b918348e5 | |||
| 640457b979 | |||
| c54535e197 | |||
| 5b4fa96956 | |||
| 2a840e3cc5 | |||
| df0a5eb329 | |||
| 53100e6be3 | |||
| cf8146fb4c | |||
| b509a23f7a | |||
| 44217fb8b9 | |||
| 975d03d2a1 | |||
| 3ad4a3b86b | |||
| ee555e899c | |||
| 054e2de5e6 | |||
| ea9b028c23 | |||
| 9c236aa8a8 | |||
| 5ebf573da2 | |||
| c348416c05 | |||
| 7c623e802f | |||
| 7d2ad13ae7 | |||
| 67457b5bc7 | |||
| f2564221ca | |||
| 703ae1bb0b | |||
| 028f11da9c | |||
| 0480ebad91 | |||
| eefe130ad3 | |||
| 772ac9ad0f | |||
| 5732d7eabe | |||
| 5abe97e20c | |||
| 405967fcea | |||
| 4d75c110e9 | |||
| afeefc7aed | |||
| 8a96772634 | |||
| eca675ae68 | |||
| 3d07137f71 | |||
| 652edb0896 | |||
| d9c463b427 |
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Console;
|
namespace App\Console;
|
||||||
|
|
||||||
|
use App\Jobs\SendSberToSystem;
|
||||||
|
use App\Jobs\SendVisaToSystem;
|
||||||
use Illuminate\Console\Scheduling\Schedule;
|
use Illuminate\Console\Scheduling\Schedule;
|
||||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||||
|
|
||||||
@@ -12,7 +14,11 @@ class Kernel extends ConsoleKernel
|
|||||||
*/
|
*/
|
||||||
protected function schedule(Schedule $schedule): void
|
protected function schedule(Schedule $schedule): void
|
||||||
{
|
{
|
||||||
$schedule->command('backup:run')->saturdays();
|
$schedule->job(new SendSberToSystem)
|
||||||
|
->everyMinute();
|
||||||
|
|
||||||
|
$schedule->job(new SendVisaToSystem)
|
||||||
|
->everyMinute();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,14 +1,18 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Events\EventType;
|
use App\Events\EventType;
|
||||||
|
use App\Models\Payment\OnlinePaymentHistory;
|
||||||
use App\Models\System\Roles\Permission;
|
use App\Models\System\Roles\Permission;
|
||||||
use App\Models\System\Verification;
|
use App\Models\System\Verification;
|
||||||
|
use App\Modules\SberPaymentOrder\Models\SberPaymentOrderItem;
|
||||||
|
use App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrderItem;
|
||||||
use App\Nova\Resources\Order\Card\CardTransaction\Actions\DownloadCardTransaction;
|
use App\Nova\Resources\Order\Card\CardTransaction\Actions\DownloadCardTransaction;
|
||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use GuzzleHttp\Psr7\Request as GuzzleRequest;
|
use GuzzleHttp\Psr7\Request as GuzzleRequest;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Http;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Stevebauman\Location\Facades\Location;
|
use Stevebauman\Location\Facades\Location;
|
||||||
@@ -67,7 +71,7 @@ function isTurkmenIp(string $ip = ''): bool
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Un mask phone from "+(993)-xx-xx-xx-xx"
|
* Un mask phone
|
||||||
*/
|
*/
|
||||||
function unMaskPhone(string|int $phone): string
|
function unMaskPhone(string|int $phone): string
|
||||||
{
|
{
|
||||||
@@ -143,7 +147,7 @@ function storeAuthEvent(string $name, Request $request): void
|
|||||||
$request->getPort(),
|
$request->getPort(),
|
||||||
isLocalIp($request->ip())
|
isLocalIp($request->ip())
|
||||||
? 'TM'
|
? 'TM'
|
||||||
: Location::get($request->ip())?->countryCode ?? 'TM',
|
: Location::get('95.85.34.23')?->countryCode ?? 'TM',
|
||||||
$request->user()->id ?? '-',
|
$request->user()->id ?? '-',
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@@ -311,7 +315,7 @@ function view_loan_order_permission_id(): int
|
|||||||
*/
|
*/
|
||||||
function vp_fetch_ClientInfoAll($model, $start_date, $end_date)
|
function vp_fetch_ClientInfoAll($model, $start_date, $end_date)
|
||||||
{
|
{
|
||||||
$response = DownloadCardTransaction::make()->fetchApi(
|
return fetchCardTransactionFromAzat(
|
||||||
passport_serie: $model->passport_serie,
|
passport_serie: $model->passport_serie,
|
||||||
passport_id: $model->passport_id,
|
passport_id: $model->passport_id,
|
||||||
card_number_masked: Str::mask($model->card_number, '*', 6, 6),
|
card_number_masked: Str::mask($model->card_number, '*', 6, 6),
|
||||||
@@ -319,6 +323,11 @@ function vp_fetch_ClientInfoAll($model, $start_date, $end_date)
|
|||||||
start_date: $start_date,
|
start_date: $start_date,
|
||||||
end_date: $end_date,
|
end_date: $end_date,
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function fetchCardTransactionFromAzat($passport_serie, $passport_id, $card_number_masked, $card_expire_date, $start_date, $end_date)
|
||||||
|
{
|
||||||
|
$response = DownloadCardTransaction::make()->fetchApi($passport_serie, $passport_id, $card_number_masked, $card_expire_date, $start_date, $end_date);
|
||||||
|
|
||||||
return Str::isJson($response)
|
return Str::isJson($response)
|
||||||
? json_decode($response)
|
? json_decode($response)
|
||||||
@@ -392,3 +401,358 @@ function emptyClass(...$arguments): object
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check online payment
|
||||||
|
*
|
||||||
|
* @param string $orderId
|
||||||
|
* @param int|string $username
|
||||||
|
* @param string $password
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
function checkOnlinePayment(string $orderId, int|string $username, string $password): mixed
|
||||||
|
{
|
||||||
|
$response = Http::asForm()->post('https://mpi.gov.tm/payment/rest/getOrderStatusExtended.do', [
|
||||||
|
'language' => 'ru',
|
||||||
|
'orderId' => $orderId,
|
||||||
|
'userName' => $username,
|
||||||
|
'password' => $password,
|
||||||
|
]);
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sync with bank system
|
||||||
|
*
|
||||||
|
* @param string $online_payment_order_uuid
|
||||||
|
* @param string $bank_unique_code
|
||||||
|
* @param string $online_payment_terminal_id
|
||||||
|
* @param string $user_deposit_account
|
||||||
|
* @param string $online_payment_auth_ref_num
|
||||||
|
* @param string $online_payment_tmt_amount
|
||||||
|
* @param string $pay_purpose
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
function syncWithBankSystem(
|
||||||
|
$online_payment_order_uuid,
|
||||||
|
$bank_unique_code,
|
||||||
|
$online_payment_terminal_id,
|
||||||
|
$user_deposit_account,
|
||||||
|
$online_payment_auth_ref_num,
|
||||||
|
$online_payment_tmt_amount,
|
||||||
|
$pay_purpose
|
||||||
|
): mixed {
|
||||||
|
$ecomId = $online_payment_order_uuid;
|
||||||
|
$agentId = $bank_unique_code;
|
||||||
|
$eposId = $online_payment_terminal_id;
|
||||||
|
$account = $user_deposit_account;
|
||||||
|
$rrn = $online_payment_auth_ref_num;
|
||||||
|
$amount = $online_payment_tmt_amount;
|
||||||
|
$payPurpose = $pay_purpose;
|
||||||
|
|
||||||
|
$client = new Client([
|
||||||
|
'timeout' => 5, // seconds before it fails
|
||||||
|
'connect_timeout' => 1, // seconds to wait for connection
|
||||||
|
]);
|
||||||
|
$headers = [
|
||||||
|
'Content-Type' => 'application/json',
|
||||||
|
'Authorization' => 'Basic YWRtaW46UUFad3N4MTIz',
|
||||||
|
];
|
||||||
|
$body = sprintf('{
|
||||||
|
"ecomId": "%s",
|
||||||
|
"agentId": "%s",
|
||||||
|
"eposId": "%s",
|
||||||
|
"account": "%s",
|
||||||
|
"rrn": "%s",
|
||||||
|
"amount": "%s",
|
||||||
|
"payPurpose": "%s"
|
||||||
|
}', $ecomId, $agentId, $eposId, $account, $rrn, $amount, $payPurpose);
|
||||||
|
|
||||||
|
$request = new GuzzleRequest('POST', 'http://10.3.158.102:8888/api/paytrn/new', $headers, $body);
|
||||||
|
|
||||||
|
try {
|
||||||
|
$res = $client->sendAsync($request)->wait();
|
||||||
|
|
||||||
|
return (string) $res->getBody();
|
||||||
|
} catch (Exception $e) {
|
||||||
|
info([$e->getMessage(), $e->getTraceAsString()]);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Sber credentials for a given payment item.
|
||||||
|
*
|
||||||
|
* @param SberPaymentOrderItem $item
|
||||||
|
* @return array{username?: string, password?: string, onlinePaymentResource?: OnlinePaymentHistory, relatedResource?: mixed, error?: string, type?: 'danger'|'modal'}
|
||||||
|
*/
|
||||||
|
function getSberCredentials(SberPaymentOrderItem $item): array
|
||||||
|
{
|
||||||
|
/** @var \App\Models\Payment\OnlinePaymentHistory|null $onlinePaymentResource */
|
||||||
|
$onlinePaymentResource = OnlinePaymentHistory::find($item->online_payment_history_id);
|
||||||
|
|
||||||
|
if (! $onlinePaymentResource) {
|
||||||
|
return ['error' => 'Online payment resource tapylmady', 'type' => 'danger'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$relatedResource = (new $onlinePaymentResource->online_paymantable_type)
|
||||||
|
->find(id: $onlinePaymentResource->online_paymantable_id);
|
||||||
|
|
||||||
|
if (! $relatedResource) {
|
||||||
|
return ['error' => 'Bu resource tapylmady', 'type' => 'danger'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$relatedResource->loadMissing(['branch']);
|
||||||
|
|
||||||
|
if (! $relatedResource->branch) {
|
||||||
|
return ['error' => 'Şahamça bilen birikdirilmedik', 'type' => 'danger'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$username = $relatedResource->branch->billing_sber_username;
|
||||||
|
$password = $relatedResource->branch->billing_sber_password;
|
||||||
|
|
||||||
|
if (empty($username) || empty($password)) {
|
||||||
|
return ['error' => 'Ulanyjy ady bilen açar sözi gabat gelmedi', 'type' => 'modal'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
'username' => $username,
|
||||||
|
'password' => $password,
|
||||||
|
'onlinePaymentResource' => $onlinePaymentResource,
|
||||||
|
'relatedResource' => $relatedResource,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
function syncSberWithAzatAPI(SberPaymentOrderItem $orderItem): array
|
||||||
|
{
|
||||||
|
$result = getSberCredentials($orderItem);
|
||||||
|
|
||||||
|
if (isset($result['error'])) {
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @var \App\Models\Payment\OnlinePaymentHistory $onlinePaymentResource */
|
||||||
|
$onlinePaymentResource = $result['onlinePaymentResource'];
|
||||||
|
|
||||||
|
/** @var \App\Modules\SberPaymentOrder\Models\SberPaymentOrder $sberPaymentOrder */
|
||||||
|
$sberPaymentOrder = $result['relatedResource'];
|
||||||
|
|
||||||
|
$response = checkOnlinePayment($onlinePaymentResource->orderId, $result['username'], $result['password']);
|
||||||
|
|
||||||
|
if ($response['errorCode'] != 0) {
|
||||||
|
return [
|
||||||
|
'error' => $response['errorMessage'],
|
||||||
|
'type' => 'modal',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! isset($response['authRefNum'])) {
|
||||||
|
warn('missing-authRefNum', $onlinePaymentResource->orderId);
|
||||||
|
ignoreSberPayment('missing-authRefNum', $orderItem);
|
||||||
|
|
||||||
|
return [
|
||||||
|
'error' => 'authRefNum missing',
|
||||||
|
'type' => 'modal',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$systemRawResponse = syncWithBankSystem(
|
||||||
|
online_payment_order_uuid: $onlinePaymentResource->orderId,
|
||||||
|
bank_unique_code: $sberPaymentOrder->branch->unique_code,
|
||||||
|
online_payment_terminal_id: $response['terminalId'],
|
||||||
|
user_deposit_account: number_format($sberPaymentOrder->sender_deposit_account, 0, '', ''),
|
||||||
|
online_payment_auth_ref_num: $response['authRefNum'],
|
||||||
|
online_payment_tmt_amount: $orderItem->tmt_payment_amount,
|
||||||
|
pay_purpose: $orderItem->created_at->translatedFormat('F').' '.$orderItem->created_at->format('Y')
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($systemRawResponse == null) {
|
||||||
|
return [
|
||||||
|
'error' => 'Connection issue to SYSTEM',
|
||||||
|
'type' => 'modal',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$systemResponse = json_decode($systemRawResponse);
|
||||||
|
|
||||||
|
$success = false;
|
||||||
|
if (is_object($systemResponse)) {
|
||||||
|
$success = $systemResponse->errCode == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $success) {
|
||||||
|
$message = 'Error';
|
||||||
|
|
||||||
|
if (isset($systemResponse->msgSys)) {
|
||||||
|
$message .= ' '.$systemResponse->msgSys;
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
'error' => $message,
|
||||||
|
'type' => 'modal',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$orderItem->update([
|
||||||
|
'synced_with_system' => true,
|
||||||
|
]);
|
||||||
|
|
||||||
|
return [
|
||||||
|
'success' => true,
|
||||||
|
'type' => 'modal',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Sber credentials for a given payment item.
|
||||||
|
*
|
||||||
|
* @param SberPaymentOrderItem $item
|
||||||
|
* @return array{username?: string, password?: string, onlinePaymentResource?: OnlinePaymentHistory, relatedResource?: mixed, error?: string, type?: 'danger'|'modal'}
|
||||||
|
*/
|
||||||
|
function getVisaCredentials(VisaMasterPaymentOrderItem $item): array
|
||||||
|
{
|
||||||
|
/** @var \App\Models\Payment\OnlinePaymentHistory|null $onlinePaymentResource */
|
||||||
|
$onlinePaymentResource = OnlinePaymentHistory::find($item->online_payment_history_id);
|
||||||
|
|
||||||
|
if (! $onlinePaymentResource) {
|
||||||
|
return ['error' => 'Online payment resource tapylmady', 'type' => 'danger'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$relatedResource = (new $onlinePaymentResource->online_paymantable_type)
|
||||||
|
->find(id: $onlinePaymentResource->online_paymantable_id);
|
||||||
|
|
||||||
|
if (! $relatedResource) {
|
||||||
|
return ['error' => 'Bu resource tapylmady', 'type' => 'danger'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$relatedResource->loadMissing(['branch']);
|
||||||
|
|
||||||
|
if (! $relatedResource->branch) {
|
||||||
|
return ['error' => 'Şahamça bilen birikdirilmedik', 'type' => 'danger'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$username = $relatedResource->branch->billing_visa_master_username;
|
||||||
|
$password = $relatedResource->branch->billing_visa_master_password;
|
||||||
|
|
||||||
|
if (empty($username) || empty($password)) {
|
||||||
|
return ['error' => 'Ulanyjy ady bilen açar sözi gabat gelmedi', 'type' => 'modal'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
'username' => $username,
|
||||||
|
'password' => $password,
|
||||||
|
'onlinePaymentResource' => $onlinePaymentResource,
|
||||||
|
'relatedResource' => $relatedResource,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
function syncVisaWithAzatAPI(VisaMasterPaymentOrderItem $orderItem): array
|
||||||
|
{
|
||||||
|
$result = getVisaCredentials($orderItem);
|
||||||
|
|
||||||
|
if (isset($result['error'])) {
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @var \App\Models\Payment\OnlinePaymentHistory $onlinePaymentResource */
|
||||||
|
$onlinePaymentResource = $result['onlinePaymentResource'];
|
||||||
|
|
||||||
|
/** @var \App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrder $sberPaymentOrder */
|
||||||
|
$visaPaymentOrder = $result['relatedResource'];
|
||||||
|
|
||||||
|
$response = checkOnlinePayment($onlinePaymentResource->orderId, $result['username'], $result['password']);
|
||||||
|
|
||||||
|
if ($response['errorCode'] != 0) {
|
||||||
|
return [
|
||||||
|
'error' => $response['errorMessage'],
|
||||||
|
'type' => 'modal',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! isset($response['authRefNum'])) {
|
||||||
|
warn('missing-authRefNum', $onlinePaymentResource->orderId);
|
||||||
|
ignoreVisaPayment('missing-authRefNum', $orderItem);
|
||||||
|
|
||||||
|
return [
|
||||||
|
'error' => 'authRefNum missing',
|
||||||
|
'type' => 'modal',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$systemRawResponse = syncWithBankSystem(
|
||||||
|
online_payment_order_uuid: $onlinePaymentResource->orderId,
|
||||||
|
bank_unique_code: $visaPaymentOrder->branch->unique_code,
|
||||||
|
online_payment_terminal_id: $response['terminalId'],
|
||||||
|
user_deposit_account: number_format($visaPaymentOrder->sender_deposit_account, 0, '', ''),
|
||||||
|
online_payment_auth_ref_num: $response['authRefNum'],
|
||||||
|
online_payment_tmt_amount: $orderItem->tmt_payment_amount,
|
||||||
|
pay_purpose: $orderItem->created_at->translatedFormat('F').' '.$orderItem->created_at->format('Y')
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($systemRawResponse == null) {
|
||||||
|
return [
|
||||||
|
'error' => 'Connection issue to SYSTEM',
|
||||||
|
'type' => 'modal',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$systemResponse = json_decode($systemRawResponse);
|
||||||
|
|
||||||
|
$success = false;
|
||||||
|
if (is_object($systemResponse)) {
|
||||||
|
$success = $systemResponse->errCode == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $success) {
|
||||||
|
$message = 'Error';
|
||||||
|
|
||||||
|
if (isset($systemResponse->msgSys)) {
|
||||||
|
$message .= ' '.$systemResponse->msgSys;
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
'error' => $message,
|
||||||
|
'type' => 'modal',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$orderItem->update([
|
||||||
|
'synced_with_system' => true,
|
||||||
|
]);
|
||||||
|
|
||||||
|
return [
|
||||||
|
'success' => true,
|
||||||
|
'type' => 'modal',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
function warn($message, $content) {
|
||||||
|
DB::table('warnings')->insert([
|
||||||
|
'message' => $message,
|
||||||
|
'content' => $content,
|
||||||
|
'created_at' => now(),
|
||||||
|
'updated_at' => now(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function ignoreVisaPayment($message, $item) {
|
||||||
|
DB::table('ignore_visa_payments')->insert([
|
||||||
|
'message' => $message,
|
||||||
|
'payment_id' => $item->id,
|
||||||
|
'created_at' => now(),
|
||||||
|
'updated_at' => now(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function ignoreSberPayment($message, $item) {
|
||||||
|
DB::table('ignore_sber_payments')->insert([
|
||||||
|
'message' => $message,
|
||||||
|
'payment_id' => $item->id,
|
||||||
|
'created_at' => now(),
|
||||||
|
'updated_at' => now(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ class CardBalanceController extends Controller
|
|||||||
return response()->json(
|
return response()->json(
|
||||||
CardBalance::query()
|
CardBalance::query()
|
||||||
->where('user_id', auth()->id())
|
->where('user_id', auth()->id())
|
||||||
|
->latest()
|
||||||
->get()
|
->get()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -173,4 +174,57 @@ class CardBalanceController extends Controller
|
|||||||
'message' => __('Successfully deleted'),
|
'message' => __('Successfully deleted'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Quick card balance check
|
||||||
|
*/
|
||||||
|
public function quickCheck(Request $request): JsonResponse
|
||||||
|
{
|
||||||
|
$request->validate([
|
||||||
|
/**
|
||||||
|
* @example I-AS
|
||||||
|
*/
|
||||||
|
'passport_serie' => ['sometimes', Rule::in(array_keys(PassportRepo::values()))],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @example 379514
|
||||||
|
*/
|
||||||
|
'passport_id' => ['sometimes', 'numeric', 'digits:6'],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @example 9934612100000243
|
||||||
|
*/
|
||||||
|
'card_number' => ['sometimes', 'digits:16'],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @example 12
|
||||||
|
*/
|
||||||
|
'card_month' => ['sometimes', Rule::in(array_keys(DateHelperRepository::staticNumberMonths()))],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @example 2049
|
||||||
|
*/
|
||||||
|
'card_year' => ['sometimes', Rule::in(array_keys(DateHelperRepository::staticNumberYears()))],
|
||||||
|
]);
|
||||||
|
|
||||||
|
$response = DownloadCardBalance::make()->fetchApi(
|
||||||
|
passport_serie: $request->passport_serie,
|
||||||
|
passport_id: $request->passport_id,
|
||||||
|
card_masked: Str::mask($request->card_number, '*', 6, 6),
|
||||||
|
card_expire_date: $request->card_month.'/'.substr($request->card_year, 2),
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($response->errCode != 0) {
|
||||||
|
return response()->json([
|
||||||
|
'status' => false,
|
||||||
|
'message' => $response->message,
|
||||||
|
'url' => '',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return response()->json([
|
||||||
|
'status' => true,
|
||||||
|
'data' => $response,
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ class CardOrderController extends Controller
|
|||||||
CardOrder::query()
|
CardOrder::query()
|
||||||
->with(['branch', 'cardState', 'cardType'])
|
->with(['branch', 'cardState', 'cardType'])
|
||||||
->where('user_id', auth()->id())
|
->where('user_id', auth()->id())
|
||||||
|
->latest()
|
||||||
->get()
|
->get()
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ class CardPinController extends Controller
|
|||||||
CardPin::query()
|
CardPin::query()
|
||||||
->with('branch', 'cardType')
|
->with('branch', 'cardType')
|
||||||
->where('user_id', auth()->id())
|
->where('user_id', auth()->id())
|
||||||
|
->latest()
|
||||||
->get()
|
->get()
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@@ -51,7 +52,7 @@ class CardPinController extends Controller
|
|||||||
], 201);
|
], 201);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Upload files
|
* Upload files
|
||||||
*
|
*
|
||||||
* @return array<string, string>
|
* @return array<string, string>
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ class CardRequisiteController extends Controller
|
|||||||
CardRequisite::query()
|
CardRequisite::query()
|
||||||
->with(['cardType', 'branch'])
|
->with(['cardType', 'branch'])
|
||||||
->where('user_id', auth()->id())
|
->where('user_id', auth()->id())
|
||||||
|
->latest()
|
||||||
->get()
|
->get()
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,11 +12,67 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
use Illuminate\Validation\Rule;
|
use Illuminate\Validation\Rule;
|
||||||
|
|
||||||
#[Group('Sargytlar - Kart - Kart hereketleri')]
|
#[Group('Sargytlar - Kart - Kart hereketleri')]
|
||||||
class CardTransactionsController extends Controller
|
class CardTransactionsController extends Controller
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* This month transactions on card
|
||||||
|
*/
|
||||||
|
public function lastMonth(): JsonResponse
|
||||||
|
{
|
||||||
|
$user = auth()->user();
|
||||||
|
|
||||||
|
$start_date = today()->subDays(10)->format('d.m.Y');
|
||||||
|
$end_date = today()->format('d.m.Y');
|
||||||
|
$passport_serie = $user->getOption('passport_serie');
|
||||||
|
$passport_id = $user->getOption('passport_id');
|
||||||
|
$card_number = $user->getOption('card_number');
|
||||||
|
$card_month = $user->getOption('card_month');
|
||||||
|
$card_year = $user->getOption('card_year');
|
||||||
|
|
||||||
|
if (
|
||||||
|
is_null($passport_serie) || $passport_serie === '' ||
|
||||||
|
is_null($passport_id) || $passport_id === '' ||
|
||||||
|
is_null($card_number) || $card_number === '' ||
|
||||||
|
is_null($card_month) || $card_month === '' ||
|
||||||
|
is_null($card_year) || $card_year === ''
|
||||||
|
) {
|
||||||
|
return response()->rest([
|
||||||
|
'status' => false,
|
||||||
|
'message' => 'Profile data needed',
|
||||||
|
'data' => '',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$card_month = str_pad($card_month, 2, '0', STR_PAD_LEFT);
|
||||||
|
|
||||||
|
$response = fetchCardTransactionFromAzat(
|
||||||
|
passport_serie: $passport_serie,
|
||||||
|
passport_id: $passport_id,
|
||||||
|
card_number_masked: Str::mask($card_number, '*', 6, 6),
|
||||||
|
card_expire_date: $card_month.'/'.substr($card_year, 2),
|
||||||
|
start_date: $start_date,
|
||||||
|
end_date: $end_date,
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($response->errCode != 0) {
|
||||||
|
return response()->json([
|
||||||
|
'status' => false,
|
||||||
|
'message' => $response->message,
|
||||||
|
'data' => [],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return response()->json([
|
||||||
|
'status' => true,
|
||||||
|
'message' => 'a',
|
||||||
|
'data' => $response,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LIST*
|
* LIST*
|
||||||
*/
|
*/
|
||||||
@@ -25,6 +81,7 @@ class CardTransactionsController extends Controller
|
|||||||
return response()->json(
|
return response()->json(
|
||||||
CardTransaction::query()
|
CardTransaction::query()
|
||||||
->where('user_id', auth()->id())
|
->where('user_id', auth()->id())
|
||||||
|
->latest()
|
||||||
->get()
|
->get()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ namespace App\Http\Controllers\Api;
|
|||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Models\CMS\ContactUs;
|
use App\Models\CMS\ContactUs;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Validation\Rule;
|
|
||||||
|
|
||||||
class ContactUsController extends Controller
|
class ContactUsController extends Controller
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ class LoanOrderRemainingOrderController extends Controller
|
|||||||
return response()->json(
|
return response()->json(
|
||||||
LoanRemainingOrder::query()
|
LoanRemainingOrder::query()
|
||||||
->where('user_id', auth()->id())
|
->where('user_id', auth()->id())
|
||||||
|
->latest()
|
||||||
->get()
|
->get()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ class LoanPaidOffLetterOrderController extends Controller
|
|||||||
LoanPaidOffLetterOrder::query()
|
LoanPaidOffLetterOrder::query()
|
||||||
->with('branch')
|
->with('branch')
|
||||||
->where('user_id', auth()->id())
|
->where('user_id', auth()->id())
|
||||||
|
->latest()
|
||||||
->get()
|
->get()
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class ResetPasswordController extends Controller
|
|||||||
{
|
{
|
||||||
$request->validate([
|
$request->validate([
|
||||||
'username' => ['required', 'string', 'max:250', 'exists:users,username'],
|
'username' => ['required', 'string', 'max:250', 'exists:users,username'],
|
||||||
'verification' => ['nullable', 'integer', 'digits:5', Rule::requiredIf(fn () => $request->filled('step-verification'))],
|
'verification' => ['nullable', 'integer', Rule::requiredIf(fn () => $request->filled('step-verification'))],
|
||||||
'step-sms' => ['nullable'],
|
'step-sms' => ['nullable'],
|
||||||
'step-verification' => ['nullable'],
|
'step-verification' => ['nullable'],
|
||||||
'step-password' => ['nullable'],
|
'step-password' => ['nullable'],
|
||||||
|
|||||||
@@ -25,27 +25,6 @@ class OnlinePaymentController extends Controller
|
|||||||
{
|
{
|
||||||
$data = OnlinePaymentRepo::checkPaymentVisaMaster($request);
|
$data = OnlinePaymentRepo::checkPaymentVisaMaster($request);
|
||||||
|
|
||||||
/** @var \App\Models\Payment\OnlinePaymentHistory */
|
|
||||||
$paymentHistory = $data['paymentHistory'];
|
|
||||||
|
|
||||||
/** @var \App\Models\Branch\Branch */
|
|
||||||
$bank = $data['bank_branch'];
|
|
||||||
|
|
||||||
/** @var \App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrderItem */
|
|
||||||
$resource = $data['resource'];
|
|
||||||
|
|
||||||
// if ($data['success'] && $paymentHistory && is_array($paymentHistory->api_response)) {
|
|
||||||
// info(OnlinePaymentRepo::syncWithBilling(
|
|
||||||
// uuid: $paymentHistory->orderId,
|
|
||||||
// bank_code: $bank->unique_code,
|
|
||||||
// terminal_id: $paymentHistory->api_response['terminalId'],
|
|
||||||
// account_number: $resource->parent->sender_datas[0]['deposit_account'],
|
|
||||||
// rrn: $paymentHistory->api_response['authRefNum'],
|
|
||||||
// amount: $resource->tmt_payment_amount,
|
|
||||||
// pay_purpose: $resource->created_at->translatedFormat('F').' '.$resource->created_at->format('Y'),
|
|
||||||
// ));
|
|
||||||
// }
|
|
||||||
|
|
||||||
return view(OnlinePaymentRepo::statusView(), $data);
|
return view(OnlinePaymentRepo::statusView(), $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,8 +35,6 @@ class OnlinePaymentController extends Controller
|
|||||||
{
|
{
|
||||||
$data = OnlinePaymentRepo::checkPaymentSber($request);
|
$data = OnlinePaymentRepo::checkPaymentSber($request);
|
||||||
|
|
||||||
// OnlinePaymentRepo::syncWithBilling();
|
|
||||||
|
|
||||||
return view(OnlinePaymentRepo::statusView(), $data);
|
return view(OnlinePaymentRepo::statusView(), $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Http\Requests\UpdateUserProfileRequest;
|
use App\Http\Requests\UpdateUserProfileRequest;
|
||||||
|
use App\Http\Resources\ProfileResponse;
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
|
|
||||||
class ProfileController extends Controller
|
class ProfileController extends Controller
|
||||||
@@ -15,12 +16,7 @@ class ProfileController extends Controller
|
|||||||
/** @var \App\Models\User */
|
/** @var \App\Models\User */
|
||||||
$user = auth()->user();
|
$user = auth()->user();
|
||||||
|
|
||||||
return response()->json([
|
return response()->json(new ProfileResponse($user));
|
||||||
'name' => $user->name,
|
|
||||||
'phone' => $user->phone,
|
|
||||||
'passport_serie' => $user->getOption('passport_serie'),
|
|
||||||
'passport_id' => $user->getOption('passport_id'),
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -36,6 +32,10 @@ class ProfileController extends Controller
|
|||||||
'phone' => $request->phone,
|
'phone' => $request->phone,
|
||||||
'options->passport_serie' => $request->passport_serie,
|
'options->passport_serie' => $request->passport_serie,
|
||||||
'options->passport_id' => $request->passport_id,
|
'options->passport_id' => $request->passport_id,
|
||||||
|
'options->card_number' => $request->card_number,
|
||||||
|
'options->card_month' => $request->card_month,
|
||||||
|
'options->card_year' => $request->card_year,
|
||||||
|
'options->card_name' => $request->card_name,
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($request->password) {
|
if ($request->password) {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Http\Requests;
|
namespace App\Http\Requests;
|
||||||
|
|
||||||
|
use App\Modules\DateHelper\Repositories\DateHelperRepository;
|
||||||
use App\Repos\System\Settings\Legal\PassportRepo;
|
use App\Repos\System\Settings\Legal\PassportRepo;
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
use Illuminate\Validation\Rule;
|
use Illuminate\Validation\Rule;
|
||||||
@@ -47,14 +48,34 @@ class UpdateUserProfileRequest extends FormRequest
|
|||||||
*
|
*
|
||||||
* @example I-AS
|
* @example I-AS
|
||||||
*/
|
*/
|
||||||
'passport_serie' => ['nullable', 'string', Rule::in(array_keys(PassportRepo::values()))],
|
'passport_serie' => ['sometimes', 'string', Rule::in(array_keys(PassportRepo::values()))],
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Passport id
|
* Passport id
|
||||||
*
|
*
|
||||||
* @example 100999
|
* @example 100999
|
||||||
*/
|
*/
|
||||||
'passport_id' => ['nullable', 'numeric', 'digits:6'],
|
'passport_id' => ['sometimes', 'numeric', 'digits:6'],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @example 9934612100000543
|
||||||
|
*/
|
||||||
|
'card_number' => ['sometimes', 'digits:16'],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @example 12
|
||||||
|
*/
|
||||||
|
'card_month' => ['sometimes', Rule::in(array_keys(DateHelperRepository::staticNumberMonths()))],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @example 2049
|
||||||
|
*/
|
||||||
|
'card_year' => ['sometimes', Rule::in(array_keys(DateHelperRepository::staticNumberYears()))],
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @example Nurmuhammet Allanov
|
||||||
|
*/
|
||||||
|
'card_name' => ['sometimes', 'string', 'max:255'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
31
app/Http/Resources/ProfileResponse.php
Normal file
31
app/Http/Resources/ProfileResponse.php
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Resources;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @mixin \App\Models\User
|
||||||
|
*/
|
||||||
|
class ProfileResponse extends JsonResource
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Transform the resource into an array.
|
||||||
|
*
|
||||||
|
* @return array<string, mixed>
|
||||||
|
*/
|
||||||
|
public function toArray(Request $request): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'name' => $this->name,
|
||||||
|
'phone' => $this->phone,
|
||||||
|
'passport_serie' => $this->getOption('passport_serie'),
|
||||||
|
'passport_id' => $this->getOption('passport_id'),
|
||||||
|
'card_number' => $this->getOption('card_number'),
|
||||||
|
'card_month' => $this->getOption('card_month'),
|
||||||
|
'card_year' => $this->getOption('card_year'),
|
||||||
|
'card_name' => $this->getOption('card_name'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
64
app/Jobs/SendSberToSystem.php
Normal file
64
app/Jobs/SendSberToSystem.php
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Jobs;
|
||||||
|
|
||||||
|
use App\Modules\SberPaymentOrder\Models\SberPaymentOrderItem;
|
||||||
|
use Illuminate\Bus\Queueable;
|
||||||
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
|
use Illuminate\Foundation\Bus\Dispatchable;
|
||||||
|
use Illuminate\Queue\InteractsWithQueue;
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
|
class SendSberToSystem implements ShouldQueue
|
||||||
|
{
|
||||||
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The number of seconds the job can run before timing out.
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
public $timeout = 5;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new job instance.
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the job.
|
||||||
|
*/
|
||||||
|
public function handle(): void
|
||||||
|
{
|
||||||
|
$ignore = DB::table('ignore_sber_payments')->pluck('payment_id');
|
||||||
|
|
||||||
|
$orderItems = SberPaymentOrderItem::query()
|
||||||
|
->where('paid', true)
|
||||||
|
->where('synced_with_system', false)
|
||||||
|
->whereDate('created_at', '>', '2025-09-05')
|
||||||
|
->whereIntegerNotInRaw('id', $ignore)
|
||||||
|
->limit(2)
|
||||||
|
->get()
|
||||||
|
->each(function ($orderItem) {
|
||||||
|
if (! $orderItem) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = syncSberWithAzatAPI($orderItem);
|
||||||
|
|
||||||
|
if (isset($result['error'])) {
|
||||||
|
ignoreSberPayment($result['error'], $orderItem);
|
||||||
|
|
||||||
|
Log::channel('sber_job')->error(json_encode([
|
||||||
|
'error' => $result['error'],
|
||||||
|
'orderItem' => $orderItem,
|
||||||
|
]));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
50
app/Jobs/SendVisaToSystem.php
Normal file
50
app/Jobs/SendVisaToSystem.php
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Jobs;
|
||||||
|
|
||||||
|
use App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrderItem;
|
||||||
|
use Illuminate\Bus\Queueable;
|
||||||
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
|
use Illuminate\Foundation\Bus\Dispatchable;
|
||||||
|
use Illuminate\Queue\InteractsWithQueue;
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
|
class SendVisaToSystem implements ShouldQueue
|
||||||
|
{
|
||||||
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new job instance.
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the job.
|
||||||
|
*/
|
||||||
|
public function handle(): void
|
||||||
|
{
|
||||||
|
$ignore = DB::table('ignore_visa_payments')->pluck('payment_id');
|
||||||
|
|
||||||
|
$orderItems = VisaMasterPaymentOrderItem::query()
|
||||||
|
->where('paid', true)
|
||||||
|
->where('synced_with_system', false)
|
||||||
|
->whereDate('created_at', '>', '2025-09-05')
|
||||||
|
->whereIntegerNotInRaw('id', $ignore)
|
||||||
|
->limit(2)
|
||||||
|
->get()
|
||||||
|
->each(function ($orderItem) {
|
||||||
|
if (! $orderItem) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = syncVisaWithAzatAPI($orderItem);
|
||||||
|
|
||||||
|
if (isset($result['error'])) {}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
11
app/Models/IgnoreSberPayment.php
Normal file
11
app/Models/IgnoreSberPayment.php
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class IgnoreSberPayment extends Model
|
||||||
|
{
|
||||||
|
use HasFactory;
|
||||||
|
}
|
||||||
11
app/Models/IgnoreVisaPayment.php
Normal file
11
app/Models/IgnoreVisaPayment.php
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class IgnoreVisaPayment extends Model
|
||||||
|
{
|
||||||
|
use HasFactory;
|
||||||
|
}
|
||||||
@@ -158,7 +158,7 @@ class CardOrder extends Model
|
|||||||
/**
|
/**
|
||||||
* Price for order
|
* Price for order
|
||||||
*/
|
*/
|
||||||
public function priceAmount(): float
|
public function priceAmount(): string|int|float
|
||||||
{
|
{
|
||||||
return $this->cardState->price ?? 32;
|
return $this->cardState->price ?? 32;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ namespace App\Models\Order\Card\CardPin;
|
|||||||
use App\Models\Branch\Branch;
|
use App\Models\Branch\Branch;
|
||||||
use App\Models\Order\Card\CardType;
|
use App\Models\Order\Card\CardType;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
use App\Repos\Order\Loan\LoanOrderRepo;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
@@ -121,4 +122,14 @@ class CardPin extends Model
|
|||||||
{
|
{
|
||||||
return 3.02;
|
return 3.02;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* "boot" method for model
|
||||||
|
*/
|
||||||
|
protected static function boot()
|
||||||
|
{
|
||||||
|
parent::boot();
|
||||||
|
|
||||||
|
static::created(LoanOrderRepo::created());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace App\Models\Order\Loan;
|
|||||||
|
|
||||||
use App\Models\Branch\Branch;
|
use App\Models\Branch\Branch;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
use App\Repos\Order\Loan\LoanOrderRepo;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
|||||||
@@ -175,12 +175,20 @@ class User extends Authenticatable
|
|||||||
return $this->hasRole('operator');
|
return $this->hasRole('operator');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if user is a currency maintainer.
|
||||||
|
*/
|
||||||
|
public function isCurrencyMaintainer(): bool
|
||||||
|
{
|
||||||
|
return $this->hasRole('currency_maintainer');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Is System User
|
* Is System User
|
||||||
*/
|
*/
|
||||||
public function isSystemUser(): bool
|
public function isSystemUser(): bool
|
||||||
{
|
{
|
||||||
return $this->isAdmin() || $this->isOperator();
|
return $this->isAdmin() || $this->isOperator() || $this->isCurrencyMaintainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
11
app/Models/Warning.php
Normal file
11
app/Models/Warning.php
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class Warning extends Model
|
||||||
|
{
|
||||||
|
use HasFactory;
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Modules\ApiAuth\Controllers;
|
namespace App\Modules\ApiAuth\Controllers;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Http\Resources\ProfileResponse;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Modules\ApiAuth\Requests\AuthLoginRequest;
|
use App\Modules\ApiAuth\Requests\AuthLoginRequest;
|
||||||
use App\Modules\ApiAuth\Requests\AuthRegisterRequest;
|
use App\Modules\ApiAuth\Requests\AuthRegisterRequest;
|
||||||
@@ -62,12 +63,7 @@ class ApiAuthController extends Controller
|
|||||||
'success' => true,
|
'success' => true,
|
||||||
'token' => $user->createToken(bin2hex(random_bytes(20)))->plainTextToken,
|
'token' => $user->createToken(bin2hex(random_bytes(20)))->plainTextToken,
|
||||||
'message' => __('successfully verified'),
|
'message' => __('successfully verified'),
|
||||||
'user' => [
|
'user' => new ProfileResponse($user),
|
||||||
'name' => $user->name,
|
|
||||||
'phone' => $user->phone,
|
|
||||||
'passport_serie' => $user->getOption('passport_serie'),
|
|
||||||
'passport_id' => $user->getOption('passport_id'),
|
|
||||||
],
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,17 +4,14 @@ namespace App\Modules\LoanOrder\Controllers;
|
|||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Models\Order\Loan\LoanOrder;
|
use App\Models\Order\Loan\LoanOrder;
|
||||||
use App\Modules\DateHelper\Repositories\DateHelperRepository;
|
|
||||||
use App\Modules\LoanOrder\Controllers\Requests\LoanOrderStoreRequest;
|
use App\Modules\LoanOrder\Controllers\Requests\LoanOrderStoreRequest;
|
||||||
use App\Modules\LoanOrder\Controllers\Requests\LoanOrderUpdateRequest;
|
use App\Modules\LoanOrder\Controllers\Requests\LoanOrderUpdateRequest;
|
||||||
use App\Modules\LoanOrder\Controllers\Resources\LoanOrderIndexResource;
|
|
||||||
use App\Modules\LoanOrder\Controllers\Resources\LoanOrderShowResource;
|
use App\Modules\LoanOrder\Controllers\Resources\LoanOrderShowResource;
|
||||||
use App\Repos\Order\OrderRepo;
|
use App\Repos\Order\OrderRepo;
|
||||||
use Dedoc\Scramble\Attributes\Group;
|
use Dedoc\Scramble\Attributes\Group;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Log;
|
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
#[Group('Sargytlar - Karz - Karz sargytlary Mobile')]
|
#[Group('Sargytlar - Karz - Karz sargytlary Mobile')]
|
||||||
@@ -27,12 +24,19 @@ class LoanOrderController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index(Request $request): JsonResponse
|
public function index(Request $request): JsonResponse
|
||||||
{
|
{
|
||||||
return response()->json(LoanOrderIndexResource::collection(
|
return response()->json(
|
||||||
LoanOrder::query()
|
LoanOrder::query()
|
||||||
->where('user_id', auth()->id())
|
->where('user_id', auth()->id())
|
||||||
->where('source', OrderRepo::MOBILE_DEVICE)
|
->where('source', OrderRepo::MOBILE_DEVICE)
|
||||||
->paginate()
|
->latest()
|
||||||
));
|
->get()
|
||||||
|
->map(fn (LoanOrder $loanOrder) => [
|
||||||
|
'id' => $loanOrder->id,
|
||||||
|
'loan_type' => $loanOrder->loanType?->name,
|
||||||
|
'loan_amount' => $loanOrder->loan_amount,
|
||||||
|
'created_at' => $loanOrder->created_at,
|
||||||
|
])
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -42,22 +46,8 @@ class LoanOrderController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function store(LoanOrderStoreRequest $request): JsonResponse
|
public function store(LoanOrderStoreRequest $request): JsonResponse
|
||||||
{
|
{
|
||||||
Log::channel('form_logs')->info('loan-order-store-request', $request->all());
|
|
||||||
|
|
||||||
$data = $request->validated();
|
$data = $request->validated();
|
||||||
|
|
||||||
$months = DateHelperRepository::monthsAsNumber();
|
|
||||||
$years = DateHelperRepository::yearsUntil();
|
|
||||||
|
|
||||||
$data['card_month'] = indexByValue($request->card_month, $months);
|
|
||||||
$data['card_year'] = indexByValue($request->card_year, $years);
|
|
||||||
|
|
||||||
$data['guarantor_card_month'] = indexByValue($request->guarantor_card_month, $months);
|
|
||||||
$data['guarantor_card_year'] = indexByValue($request->guarantor_card_year, $years);
|
|
||||||
|
|
||||||
$data['guarantor_2_card_month'] = indexByValue($request->guarantor_2_card_month, $months);
|
|
||||||
$data['guarantor_2_card_year'] = indexByValue($request->guarantor_2_card_year, $years);
|
|
||||||
|
|
||||||
LoanOrder::forceCreate([
|
LoanOrder::forceCreate([
|
||||||
...$data,
|
...$data,
|
||||||
...[
|
...[
|
||||||
@@ -112,37 +102,6 @@ class LoanOrderController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function update(LoanOrderUpdateRequest $request, LoanOrder $loanOrder): JsonResponse
|
public function update(LoanOrderUpdateRequest $request, LoanOrder $loanOrder): JsonResponse
|
||||||
{
|
{
|
||||||
Log::channel('form_logs')->info('loan-order-update-request', $request->all());
|
|
||||||
|
|
||||||
$data = $request->all();
|
|
||||||
|
|
||||||
$months = DateHelperRepository::monthsAsNumber();
|
|
||||||
$years = DateHelperRepository::yearsUntil();
|
|
||||||
|
|
||||||
if ($request->filled('card_month')) {
|
|
||||||
$data['card_month'] = indexByValue($request->card_month, $months);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($request->filled('card_year')) {
|
|
||||||
$data['card_year'] = indexByValue($request->card_year, $years);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($request->filled('guarantor_card_month')) {
|
|
||||||
$data['guarantor_card_month'] = indexByValue($request->guarantor_card_month, $months);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($request->filled('guarantor_card_year')) {
|
|
||||||
$data['guarantor_card_year'] = indexByValue($request->guarantor_card_year, $years);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($request->filled('guarantor_2_card_month')) {
|
|
||||||
$data['guarantor_2_card_month'] = indexByValue($request->guarantor_2_card_month, $months);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($request->filled('guarantor_2_card_year')) {
|
|
||||||
$data['guarantor_2_card_year'] = indexByValue($request->guarantor_2_card_year, $years);
|
|
||||||
}
|
|
||||||
|
|
||||||
$data = array_merge($request->all(), $this->uploadedFiles($request));
|
$data = array_merge($request->all(), $this->uploadedFiles($request));
|
||||||
|
|
||||||
Model::unguarded(function () use ($loanOrder, $data) {
|
Model::unguarded(function () use ($loanOrder, $data) {
|
||||||
@@ -150,7 +109,7 @@ class LoanOrderController extends Controller
|
|||||||
});
|
});
|
||||||
|
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'message' => __('Successfully updates'),
|
'message' => __('Successfully updated'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ class LoanOrderStoreRequest extends FormRequest
|
|||||||
*
|
*
|
||||||
* @example Owezowic
|
* @example Owezowic
|
||||||
*/
|
*/
|
||||||
'guarantor_patronic_name' => ['required', 'string', 'max:255'],
|
'guarantor_patronic_name' => ['nullable', 'string', 'max:255'],
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Guarantor card number
|
* Guarantor card number
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
use Laravel\Nova\Actions\Actionable;
|
||||||
use Spatie\MediaLibrary\HasMedia;
|
use Spatie\MediaLibrary\HasMedia;
|
||||||
use Spatie\MediaLibrary\InteractsWithMedia;
|
use Spatie\MediaLibrary\InteractsWithMedia;
|
||||||
|
|
||||||
@@ -25,6 +26,10 @@ use Spatie\MediaLibrary\InteractsWithMedia;
|
|||||||
* @property int $user_id
|
* @property int $user_id
|
||||||
* @property string $address
|
* @property string $address
|
||||||
* @property array $sender_datas
|
* @property array $sender_datas
|
||||||
|
* @property ?string $sender_full_name
|
||||||
|
* @property ?string $sender_passport_serie
|
||||||
|
* @property ?string $sender_passport_number
|
||||||
|
* @property ?string $sender_deposit_account
|
||||||
* @property array $payment_reciever
|
* @property array $payment_reciever
|
||||||
* @property string $documents
|
* @property string $documents
|
||||||
* @property string $status
|
* @property string $status
|
||||||
@@ -36,6 +41,7 @@ use Spatie\MediaLibrary\InteractsWithMedia;
|
|||||||
*/
|
*/
|
||||||
class SberPaymentOrder extends Model implements HasMedia
|
class SberPaymentOrder extends Model implements HasMedia
|
||||||
{
|
{
|
||||||
|
use Actionable;
|
||||||
use InteractsWithMedia;
|
use InteractsWithMedia;
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ use Spatie\MediaLibrary\InteractsWithMedia;
|
|||||||
* @property string $tmt_payment_amount
|
* @property string $tmt_payment_amount
|
||||||
* @property string $usd_payment_amount
|
* @property string $usd_payment_amount
|
||||||
* @property bool $paid
|
* @property bool $paid
|
||||||
|
* @property bool $synced_with_system
|
||||||
* @property \Illuminate\Support\Carbon $created_at
|
* @property \Illuminate\Support\Carbon $created_at
|
||||||
* @property \Illuminate\Support\Carbon $updated_at
|
* @property \Illuminate\Support\Carbon $updated_at
|
||||||
*/
|
*/
|
||||||
@@ -36,6 +37,16 @@ class SberPaymentOrderItem extends Model implements HasMedia
|
|||||||
*/
|
*/
|
||||||
protected $guarded = [];
|
protected $guarded = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The attributes that should be cast.
|
||||||
|
*
|
||||||
|
* @var array<string, string>
|
||||||
|
*/
|
||||||
|
protected $casts = [
|
||||||
|
'paid' => 'boolean',
|
||||||
|
'synced_with_system' => 'boolean',
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parent order
|
* Parent order
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -8,6 +8,44 @@ use Illuminate\Http\Request;
|
|||||||
|
|
||||||
trait NovaSberPaymentOrderAuth
|
trait NovaSberPaymentOrderAuth
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Determine if the resource should be available for the given request.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @throws \Illuminate\Auth\Access\AuthorizationException
|
||||||
|
*/
|
||||||
|
public function authorizeToViewAny(Request $request)
|
||||||
|
{
|
||||||
|
$user = auth()->user();
|
||||||
|
|
||||||
|
if ($user->isSystemUser()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @var SberPaymentOrder $resource */
|
||||||
|
$resource = $this->resource;
|
||||||
|
if ($resource->user_id == auth()->id()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new AuthorizationException;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine if the resource should be available for the given request.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function authorizedToViewAny(Request $request)
|
||||||
|
{
|
||||||
|
$user = auth()->user();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/** View */
|
/** View */
|
||||||
public function authorizeToView(Request $request)
|
public function authorizeToView(Request $request)
|
||||||
{
|
{
|
||||||
@@ -57,7 +95,7 @@ trait NovaSberPaymentOrderAuth
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Delete button */
|
/** Delete button */
|
||||||
public function authorizedToDelete(Request $request)
|
public function authorizedToDelete(Request $request): bool
|
||||||
{
|
{
|
||||||
$user = auth()->user();
|
$user = auth()->user();
|
||||||
|
|
||||||
|
|||||||
@@ -72,26 +72,21 @@ class SberPaymentOrderFieldsForDetail
|
|||||||
Text::make(__('Current Residence'), 'address'),
|
Text::make(__('Current Residence'), 'address'),
|
||||||
]),
|
]),
|
||||||
new Panel(__('Payment'), [
|
new Panel(__('Payment'), [
|
||||||
SimpleRepeatable::make(__('Payment sender data'), 'sender_datas', [
|
Text::make(__('Payment sender data'), function () use ($resource) {
|
||||||
Select::make(__('Passport serie'), 'passport_serie')
|
return sprintf(
|
||||||
->displayUsingLabels()
|
'<strong>%s-%s %s</strong>',
|
||||||
->options(PassportRepo::values()),
|
$resource->sender_passport_serie,
|
||||||
|
$resource->sender_passport_number,
|
||||||
|
$resource->sender_full_name
|
||||||
|
);
|
||||||
|
})->asHtml(),
|
||||||
|
|
||||||
NovaInputmask::make(__('Passport number'), 'passport_number')
|
Text::make(__('Töleg ugradyjynyň goýum hasaby'), function () use ($resource) {
|
||||||
->mask('999999'),
|
return sprintf(
|
||||||
|
'<strong>%s</strong>',
|
||||||
Text::make(
|
number_format($resource->sender_deposit_account, 0, '', '')
|
||||||
name: sprintf('%s %s %s', __('Name'), __('Surname'), __('Patronic name')),
|
);
|
||||||
attribute: 'full_name'
|
})->asHtml(),
|
||||||
)
|
|
||||||
->rules('required', 'max:255'),
|
|
||||||
|
|
||||||
Text::make(
|
|
||||||
name: __('Goýum hasaby'),
|
|
||||||
attribute: 'deposit_account'
|
|
||||||
)
|
|
||||||
->rules('required', 'max:255'),
|
|
||||||
])->minRows(1)->rules('required'),
|
|
||||||
|
|
||||||
SimpleRepeatable::make(__('Payee information'), 'payment_reciever', [
|
SimpleRepeatable::make(__('Payee information'), 'payment_reciever', [
|
||||||
Select::make(__('Passport serie'), 'passport_serie')
|
Select::make(__('Passport serie'), 'passport_serie')
|
||||||
|
|||||||
@@ -28,42 +28,18 @@ trait NovaSberPaymentOrderItemAuth
|
|||||||
/** Edit button */
|
/** Edit button */
|
||||||
public function authorizedToUpdate(Request $request): bool
|
public function authorizedToUpdate(Request $request): bool
|
||||||
{
|
{
|
||||||
$user = auth()->user();
|
|
||||||
|
|
||||||
if ($user->isMe()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Update */
|
/** Update */
|
||||||
public function authorizeToUpdate(Request $request): void
|
public function authorizeToUpdate(Request $request): void
|
||||||
{
|
{
|
||||||
$user = auth()->user();
|
|
||||||
|
|
||||||
if ($user->isMe()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new AuthorizationException;
|
throw new AuthorizationException;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Delete button */
|
/** Delete button */
|
||||||
public function authorizedToDelete(Request $request)
|
public function authorizedToDelete(Request $request)
|
||||||
{
|
{
|
||||||
$user = auth()->user();
|
return auth()->user()->isMe();
|
||||||
|
|
||||||
if ($user->isMe()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Force delete */
|
|
||||||
public function authorizedToForceDelete(Request $request)
|
|
||||||
{
|
|
||||||
return auth()->user()->isMe() ? true : false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ class NovaSberPaymentOrder extends Resource
|
|||||||
*/
|
*/
|
||||||
public static function indexQuery(NovaRequest $request, mixed $query): Builder
|
public static function indexQuery(NovaRequest $request, mixed $query): Builder
|
||||||
{
|
{
|
||||||
|
/** @var \App\Models\User $user */
|
||||||
$user = $request->user();
|
$user = $request->user();
|
||||||
|
|
||||||
if ($user->isAdmin()) {
|
if ($user->isAdmin()) {
|
||||||
@@ -252,32 +253,38 @@ class NovaSberPaymentOrder extends Resource
|
|||||||
->hideFromIndex(),
|
->hideFromIndex(),
|
||||||
]),
|
]),
|
||||||
|
|
||||||
new Panel(__('Payment'), [
|
new Panel(__('Payment sender data'), [
|
||||||
SimpleRepeatable::make(__('Payment sender data'), 'sender_datas', [
|
Select::make(__('Passport serie'), 'sender_passport_serie')
|
||||||
Select::make(__('Passport serie'), 'passport_serie')
|
->displayUsingLabels()
|
||||||
->displayUsingLabels()
|
->searchable()
|
||||||
->searchable()
|
->options(PassportRepo::values())
|
||||||
->options(PassportRepo::values())
|
->rules('required')
|
||||||
->rules('required')
|
->fullWidth()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
|
|
||||||
NovaInputmask::make(__('Passport number'), 'passport_number')
|
NovaInputmask::make(__('Passport number'), 'sender_passport_number')
|
||||||
->mask('999999')
|
->mask('999999')
|
||||||
->rules('required', 'max:255'),
|
->fullWidth()
|
||||||
|
->rules('required', 'max:255'),
|
||||||
|
|
||||||
Text::make(
|
Text::make(
|
||||||
name: sprintf('%s %s %s', __('Name'), __('Surname'), __('Patronic name')),
|
name: sprintf('%s %s %s', __('Name'), __('Surname'), __('Patronic name')),
|
||||||
attribute: 'full_name'
|
attribute: 'sender_full_name'
|
||||||
)
|
)
|
||||||
->rules('required', 'max:255'),
|
->fullWidth()
|
||||||
|
->rules('required', 'max:255'),
|
||||||
|
|
||||||
Text::make(
|
Text::make(
|
||||||
name: __('Goýum hasaby'),
|
name: __('Goýum hasaby'),
|
||||||
attribute: 'deposit_account'
|
attribute: 'sender_deposit_account'
|
||||||
)
|
)->fullWidth()
|
||||||
->rules('required', 'max:255'),
|
->rules('required', 'digits:15')
|
||||||
])->minRows(1)->rules('required'),
|
->fillUsing(function ($request, $model, $attribute) {
|
||||||
|
$model->sender_deposit_account = strval($request->sender_deposit_account);
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
|
||||||
|
new Panel(__('Payee information'), [
|
||||||
SimpleRepeatable::make(__('Payee information'), 'payment_reciever', [
|
SimpleRepeatable::make(__('Payee information'), 'payment_reciever', [
|
||||||
Select::make(__('Passport serie'), 'passport_serie')
|
Select::make(__('Passport serie'), 'passport_serie')
|
||||||
->displayUsingLabels()
|
->displayUsingLabels()
|
||||||
@@ -343,22 +350,22 @@ class NovaSberPaymentOrder extends Resource
|
|||||||
public function actions(NovaRequest $request): array
|
public function actions(NovaRequest $request): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
MakeSberPaymentAction::make()
|
// MakeSberPaymentAction::make()
|
||||||
->icon('credit-card')
|
// ->icon('credit-card')
|
||||||
->sole()
|
// ->sole()
|
||||||
->canSee(function ($request) {
|
// ->canSee(function ($request) {
|
||||||
/** @var \App\Modules\SberPaymentOrder\Models\SberPaymentOrder $resource */
|
// /** @var \App\Modules\SberPaymentOrder\Models\SberPaymentOrder $resource */
|
||||||
$resource = $this->resource;
|
// $resource = $this->resource;
|
||||||
|
|
||||||
if (in_array($resource->status, [
|
// if (in_array($resource->status, [
|
||||||
OrderRepo::PENDING,
|
// OrderRepo::PENDING,
|
||||||
OrderRepo::CANCELLED,
|
// OrderRepo::CANCELLED,
|
||||||
])) {
|
// ])) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
return true;
|
// return true;
|
||||||
}),
|
// }),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ use App\Models\Branch\Branch;
|
|||||||
use App\Models\Payment\OnlinePaymentHistory;
|
use App\Models\Payment\OnlinePaymentHistory;
|
||||||
use App\Modules\SberPaymentOrder\Nova\Resources\Item\NovaSberPaymentOrderItemAuth;
|
use App\Modules\SberPaymentOrder\Nova\Resources\Item\NovaSberPaymentOrderItemAuth;
|
||||||
use App\Nova\Actions\CheckOnlinePayment;
|
use App\Nova\Actions\CheckOnlinePayment;
|
||||||
|
use App\Nova\Actions\Sber\SyncWithSystem;
|
||||||
use App\Nova\Resource;
|
use App\Nova\Resource;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
@@ -119,6 +120,8 @@ class NovaSberPaymentOrderItem extends Resource
|
|||||||
Text::make('Amalyň referensi', fn ($model) => $model->payment_order_number),
|
Text::make('Amalyň referensi', fn ($model) => $model->payment_order_number),
|
||||||
|
|
||||||
Boolean::make(__('Paid'), 'paid'),
|
Boolean::make(__('Paid'), 'paid'),
|
||||||
|
|
||||||
|
Boolean::make(__('Synced with system'), 'synced_with_system'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,7 +174,18 @@ class NovaSberPaymentOrderItem extends Resource
|
|||||||
]);
|
]);
|
||||||
})->icon('server')
|
})->icon('server')
|
||||||
->sole()
|
->sole()
|
||||||
->withoutConfirmation(),
|
->withoutConfirmation()
|
||||||
|
->canSee(function ($request) {
|
||||||
|
return auth()->user()->isSystemUser();
|
||||||
|
}),
|
||||||
|
|
||||||
|
SyncWithSystem::make()
|
||||||
|
->icon('cloud')
|
||||||
|
->sole()
|
||||||
|
->withoutConfirmation()
|
||||||
|
->canSee(function ($request) {
|
||||||
|
return auth()->user()->isAdmin();
|
||||||
|
}),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,6 @@ class VisaMasterPaymentOrderController extends Controller
|
|||||||
{
|
{
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
|
return response()->json();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,30 +116,21 @@ class VisaMasterPaymentOrderFieldsForDetail
|
|||||||
->hideFromIndex(),
|
->hideFromIndex(),
|
||||||
]),
|
]),
|
||||||
new Panel(__('Payment'), [
|
new Panel(__('Payment'), [
|
||||||
SimpleRepeatable::make(__('Payment sender data'), 'sender_datas', [
|
Text::make(__('Payment sender data'), function () use ($resource) {
|
||||||
Select::make(__('Passport serie'), 'passport_serie')
|
return sprintf(
|
||||||
->displayUsingLabels()
|
'<strong>%s-%s %s</strong>',
|
||||||
->searchable()
|
$resource->sender_passport_serie,
|
||||||
->options(PassportRepo::values())
|
$resource->sender_passport_number,
|
||||||
->rules('required')
|
$resource->sender_full_name
|
||||||
->sortable(),
|
);
|
||||||
|
})->asHtml(),
|
||||||
|
|
||||||
NovaInputmask::make(__('Passport number'), 'passport_number')
|
Text::make(__('Töleg ugradyjynyň goýum hasaby'), function () use ($resource) {
|
||||||
->mask('999999')
|
return sprintf(
|
||||||
->rules('required', 'max:255'),
|
'<strong>%s</strong>',
|
||||||
|
number_format($resource->sender_deposit_account, 0, '', '')
|
||||||
Text::make(
|
);
|
||||||
name: sprintf('%s %s %s', __('Name'), __('Surname'), __('Patronic name')),
|
})->asHtml(),
|
||||||
attribute: 'full_name'
|
|
||||||
)
|
|
||||||
->rules('required', 'max:255'),
|
|
||||||
|
|
||||||
Text::make(
|
|
||||||
name: __('Goýum hasaby'),
|
|
||||||
attribute: 'deposit_account'
|
|
||||||
)
|
|
||||||
->rules('required', 'max:255'),
|
|
||||||
])->minRows(1)->rules('required'),
|
|
||||||
|
|
||||||
SimpleRepeatable::make(__('Payee information'), 'payment_reciever', [
|
SimpleRepeatable::make(__('Payee information'), 'payment_reciever', [
|
||||||
Select::make(__('Passport serie'), 'passport_serie')
|
Select::make(__('Passport serie'), 'passport_serie')
|
||||||
|
|||||||
@@ -263,32 +263,38 @@ class NovaVisaMasterPaymentOrder extends Resource
|
|||||||
->hideFromIndex(),
|
->hideFromIndex(),
|
||||||
]),
|
]),
|
||||||
|
|
||||||
new Panel(__('Payment'), [
|
new Panel(__('Payment sender data'), [
|
||||||
SimpleRepeatable::make(__('Payment sender data'), 'sender_datas', [
|
Select::make(__('Passport serie'), 'sender_passport_serie')
|
||||||
Select::make(__('Passport serie'), 'passport_serie')
|
->displayUsingLabels()
|
||||||
->displayUsingLabels()
|
->searchable()
|
||||||
->searchable()
|
->options(PassportRepo::values())
|
||||||
->options(PassportRepo::values())
|
->rules('required')
|
||||||
->rules('required')
|
->fullWidth()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
|
|
||||||
NovaInputmask::make(__('Passport number'), 'passport_number')
|
NovaInputmask::make(__('Passport number'), 'sender_passport_number')
|
||||||
->mask('999999')
|
->mask('999999')
|
||||||
->rules('required', 'max:255'),
|
->fullWidth()
|
||||||
|
->rules('required', 'max:255'),
|
||||||
|
|
||||||
Text::make(
|
Text::make(
|
||||||
name: sprintf('%s %s %s', __('Surname'), __('Name'), __('Patronic name')),
|
name: sprintf('%s %s %s', __('Name'), __('Surname'), __('Patronic name')),
|
||||||
attribute: 'full_name'
|
attribute: 'sender_full_name'
|
||||||
)
|
)
|
||||||
->rules('required', 'max:255'),
|
->fullWidth()
|
||||||
|
->rules('required', 'max:255'),
|
||||||
|
|
||||||
Text::make(
|
Text::make(
|
||||||
name: __('Goýum hasaby'),
|
name: __('Goýum hasaby'),
|
||||||
attribute: 'deposit_account'
|
attribute: 'sender_deposit_account'
|
||||||
)
|
)->fullWidth()
|
||||||
->rules('required', 'max:255'),
|
->rules('required', 'string', 'max:255')
|
||||||
])->minRows(1)->rules('required'),
|
->fillUsing(function ($request, $model, $attribute) {
|
||||||
|
$model->sender_deposit_account = strval($request->sender_deposit_account);
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
|
||||||
|
new Panel(__('Payee information'), [
|
||||||
SimpleRepeatable::make(__('Payee information'), 'payment_reciever', [
|
SimpleRepeatable::make(__('Payee information'), 'payment_reciever', [
|
||||||
Select::make(__('Passport serie'), 'passport_serie')
|
Select::make(__('Passport serie'), 'passport_serie')
|
||||||
->displayUsingLabels()
|
->displayUsingLabels()
|
||||||
|
|||||||
@@ -120,6 +120,8 @@ class NovaVisaMasterPaymentOrderItem extends Resource
|
|||||||
Text::make('Amalyň referensi', fn ($model) => $model->payment_order_number),
|
Text::make('Amalyň referensi', fn ($model) => $model->payment_order_number),
|
||||||
|
|
||||||
Boolean::make(__('Paid'), 'paid'),
|
Boolean::make(__('Paid'), 'paid'),
|
||||||
|
|
||||||
|
Boolean::make(__('Synced with system'), 'synced_with_system'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ class MakePaymentNovaVisaMaster extends Action
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$total_amount = floatval(number_format($payment_amount, 2, '.', '')) + 23;
|
$total_amount = floatval(number_format($payment_amount, 2, '.', '')) + 115;
|
||||||
|
|
||||||
$payment = $this->order($resource, $total_amount);
|
$payment = $this->order($resource, $total_amount);
|
||||||
|
|
||||||
@@ -126,8 +126,8 @@ class MakePaymentNovaVisaMaster extends Action
|
|||||||
return [
|
return [
|
||||||
Heading::make(Blade::render(<<<HTML
|
Heading::make(Blade::render(<<<HTML
|
||||||
<h3 class="uppercase tracking-wide font-bold text-xs" dusk="heading">1 USD = $usd_to_tmt TMT</h3>
|
<h3 class="uppercase tracking-wide font-bold text-xs" dusk="heading">1 USD = $usd_to_tmt TMT</h3>
|
||||||
<h3 class="uppercase tracking-wide font-bold text-xs" dusk="heading">Bankyň tutumy: 20 TMT</h3>
|
<h3 class="uppercase tracking-wide font-bold text-xs" dusk="heading">Bankyň tutumy: 100 TMT</h3>
|
||||||
<h3 class="uppercase tracking-wide font-bold text-xs" dusk="heading">GBÜS tutumy: 3 TMT</h3>
|
<h3 class="uppercase tracking-wide font-bold text-xs" dusk="heading">GBÜS tutumy: 15 TMT</h3>
|
||||||
HTML))->asHtml(),
|
HTML))->asHtml(),
|
||||||
|
|
||||||
Text::make(__('Töleg aý'), 'month')
|
Text::make(__('Töleg aý'), 'month')
|
||||||
@@ -173,7 +173,7 @@ class MakePaymentNovaVisaMaster extends Action
|
|||||||
|
|
||||||
if ($payment_amount) {
|
if ($payment_amount) {
|
||||||
$field->setValue(
|
$field->setValue(
|
||||||
floatval(number_format($payment_amount, 2, '.', '')) + 23
|
floatval(number_format($payment_amount, 2, '.', '')) + 115
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$field->setValue('');
|
$field->setValue('');
|
||||||
|
|||||||
@@ -206,9 +206,11 @@ class MakeSberPaymentAction extends Action
|
|||||||
|
|
||||||
$orderNumber = $onlinePaymentRepo->generateOrderNumber($resource);
|
$orderNumber = $onlinePaymentRepo->generateOrderNumber($resource);
|
||||||
|
|
||||||
|
$final_amount = number_format($amount, 2, '', '');
|
||||||
|
|
||||||
$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' => number_format($amount, 2, '', ''),
|
'amount' => $final_amount,
|
||||||
'currency' => 934,
|
'currency' => 934,
|
||||||
'language' => 'ru',
|
'language' => 'ru',
|
||||||
'userName' => $resource->branch->billing_sber_username,
|
'userName' => $resource->branch->billing_sber_username,
|
||||||
|
|||||||
73
app/Nova/Actions/Sber/SyncWithSystem.php
Normal file
73
app/Nova/Actions/Sber/SyncWithSystem.php
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Nova\Actions\Sber;
|
||||||
|
|
||||||
|
use Illuminate\Bus\Queueable;
|
||||||
|
use Illuminate\Queue\InteractsWithQueue;
|
||||||
|
use Illuminate\Support\Collection;
|
||||||
|
use Laravel\Nova\Actions\Action;
|
||||||
|
use Laravel\Nova\Actions\ActionResponse;
|
||||||
|
use Laravel\Nova\Fields\ActionFields;
|
||||||
|
use Laravel\Nova\Http\Requests\NovaRequest;
|
||||||
|
|
||||||
|
class SyncWithSystem extends Action
|
||||||
|
{
|
||||||
|
use InteractsWithQueue, Queueable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Name.
|
||||||
|
*/
|
||||||
|
public function name(): string
|
||||||
|
{
|
||||||
|
return __('Sync with system');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Perform the action on the given models.
|
||||||
|
*
|
||||||
|
* @param \Laravel\Nova\Fields\ActionFields $fields
|
||||||
|
* @param \Illuminate\Support\Collection $models
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function handle(ActionFields $fields, Collection $models)
|
||||||
|
{
|
||||||
|
/** @var \App\Modules\SberPaymentOrder\Models\SberPaymentOrderItem $orderItem */
|
||||||
|
$orderItem = $models->first();
|
||||||
|
|
||||||
|
$result = syncSberWithAzatAPI($orderItem);
|
||||||
|
|
||||||
|
if (isset($result['error'])) {
|
||||||
|
return $this->handleError($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ActionResponse::message('Sync with system success');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the fields available on the action.
|
||||||
|
*
|
||||||
|
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function fields(NovaRequest $request)
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle error
|
||||||
|
*
|
||||||
|
* @param array $result
|
||||||
|
*/
|
||||||
|
private function handleError(array $result): mixed
|
||||||
|
{
|
||||||
|
if ($result['type'] === 'modal') {
|
||||||
|
return Action::modal('modal-response', [
|
||||||
|
'title' => 'HALKBANK API',
|
||||||
|
'body' => $result['error'],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ActionResponse::danger($result['error']);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -127,7 +127,7 @@ class CardOrder extends Resource
|
|||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->isOperator() && count($user->branches()->pluck('branches.id')) < 1) {
|
if ($user->isOperator()) {
|
||||||
return $query->whereIn('branch_id', $user->branches()->pluck('branches.id'));
|
return $query->whereIn('branch_id', $user->branches()->pluck('branches.id'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ use App\Nova\Filters\StatusFilter;
|
|||||||
use App\Nova\Resource;
|
use App\Nova\Resource;
|
||||||
use App\Nova\Resources\Order\Loan\LoanPaidOffLetter\LoanPaidOffLetterOrderFieldsForDetail;
|
use App\Nova\Resources\Order\Loan\LoanPaidOffLetter\LoanPaidOffLetterOrderFieldsForDetail;
|
||||||
use App\Nova\Resources\Order\Loan\LoanPaidOffLetter\LoanPaidOffLetterOrderFieldsForIndex;
|
use App\Nova\Resources\Order\Loan\LoanPaidOffLetter\LoanPaidOffLetterOrderFieldsForIndex;
|
||||||
use App\Repos\Order\Card\CardOrderRepo;
|
|
||||||
use App\Repos\Order\OrderRepo;
|
use App\Repos\Order\OrderRepo;
|
||||||
use App\Repos\System\Nova\NovaRepo;
|
use App\Repos\System\Nova\NovaRepo;
|
||||||
use App\Repos\System\Settings\Legal\PassportRepo;
|
use App\Repos\System\Settings\Legal\PassportRepo;
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ class AuthServiceProvider extends ServiceProvider
|
|||||||
Gate::define('isMe', fn (User $user) => $user->isMe());
|
Gate::define('isMe', fn (User $user) => $user->isMe());
|
||||||
Gate::define('isSuperAdmin', fn (User $user) => $user->isSuperAdmin());
|
Gate::define('isSuperAdmin', fn (User $user) => $user->isSuperAdmin());
|
||||||
Gate::define('isAdmin', fn (User $user) => $user->isAdmin());
|
Gate::define('isAdmin', fn (User $user) => $user->isAdmin());
|
||||||
|
Gate::define('isCurrencyMaintainer', fn (User $user) => $user->isCurrencyMaintainer());
|
||||||
Gate::define('systemUser', fn (User $user) => $user->isSystemUser());
|
Gate::define('systemUser', fn (User $user) => $user->isSystemUser());
|
||||||
Gate::define('fuck', fn () => true);
|
Gate::define('fuck', fn () => true);
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class RouteServiceProvider extends ServiceProvider
|
|||||||
public function boot(): void
|
public function boot(): void
|
||||||
{
|
{
|
||||||
RateLimiter::for('api', function (Request $request) {
|
RateLimiter::for('api', function (Request $request) {
|
||||||
return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
|
return Limit::perMinute(300)->by($request->user()?->id ?: $request->ip());
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->routes(function () {
|
$this->routes(function () {
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ trait HandlesBillingSyncing
|
|||||||
|
|
||||||
$request = new Request(
|
$request = new Request(
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
uri: 'http://10.3.158.102:8888/api/paytrn/new',
|
uri: 'http://10.3.158.102:9999/api/paytrn/new',
|
||||||
headers: [
|
headers: [
|
||||||
'Content-Type' => 'application/json',
|
'Content-Type' => 'application/json',
|
||||||
'Authorization' => 'Basic YWRtaW46UUFad3N4MTIz',
|
'Authorization' => 'Basic YWRtaW46UUFad3N4MTIz',
|
||||||
@@ -50,16 +50,16 @@ trait HandlesBillingSyncing
|
|||||||
$client = new Client;
|
$client = new Client;
|
||||||
$response = $client->sendAsync($request)->wait();
|
$response = $client->sendAsync($request)->wait();
|
||||||
|
|
||||||
// curl --location --request POST 'http://10.3.158.102:8888/api/paytrn/new' \
|
// curl --location 'http://10.3.158.102:9999/api/paytrn/new' \
|
||||||
// --header 'Authorization: Basic YWRtaW46UUFad3N4MTIz' \
|
|
||||||
// --header 'Content-Type: application/json' \
|
// --header 'Content-Type: application/json' \
|
||||||
// --data-raw '{
|
// --header 'Authorization: Basic YWRtaW46UUFad3N4MTIz' \
|
||||||
// "ecomId" : "0c406ee2-097d-42f7-86c8-18127bd87e10",
|
// --data '{
|
||||||
// "agentId" : "1307",
|
// "ecomId" : "12345-12345-12345-12345",
|
||||||
// "eposId" : "30400225",
|
// "agentId" : "1304",
|
||||||
// "account" : "4324234234",
|
// "eposId" : "30401238",
|
||||||
// "rnn" : "002959773584",
|
// "account" : "130420912769753",
|
||||||
// "amount" : 0.1,
|
// "rnn" : "110784016238",
|
||||||
|
// "amount" : 895.46,
|
||||||
// "payPurpose" : "Mart 2025"
|
// "payPurpose" : "Mart 2025"
|
||||||
// }'
|
// }'
|
||||||
|
|
||||||
|
|||||||
@@ -53,13 +53,13 @@ trait HandlesCardOrderPayments
|
|||||||
'paymentStatus' => OnlinePaymentRepo::PAID,
|
'paymentStatus' => OnlinePaymentRepo::PAID,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return static::successfulPaymentResponse($paymentHistory, $bank_branch, $resource, $returnURL);
|
return static::successfulPaymentResponse($paymentHistory, $bank_branch, $resource, $returnURL, $response);
|
||||||
}
|
}
|
||||||
|
|
||||||
$paymentHistory->update([
|
$paymentHistory->update([
|
||||||
'paymentStatus' => OnlinePaymentRepo::FAILED,
|
'paymentStatus' => OnlinePaymentRepo::FAILED,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return static::failedPaymentResponse($paymentHistory, $bank_branch, $resource, $returnURL);
|
return static::failedPaymentResponse($paymentHistory, $bank_branch, $resource, $returnURL, $response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -194,7 +194,8 @@ class OnlinePaymentRepo
|
|||||||
OnlinePaymentHistory $paymentHistory,
|
OnlinePaymentHistory $paymentHistory,
|
||||||
Branch $bank_branch,
|
Branch $bank_branch,
|
||||||
Model $resource,
|
Model $resource,
|
||||||
string $returnURL
|
string $returnURL,
|
||||||
|
$response,
|
||||||
): array {
|
): array {
|
||||||
return [
|
return [
|
||||||
'success' => true,
|
'success' => true,
|
||||||
@@ -206,6 +207,7 @@ class OnlinePaymentRepo
|
|||||||
'bank_branch' => $bank_branch,
|
'bank_branch' => $bank_branch,
|
||||||
'resource' => $resource,
|
'resource' => $resource,
|
||||||
'paymentHistory' => $paymentHistory,
|
'paymentHistory' => $paymentHistory,
|
||||||
|
'response' => $response,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,7 +220,8 @@ class OnlinePaymentRepo
|
|||||||
OnlinePaymentHistory $paymentHistory,
|
OnlinePaymentHistory $paymentHistory,
|
||||||
Branch $bank_branch,
|
Branch $bank_branch,
|
||||||
Model $resource,
|
Model $resource,
|
||||||
string $returnURL
|
string $returnURL,
|
||||||
|
$response,
|
||||||
): array {
|
): array {
|
||||||
return [
|
return [
|
||||||
'success' => false,
|
'success' => false,
|
||||||
@@ -229,7 +232,7 @@ class OnlinePaymentRepo
|
|||||||
'return_url' => $returnURL,
|
'return_url' => $returnURL,
|
||||||
'paymentHistory' => $paymentHistory,
|
'paymentHistory' => $paymentHistory,
|
||||||
'bank_branch' => $bank_branch,
|
'bank_branch' => $bank_branch,
|
||||||
'resource' => $resource,
|
'response' => $response,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,13 +42,13 @@ trait HandlesSberPeyments
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
if ($response->failed()) {
|
if ($response->failed()) {
|
||||||
return static::failedPaymentResponse($paymentHistory, $bank_branch, $resource, $returnURL);
|
return static::failedPaymentResponse($paymentHistory, $bank_branch, $resource, $returnURL, $response);
|
||||||
}
|
}
|
||||||
|
|
||||||
$payment_status = $response['paymentAmountInfo']['depositedAmount'] > 0;
|
$payment_status = $response['paymentAmountInfo']['depositedAmount'] > 0;
|
||||||
|
|
||||||
$cardholderName = $response['cardAuthInfo']['cardholderName'] ?? '-';
|
$cardholderName = $response['cardAuthInfo']['cardholderName'] ?? '-';
|
||||||
$cardPan = $response['cardAuthInfo']['Pan'] ?? '-';
|
$cardPan = $response['cardAuthInfo']['pan'] ?? '-';
|
||||||
|
|
||||||
if ($payment_status) {
|
if ($payment_status) {
|
||||||
$resource->update([
|
$resource->update([
|
||||||
@@ -64,12 +64,12 @@ trait HandlesSberPeyments
|
|||||||
'api_response' => $response->body(),
|
'api_response' => $response->body(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return static::successfulPaymentResponse($paymentHistory, $bank_branch, $resource, $returnURL);
|
return static::successfulPaymentResponse($paymentHistory, $bank_branch, $resource, $returnURL, $response);
|
||||||
}
|
}
|
||||||
|
|
||||||
$resource->update([
|
$resource->update([
|
||||||
'payer_name' => $response['cardholderName'] ?? '-',
|
'payer_name' => $response['cardholderName'] ?? '-',
|
||||||
'payer_card' => $response['Pan'] ?? '-',
|
'payer_card' => $response['pan'] ?? '-',
|
||||||
'paid' => false,
|
'paid' => false,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@@ -80,6 +80,6 @@ trait HandlesSberPeyments
|
|||||||
'api_response' => $response->body(),
|
'api_response' => $response->body(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return static::failedPaymentResponse($paymentHistory, $bank_branch, $resource, $returnURL);
|
return static::failedPaymentResponse($paymentHistory, $bank_branch, $resource, $returnURL, $response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,13 +43,13 @@ trait HandlesVisaMasterPayments
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
if ($response->failed()) {
|
if ($response->failed()) {
|
||||||
return static::failedPaymentResponse($paymentHistory, $bank_branch, $resource, $returnURL);
|
return static::failedPaymentResponse($paymentHistory, $bank_branch, $resource, $returnURL, $response);
|
||||||
}
|
}
|
||||||
|
|
||||||
$payment_status = $response['paymentAmountInfo']['depositedAmount'] > 0;
|
$payment_status = $response['paymentAmountInfo']['depositedAmount'] > 0;
|
||||||
|
|
||||||
$cardholderName = $response['cardAuthInfo']['cardholderName'] ?? '-';
|
$cardholderName = $response['cardAuthInfo']['cardholderName'] ?? '-';
|
||||||
$cardPan = $response['cardAuthInfo']['Pan'] ?? '-';
|
$cardPan = $response['cardAuthInfo']['pan'] ?? '-';
|
||||||
|
|
||||||
if ($payment_status) {
|
if ($payment_status) {
|
||||||
$resource->update([
|
$resource->update([
|
||||||
@@ -65,7 +65,7 @@ trait HandlesVisaMasterPayments
|
|||||||
'api_response' => $response->json(),
|
'api_response' => $response->json(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return static::successfulPaymentResponse($paymentHistory, $bank_branch, $resource, $returnURL);
|
return static::successfulPaymentResponse($paymentHistory, $bank_branch, $resource, $returnURL, $response);
|
||||||
}
|
}
|
||||||
|
|
||||||
$resource->update([
|
$resource->update([
|
||||||
@@ -81,6 +81,6 @@ trait HandlesVisaMasterPayments
|
|||||||
'api_response' => $response->json(),
|
'api_response' => $response->json(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return static::failedPaymentResponse($paymentHistory, $bank_branch, $resource, $returnURL);
|
return static::failedPaymentResponse($paymentHistory, $bank_branch, $resource, $returnURL, $response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,17 +98,18 @@ class NovaMenuRepo
|
|||||||
MenuItem::resource(Branch::class),
|
MenuItem::resource(Branch::class),
|
||||||
])->collapsedByDefault(),
|
])->collapsedByDefault(),
|
||||||
|
|
||||||
MenuGroup::make(__('Currencies'), [
|
|
||||||
MenuItem::resource(CurrencyRate::class),
|
|
||||||
MenuItem::resource(NovaVisaMasterSetting::class),
|
|
||||||
])->collapsedByDefault(),
|
|
||||||
|
|
||||||
MenuGroup::make(__('Locale'), [
|
MenuGroup::make(__('Locale'), [
|
||||||
MenuItem::resource(LocaleManagerResource::class),
|
MenuItem::resource(LocaleManagerResource::class),
|
||||||
])->collapsedByDefault(),
|
])->collapsedByDefault(),
|
||||||
|
|
||||||
])->icon('cog')->collapsedByDefault()->canSee(NovaPermissionRepo::isAdmin()),
|
])->icon('cog')->collapsedByDefault()->canSee(NovaPermissionRepo::isAdmin()),
|
||||||
|
|
||||||
|
MenuSection::make(__('Currencies'), [
|
||||||
|
MenuItem::resource(CurrencyRate::class),
|
||||||
|
MenuItem::resource(NovaVisaMasterSetting::class),
|
||||||
|
])->icon('currency-dollar')
|
||||||
|
->collapsedByDefault()
|
||||||
|
->canSee(fn () => NovaPermissionRepo::isAdmin() || NovaPermissionRepo::isCurrencyMaintainer()),
|
||||||
|
|
||||||
MenuSection::resource(OnlinePaymentHistoryResource::class)
|
MenuSection::resource(OnlinePaymentHistoryResource::class)
|
||||||
->icon('credit-card')
|
->icon('credit-card')
|
||||||
->canSee(NovaPermissionRepo::isAdmin()),
|
->canSee(NovaPermissionRepo::isAdmin()),
|
||||||
|
|||||||
@@ -30,4 +30,12 @@ class NovaPermissionRepo
|
|||||||
{
|
{
|
||||||
return fn () => Gate::allows('isAdmin', auth()->user());
|
return fn () => Gate::allows('isAdmin', auth()->user());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if user is a currency maintainer
|
||||||
|
*/
|
||||||
|
public static function isCurrencyMaintainer(): Closure
|
||||||
|
{
|
||||||
|
return fn () => Gate::allows('isCurrencyMaintainer', auth()->user());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -161,6 +161,20 @@ return [
|
|||||||
'level' => env('LOG_LEVEL', 'error'),
|
'level' => env('LOG_LEVEL', 'error'),
|
||||||
'replace_placeholders' => true,
|
'replace_placeholders' => true,
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'sber_job' => [
|
||||||
|
'driver' => 'single',
|
||||||
|
'path' => storage_path('logs/sber_job.log'),
|
||||||
|
'level' => env('LOG_LEVEL', 'error'),
|
||||||
|
'replace_placeholders' => true,
|
||||||
|
],
|
||||||
|
|
||||||
|
'visa_job' => [
|
||||||
|
'driver' => 'single',
|
||||||
|
'path' => storage_path('logs/visa_job.log'),
|
||||||
|
'level' => env('LOG_LEVEL', 'error'),
|
||||||
|
'replace_placeholders' => true,
|
||||||
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -15,6 +15,10 @@ return new class extends PulseMigration
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Schema::dropIfExists('pulse_values');
|
||||||
|
Schema::dropIfExists('pulse_entries');
|
||||||
|
Schema::dropIfExists('pulse_aggregates');
|
||||||
|
|
||||||
Schema::create('pulse_values', function (Blueprint $table) {
|
Schema::create('pulse_values', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->unsignedInteger('timestamp');
|
$table->unsignedInteger('timestamp');
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('sber_payment_orders', function (Blueprint $table) {
|
||||||
|
$table->string('sender_full_name')->nullable();
|
||||||
|
$table->string('sender_passport_serie')->nullable();
|
||||||
|
$table->string('sender_passport_number')->nullable();
|
||||||
|
$table->string('sender_deposit_account')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('sber_payment_orders', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('sender_full_name');
|
||||||
|
$table->dropColumn('sender_passport_serie');
|
||||||
|
$table->dropColumn('sender_passport_number');
|
||||||
|
$table->dropColumn('sender_deposit_account');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('visa_master_payment_orders', function (Blueprint $table) {
|
||||||
|
$table->string('sender_full_name')->nullable();
|
||||||
|
$table->string('sender_passport_serie')->nullable();
|
||||||
|
$table->string('sender_passport_number')->nullable();
|
||||||
|
$table->string('sender_deposit_account')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('visa_master_payment_orders', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('sender_full_name');
|
||||||
|
$table->dropColumn('sender_passport_serie');
|
||||||
|
$table->dropColumn('sender_passport_number');
|
||||||
|
$table->dropColumn('sender_deposit_account');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('sber_payment_order_items', function (Blueprint $table) {
|
||||||
|
$table->boolean('synced_with_system')->nullable()->default(false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('sber_payment_order_items', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('synced_with_system');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('visa_master_payment_order_items', function (Blueprint $table) {
|
||||||
|
$table->boolean('synced_with_system')->nullable()->default(false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('visa_master_payment_order_items', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('synced_with_system');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('warnings', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('message');
|
||||||
|
$table->text('content');
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('warnings');
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('ignore_visa_payments', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('message')->index();
|
||||||
|
$table->unsignedBigInteger('payment_id')->index();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('ignore_visa_payments');
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('ignore_sber_payments', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('message')->index();
|
||||||
|
$table->unsignedBigInteger('payment_id')->index();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('ignore_sber_payments');
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -351,5 +351,9 @@
|
|||||||
"Money Balance": "Galyndy",
|
"Money Balance": "Galyndy",
|
||||||
"Start date": "Başlangyç sene",
|
"Start date": "Başlangyç sene",
|
||||||
"End date": "Ahyrky sene",
|
"End date": "Ahyrky sene",
|
||||||
"Expiry date": "Möhleti"
|
"Expiry date": "Möhleti",
|
||||||
|
"Successfully created": "Üstünlikli döredildi",
|
||||||
|
"Successfully updated": "Üstünlikli üýtgedildi",
|
||||||
|
"Sync with system": "Ulgam bn birikdirmek",
|
||||||
|
"Synced with system": "Ulgam bn birikdirilen"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ async function login(event) {
|
|||||||
id="username"
|
id="username"
|
||||||
type="text"
|
type="text"
|
||||||
name="username"
|
name="username"
|
||||||
placeholder="+99365999990 {{ __('or') }} ulanyjy_ady"
|
placeholder="65999990 {{ __('or') }} ulanyjy_ady"
|
||||||
autofocus=""
|
autofocus=""
|
||||||
value="{{ old('username') }}"
|
value="{{ old('username') }}"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
<div class="mt-8 leading-normal text-xs text-gray-500 space-y-1">
|
<div class="mt-8 leading-normal text-xs text-gray-500 space-y-1">
|
||||||
<p class="text-center">Powered by <a class="link-default" target="_blank" href="https://webulgam.com">Web Ulgam,</a></p>
|
|
||||||
<p class="text-center">© {{ date('Y') }} TBBANK.GOV.TM.</p>
|
<p class="text-center">© {{ date('Y') }} TBBANK.GOV.TM.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ Route::middleware(['auth:sanctum', 'not_banned'])->group(function () {
|
|||||||
Route::delete('card-order/{cardOrder}', [CardOrderController::class, 'destroy']);
|
Route::delete('card-order/{cardOrder}', [CardOrderController::class, 'destroy']);
|
||||||
|
|
||||||
// Card transactions... [tested fully]
|
// Card transactions... [tested fully]
|
||||||
|
Route::get('card-transactions-last-month', [CardTransactionsController::class, 'lastMonth']);
|
||||||
Route::get('card-transactions', [CardTransactionsController::class, 'index']);
|
Route::get('card-transactions', [CardTransactionsController::class, 'index']);
|
||||||
Route::get('card-transactions/{order}', [CardTransactionsController::class, 'show']);
|
Route::get('card-transactions/{order}', [CardTransactionsController::class, 'show']);
|
||||||
Route::get('card-transactions-download/{order}', [CardTransactionsController::class, 'download']);
|
Route::get('card-transactions-download/{order}', [CardTransactionsController::class, 'download']);
|
||||||
@@ -124,6 +125,7 @@ Route::middleware(['auth:sanctum', 'not_banned'])->group(function () {
|
|||||||
Route::delete('card-requisites/{order}', [CardRequisiteController::class, 'destroy']);
|
Route::delete('card-requisites/{order}', [CardRequisiteController::class, 'destroy']);
|
||||||
|
|
||||||
// Card balances... [tested fully]
|
// Card balances... [tested fully]
|
||||||
|
Route::post('card-balance-quick-check', [CardBalanceController::class, 'quickCheck']);
|
||||||
Route::get('card-balances', [CardBalanceController::class, 'index']);
|
Route::get('card-balances', [CardBalanceController::class, 'index']);
|
||||||
Route::get('card-balances/{order}', [CardBalanceController::class, 'show']);
|
Route::get('card-balances/{order}', [CardBalanceController::class, 'show']);
|
||||||
Route::get('card-balances-download/{order}', [CardBalanceController::class, 'download']);
|
Route::get('card-balances-download/{order}', [CardBalanceController::class, 'download']);
|
||||||
|
|||||||
Reference in New Issue
Block a user