From 52368c1ff75d0b1f0c29fc5c0d7aabf8861c82e9 Mon Sep 17 00:00:00 2001 From: nafezly Date: Sun, 12 Mar 2023 03:55:04 +0200 Subject: [PATCH] updates --- src/Classes/FawryPayment.php | 2 +- src/Classes/HyperPayPayment.php | 2 +- src/Classes/KashierPayment.php | 2 +- src/Classes/OpayPayment.php | 2 +- src/Classes/PayPalPayment.php | 2 +- src/Classes/PaymobPayment.php | 2 +- src/Classes/PaymobWalletPayment.php | 2 +- src/Classes/PaytabsPayment.php | 6 +++--- src/Classes/TapPayment.php | 2 +- src/Classes/ThawaniPayment.php | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Classes/FawryPayment.php b/src/Classes/FawryPayment.php index 5357bf7..0e0a0b7 100644 --- a/src/Classes/FawryPayment.php +++ b/src/Classes/FawryPayment.php @@ -43,7 +43,7 @@ public function pay($amount = null, $user_id = null, $user_first_name = null, $u { $this->setPassedVariablesToGlobal($amount,$user_id,$user_first_name,$user_last_name,$user_email,$user_phone,$source); $required_fields = ['amount', 'user_id', 'user_first_name', 'user_last_name', 'user_email', 'user_phone']; - $this->checkRequiredFields($required_fields, 'FAWRY', func_get_args()); + $this->checkRequiredFields($required_fields, 'FAWRY'); $unique_id = uniqid(); diff --git a/src/Classes/HyperPayPayment.php b/src/Classes/HyperPayPayment.php index 6c96af6..7f52fe8 100644 --- a/src/Classes/HyperPayPayment.php +++ b/src/Classes/HyperPayPayment.php @@ -49,7 +49,7 @@ public function pay($amount = null, $user_id = null, $user_first_name = null, $u { $this->setPassedVariablesToGlobal($amount,$user_id,$user_first_name,$user_last_name,$user_email,$user_phone,$source); $required_fields = ['amount', 'user_first_name', 'user_last_name', 'user_email', 'user_phone']; - $this->checkRequiredFields($required_fields, 'HYPERPAY', func_get_args()); + $this->checkRequiredFields($required_fields, 'HYPERPAY'); $data = http_build_query([ 'entityId' => $this->getEntityId($this->source), diff --git a/src/Classes/KashierPayment.php b/src/Classes/KashierPayment.php index 2fd9a5a..78664aa 100644 --- a/src/Classes/KashierPayment.php +++ b/src/Classes/KashierPayment.php @@ -44,7 +44,7 @@ public function pay($amount = null, $user_id = null, $user_first_name = null, $u { $this->setPassedVariablesToGlobal($amount,$user_id,$user_first_name,$user_last_name,$user_email,$user_phone,$source); $required_fields = ['amount']; - $this->checkRequiredFields($required_fields, 'KASHIER', func_get_args()); + $this->checkRequiredFields($required_fields, 'KASHIER'); $payment_id = uniqid(); diff --git a/src/Classes/OpayPayment.php b/src/Classes/OpayPayment.php index 357ea0e..d0e8a3b 100644 --- a/src/Classes/OpayPayment.php +++ b/src/Classes/OpayPayment.php @@ -49,7 +49,7 @@ public function pay($amount = null, $user_id = null, $user_first_name = null, $u { $this->setPassedVariablesToGlobal($amount,$user_id,$user_first_name,$user_last_name,$user_email,$user_phone,$source); $required_fields = ['amount', 'user_first_name', 'user_last_name', 'user_email', 'user_phone']; - $this->checkRequiredFields($required_fields, 'OPAY', func_get_args()); + $this->checkRequiredFields($required_fields, 'OPAY'); $unique_id=uniqid(); $response = Http::withHeaders([ diff --git a/src/Classes/PayPalPayment.php b/src/Classes/PayPalPayment.php index 4b8d83c..d983665 100644 --- a/src/Classes/PayPalPayment.php +++ b/src/Classes/PayPalPayment.php @@ -48,7 +48,7 @@ public function pay($amount = null, $user_id = null, $user_first_name = null, $u { $this->setPassedVariablesToGlobal($amount,$user_id,$user_first_name,$user_last_name,$user_email,$user_phone,$source); $required_fields = ['amount']; - $this->checkRequiredFields($required_fields, 'PayPal', func_get_args()); + $this->checkRequiredFields($required_fields, 'PayPal'); if($this->paypal_mode=="live") $environment = new ProductionEnvironment($this->paypal_client_id, $this->paypal_secret); diff --git a/src/Classes/PaymobPayment.php b/src/Classes/PaymobPayment.php index a3e396f..32dcb9c 100644 --- a/src/Classes/PaymobPayment.php +++ b/src/Classes/PaymobPayment.php @@ -38,7 +38,7 @@ public function pay($amount = null, $user_id = null, $user_first_name = null, $u { $this->setPassedVariablesToGlobal($amount,$user_id,$user_first_name,$user_last_name,$user_email,$user_phone,$source); $required_fields = ['amount', 'user_first_name', 'user_last_name', 'user_email', 'user_phone']; - $this->checkRequiredFields($required_fields, 'PayMob', func_get_args()); + $this->checkRequiredFields($required_fields, 'PayMob'); $request_new_token = Http::withHeaders(['content-type' => 'application/json']) ->post('https://accept.paymobsolutions.com/api/auth/tokens', [ diff --git a/src/Classes/PaymobWalletPayment.php b/src/Classes/PaymobWalletPayment.php index 3aa7717..c631c44 100644 --- a/src/Classes/PaymobWalletPayment.php +++ b/src/Classes/PaymobWalletPayment.php @@ -35,7 +35,7 @@ public function pay($amount = null, $user_id = null, $user_first_name = null, $u { $this->setPassedVariablesToGlobal($amount,$user_id,$user_first_name,$user_last_name,$user_email,$user_phone,$source); $required_fields = ['amount', 'user_first_name', 'user_last_name', 'user_email', 'user_phone']; - $this->checkRequiredFields($required_fields, 'PayMob', func_get_args()); + $this->checkRequiredFields($required_fields, 'PayMob'); $request_new_token = Http::withHeaders(['content-type' => 'application/json']) ->post('https://accept.paymobsolutions.com/api/auth/tokens', [ diff --git a/src/Classes/PaytabsPayment.php b/src/Classes/PaytabsPayment.php index cf4c1ab..24c5f59 100644 --- a/src/Classes/PaytabsPayment.php +++ b/src/Classes/PaytabsPayment.php @@ -51,7 +51,7 @@ public function pay( { $this->setPassedVariablesToGlobal($amount,$user_id,$user_first_name,$user_last_name,$user_email,$user_phone,$source); $required_fields = ['amount']; - $this->checkRequiredFields($required_fields, 'PayTabs', func_get_args()); + $this->checkRequiredFields($required_fields, 'PayTabs'); $unique_id = uniqid(); $response = Http::withHeaders([ @@ -100,8 +100,8 @@ public function pay( public function verify(Request $request): array { - $payment_id = $request->payment_id!=null?$request->payment_id:Cache::get($request['payment_id']); - Cache::forget($request['payment_id']); + $payment_id = $request->tranRef!=null?$request->tranRef:Cache::get($request['tranRef']); + Cache::forget($request['tranRef']); $response = Http::withHeaders([ 'Authorization' => $this->paytabs_server_key, diff --git a/src/Classes/TapPayment.php b/src/Classes/TapPayment.php index 2ba5049..e517f99 100644 --- a/src/Classes/TapPayment.php +++ b/src/Classes/TapPayment.php @@ -46,7 +46,7 @@ public function pay($amount = null, $user_id = null, $user_first_name = null, $u $required_fields = ['amount', 'user_first_name', 'user_last_name', 'user_email', 'user_phone']; - $this->checkRequiredFields($required_fields, 'Tap', func_get_args()); + $this->checkRequiredFields($required_fields, 'Tap'); $unique_id = uniqid(); $response = Http::withHeaders([ diff --git a/src/Classes/ThawaniPayment.php b/src/Classes/ThawaniPayment.php index 5a95fb4..001a21b 100644 --- a/src/Classes/ThawaniPayment.php +++ b/src/Classes/ThawaniPayment.php @@ -42,7 +42,7 @@ public function pay($amount = null, $user_id = null, $user_first_name = null, $u { $this->setPassedVariablesToGlobal($amount,$user_id,$user_first_name,$user_last_name,$user_email,$user_phone,$source); $required_fields = ['amount', 'user_first_name', 'user_last_name', 'user_email', 'user_phone']; - $this->checkRequiredFields($required_fields, 'Thawani', func_get_args()); + $this->checkRequiredFields($required_fields, 'Thawani'); $unique_id = uniqid(); $response = Http::withHeaders([ 'Content-Type' => "application/json",