From 17609f9058c1aea9c42db84416fcd4224180f7a0 Mon Sep 17 00:00:00 2001 From: sameh doush <48515888+samehdoush@users.noreply.github.com> Date: Thu, 11 May 2023 20:55:03 +0300 Subject: [PATCH 1/3] add payment parameter on paytabs --- src/Classes/PaytabsPayment.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Classes/PaytabsPayment.php b/src/Classes/PaytabsPayment.php index 24c5f59..455ee07 100644 --- a/src/Classes/PaytabsPayment.php +++ b/src/Classes/PaytabsPayment.php @@ -67,8 +67,8 @@ public function pay( "hide_shipping" => true, "cart_description" => "items", "paypage_lang" => $this->paytabs_checkout_lang, - "callback" => route($this->verify_route_name,['payment_id'=>$unique_id]), //Post end point -the payment status will be sent to server - "return" => route($this->verify_route_name,['payment_id'=>$unique_id]), //Get end point - The link to which the user will be redirected + "callback" => route($this->verify_route_name,['payment_id'=>$unique_id,'payment' => "paytabs"]), //Post end point -the payment status will be sent to server + "return" => route($this->verify_route_name,['payment_id'=>$unique_id,'payment' => "paytabs"]), //Get end point - The link to which the user will be redirected "customer_ref" => $unique_id, "customer_details" => [ "name" => $this->user_first_name . ' ' . $this->user_last_name, From c93489bacb2e3b3bf7dbe9266f576cb90dd7ca36 Mon Sep 17 00:00:00 2001 From: sameh doush <48515888+samehdoush@users.noreply.github.com> Date: Thu, 11 May 2023 22:12:04 +0300 Subject: [PATCH 2/3] fix verify PaytabsPayment --- src/Classes/PaytabsPayment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Classes/PaytabsPayment.php b/src/Classes/PaytabsPayment.php index 455ee07..f7de08c 100644 --- a/src/Classes/PaytabsPayment.php +++ b/src/Classes/PaytabsPayment.php @@ -100,7 +100,7 @@ public function pay( public function verify(Request $request): array { - $payment_id = $request->tranRef!=null?$request->tranRef:Cache::get($request['tranRef']); + $payment_id = $request->tranRef!=null?$request->tranRef:Cache::get($request->payment_id); Cache::forget($request['tranRef']); $response = Http::withHeaders([ From aa5c1f3657f0c43ffc3fc802693fd5653dfe1921 Mon Sep 17 00:00:00 2001 From: sameh doush <48515888+samehdoush@users.noreply.github.com> Date: Thu, 11 May 2023 22:23:29 +0300 Subject: [PATCH 3/3] Update PaytabsPayment.php --- src/Classes/PaytabsPayment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Classes/PaytabsPayment.php b/src/Classes/PaytabsPayment.php index f7de08c..455ee07 100644 --- a/src/Classes/PaytabsPayment.php +++ b/src/Classes/PaytabsPayment.php @@ -100,7 +100,7 @@ public function pay( public function verify(Request $request): array { - $payment_id = $request->tranRef!=null?$request->tranRef:Cache::get($request->payment_id); + $payment_id = $request->tranRef!=null?$request->tranRef:Cache::get($request['tranRef']); Cache::forget($request['tranRef']); $response = Http::withHeaders([