File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717 <language >en_US</language >
1818 <language >fr_FR</language >
1919 </languages >
20- <version >2.0.2 </version >
20+ <version >2.0.3 </version >
2121 <authors >
2222 <author >
2323 <name >Vincent Lopes-Vicente</name >
Original file line number Diff line number Diff line change 2222use Thelia \Core \HttpFoundation \JsonResponse ;
2323use Thelia \Core \Template \TemplateDefinition ;
2424use Thelia \Install \Database ;
25+ use Thelia \Log \Tlog ;
2526use Thelia \Model \Order ;
2627use Thelia \Module \AbstractPaymentModule ;
2728use Thelia \Tools \URL ;
@@ -64,9 +65,15 @@ public function isValidPayment()
6465 return false ;
6566 }
6667
67- /** @var PaymentService $paymentService */
68- $ paymentService = $ this ->container ->get ('payplugmodule_payment_service ' );
69- return $ paymentService ->isPayPlugAvailable ();
68+ try {
69+ /** @var PaymentService $paymentService */
70+ $ paymentService = $ this ->container ->get ('payplugmodule_payment_service ' );
71+
72+ return $ paymentService ->isPayPlugAvailable ();
73+ } catch (\Exception $ e ) {
74+ Tlog::getInstance ()->addError ("Error during Payplug validation check : " .$ e ->getMessage ());
75+ return false ;
76+ }
7077 }
7178
7279 /**
Original file line number Diff line number Diff line change @@ -142,6 +142,10 @@ public function getNotificationResource(Request $request)
142142
143143 public function initAuth ()
144144 {
145+ if (null === PayPlugConfigValue::getApiKey ()) {
146+ throw new \Exception ("PayPlug API key is not set " );
147+ }
148+
145149 return Payplug::init (
146150 [
147151 'secretKey ' => PayPlugConfigValue::getApiKey (),
You can’t perform that action at this time.
0 commit comments