stan errors fixed

This commit is contained in:
2025-03-16 01:34:49 +05:00
parent 821ec1fe47
commit 0b47fe694c
7 changed files with 131 additions and 51 deletions

View File

@@ -4,43 +4,46 @@ namespace App\Repos\Payment\Billing;
trait HandlesBillingSyncing
{
public static function syncWithBilling()
{
$curl = curl_init();
/**
* Sync with billing
*/
// public static function syncWithBilling(): bool|string
// {
// $curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'http://10.3.158.102:8888/api/paytrn/new',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => sprintf(
'{
"ecomId" : "%s",
"agentId" : "%s",
"eposId" : "30401238",
"account" : "130420912769753",
"rnn" : "110784016238",
"amount" : 895.46,
"payPurpose" : "Mart 2025"
}',
// $uuid,
// $bankCode,
// curl_setopt_array($curl, [
// CURLOPT_URL => 'http://10.3.158.102:8888/api/paytrn/new',
// CURLOPT_RETURNTRANSFER => true,
// CURLOPT_ENCODING => '',
// CURLOPT_MAXREDIRS => 10,
// CURLOPT_TIMEOUT => 0,
// CURLOPT_FOLLOWLOCATION => true,
// CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
// CURLOPT_CUSTOMREQUEST => 'POST',
// CURLOPT_POSTFIELDS => sprintf(
// '{
// "ecomId" : "%s",
// "agentId" : "%s",
// "eposId" : "30401238",
// "account" : "130420912769753",
// "rnn" : "110784016238",
// "amount" : 895.46,
// "payPurpose" : "Mart 2025"
// }',
// // $uuid,
// // $bankCode,
),
CURLOPT_HTTPHEADER => [
'Authorization: Basic YWRtaW46UUFad3N4MTIz',
'Content-Type: application/json',
],
]);
// ),
// CURLOPT_HTTPHEADER => [
// 'Authorization: Basic YWRtaW46UUFad3N4MTIz',
// 'Content-Type: application/json',
// ],
// ]);
$response = curl_exec($curl);
// $response = curl_exec($curl);
curl_close($curl);
// curl_close($curl);
return $response;
}
// return $response;
// }
}

View File

@@ -2,11 +2,13 @@
namespace App\Repos\Payment;
use App\Models\Branch\Branch;
use App\Models\Payment\OnlinePaymentHistory;
use App\Repos\Payment\Billing\HandlesBillingSyncing;
use App\Repos\Payment\Card\HandlesCardOrderPayments;
use App\Repos\Payment\Sber\HandlesSberPeyments;
use App\Repos\Payment\VisaMaster\HandlesVisaMasterPayments;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
@@ -38,7 +40,7 @@ class OnlinePaymentRepo
/**
* Status Values
*
* @return array<string, string>
* @return array<null|string, string>
*/
public static function statusValues(): array
{
@@ -187,8 +189,12 @@ class OnlinePaymentRepo
*
* @return array<string, bool|string>
*/
public static function successfulPaymentResponse($paymentHistory, $bank_branch, $resource, $returnURL): array
{
public static function successfulPaymentResponse(
OnlinePaymentHistory $paymentHistory,
Branch $bank_branch,
Model $resource,
string $returnURL
): array {
return [
'success' => true,
'title' => __('Payment is successful'),
@@ -201,9 +207,15 @@ class OnlinePaymentRepo
/**
* Failed payment response
*
* @return array<string, bool|string>
*/
public static function failedPaymentResponse($paymentHistory, $bank_branch, $resource, $returnURL)
{
public static function failedPaymentResponse(
OnlinePaymentHistory $paymentHistory,
Branch $bank_branch,
Model $resource,
string $returnURL
): array {
return [
'success' => false,
'title' => __('Payment has failed'),
@@ -216,6 +228,8 @@ class OnlinePaymentRepo
/**
* Resource not found
*
* @return array<string, string|bool>
*/
protected static function resourceNotFound(): array
{