Skip to content

Commit

Permalink
checking the libs if exists, before making payment
Browse files Browse the repository at this point in the history
  • Loading branch information
MitanOmar committed Jan 28, 2020
1 parent a07bd7f commit bd1977e
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -1869,16 +1869,16 @@
'title' => $olang['KJP_PAYPAL_PRMS_EMPTY_TITLE'],
'msg' => $olang['KJP_PAYPAL_PRMS_EMPTY']
];
}

if (! file_exists(dirname(__FILE__) . '/vendor/autoload.php'))
{
$ADM_NOTIFICATIONS[] = [
'id' => 'NoPaypalLib',
'msg_type'=> 'error',
'title' => $olang['KJP_PAYPAL_NO_LIB_TITLE'],
'msg' => $olang['KJP_PAYPAL_NO_LIB']
];
}
if (in_array('paypal', $payment_methods) && ! file_exists(dirname(__FILE__) . '/vendor/autoload.php'))
{
$ADM_NOTIFICATIONS[] = [
'id' => 'NoPaypalLib',
'msg_type'=> 'error',
'title' => $olang['KJP_PAYPAL_NO_LIB_TITLE'],
'msg' => $olang['KJP_PAYPAL_NO_LIB']
];
}

// check if Stripe method is ready to use or not
Expand All @@ -1890,16 +1890,16 @@
'title' => $olang['KJP_STRIPE_PRMS_EMPTY_TITLE'],
'msg' => $olang['KJP_STRIPE_PRMS_EMPTY']
];
}

if (! file_exists(dirname(__FILE__) . '/stripe-sdk/vendor/autoload.php'))
{
$ADM_NOTIFICATIONS[] = [
'id' => 'NoStripeLib',
'msg_type'=> 'error',
'title' => $olang['KJP_STRIPE_NO_LIB_TITLE'],
'msg' => $olang['KJP_STRIPE_NO_LIB']
];
}
if (in_array('cards', $payment_methods) && ! file_exists(dirname(__FILE__) . '/stripe-sdk/vendor/autoload.php'))
{
$ADM_NOTIFICATIONS[] = [
'id' => 'NoStripeLib',
'msg_type'=> 'error',
'title' => $olang['KJP_STRIPE_NO_LIB_TITLE'],
'msg' => $olang['KJP_STRIPE_NO_LIB']
];
}

return compact('ADM_NOTIFICATIONS');
Expand Down

0 comments on commit bd1977e

Please sign in to comment.