Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
NafezlyDotCom committed Mar 12, 2023
1 parent 37c2337 commit 52368c1
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Classes/FawryPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src/Classes/HyperPayPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion src/Classes/KashierPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src/Classes/OpayPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
2 changes: 1 addition & 1 deletion src/Classes/PayPalPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Classes/PaymobPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', [
Expand Down
2 changes: 1 addition & 1 deletion src/Classes/PaymobWalletPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', [
Expand Down
6 changes: 3 additions & 3 deletions src/Classes/PaytabsPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/Classes/TapPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
2 changes: 1 addition & 1 deletion src/Classes/ThawaniPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 52368c1

Please sign in to comment.