diff --git a/app/Http/Controllers/OnlinePaymentController.php b/app/Http/Controllers/OnlinePaymentController.php index 971845b..2afc5e4 100644 --- a/app/Http/Controllers/OnlinePaymentController.php +++ b/app/Http/Controllers/OnlinePaymentController.php @@ -5,6 +5,7 @@ namespace App\Http\Controllers; use App\Http\Requests\OnlinePaymentStoreRequest; use App\Models\Payment\OnlinePaymentHistory; use App\Repos\Payment\OnlinePaymentRepo; +use GuzzleHttp\Psr7\Request; use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Log; @@ -72,6 +73,7 @@ class OnlinePaymentController extends Controller public function visaMaster(OnlinePaymentStoreRequest $request) { $data = OnlinePaymentRepo::checkPaymentVisaMaster($request); + OnlinePaymentRepo::syncWithBilling(); return view(OnlinePaymentRepo::statusView(), $data); } diff --git a/app/Repos/Payment/Billing/HandlesBillingSyncing.php b/app/Repos/Payment/Billing/HandlesBillingSyncing.php new file mode 100644 index 0000000..24a0e86 --- /dev/null +++ b/app/Repos/Payment/Billing/HandlesBillingSyncing.php @@ -0,0 +1,40 @@ + '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 =>'{ + "ecomId" : "12345-12345-12345-12345", + "agentId" : "1304", + "eposId" : "30401238", + "account" : "130420912769753", + "rnn" : "110784016238", + "amount" : 895.46, + "payPurpose" : "Mart 2025" +}', + CURLOPT_HTTPHEADER => array( + 'Authorization: Basic YWRtaW46UUFad3N4MTIz', + 'Content-Type: application/json' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +return $response; + } +} diff --git a/app/Repos/Payment/OnlinePaymentRepo.php b/app/Repos/Payment/OnlinePaymentRepo.php index 828deeb..d0d04cc 100644 --- a/app/Repos/Payment/OnlinePaymentRepo.php +++ b/app/Repos/Payment/OnlinePaymentRepo.php @@ -3,6 +3,7 @@ namespace App\Repos\Payment; use App\Models\Payment\OnlinePaymentHistory; +use App\Repos\Payment\Billing\HandlesBillingSyncing; use App\Repos\Payment\Sber\HandlesSberPeyments; use App\Repos\Payment\VisaMaster\HandlesVisaMasterPayments; use Illuminate\Http\Request; @@ -14,6 +15,7 @@ class OnlinePaymentRepo { use HandlesSberPeyments; use HandlesVisaMasterPayments; + use HandlesBillingSyncing; use Makeable; /**