This commit is contained in:
2024-11-25 19:32:51 +05:00
parent 7259cdcb26
commit 9d77e50191
11 changed files with 557 additions and 77 deletions

View File

@@ -4,6 +4,7 @@ namespace App\Repos\Payment;
use App\Models\Branch\Branch;
use App\Models\Payment\OnlinePaymentHistory;
use App\Repos\Payment\Sber\HandlesSberPeyments;
use App\Repos\Payment\VisaMaster\HandlesVisaMasterPayments;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;
@@ -13,6 +14,7 @@ use Laravel\Nova\Makeable;
class OnlinePaymentRepo
{
use HandlesVisaMasterPayments;
use HandlesSberPeyments;
use Makeable;
/**
@@ -182,7 +184,7 @@ class OnlinePaymentRepo
*
* @return array<string, bool|string>
*/
public static function successfulPaymentResponse($paymentHistory, $bank_branch, $resource): array
public static function successfulPaymentResponse($paymentHistory, $bank_branch, $resource, $returnURL): array
{
return [
'success' => true,
@@ -190,7 +192,7 @@ class OnlinePaymentRepo
'pnr' => $paymentHistory->orderNumber,
'branch_name' => $bank_branch->name,
'price_amount' => convertToOriginalFormat($paymentHistory->amount).' TMT',
'return_url' => url('/work-place/resources/nova-visa-master-payment-orders/'.$resource->visa_master_payment_order_id),
'return_url' => $returnURL,
];
}
@@ -201,7 +203,7 @@ class OnlinePaymentRepo
* @param $bank_branch
* @param $resource
*/
public static function failedPaymentResponse($paymentHistory, $bank_branch, $resource)
public static function failedPaymentResponse($paymentHistory, $bank_branch, $resource, $returnURL)
{
return [
'success' => false,
@@ -209,7 +211,7 @@ class OnlinePaymentRepo
'pnr' => $paymentHistory->orderNumber,
'branch_name' => $bank_branch->name,
'price_amount' => convertToOriginalFormat($paymentHistory->amount).' TMT',
'return_url' => url('/work-place/resources/nova-visa-master-payment-orders/'.$resource->visa_master_payment_order_id),
'return_url' => $returnURL,
];
}