@@ -241,10 +241,12 @@ public function process_payment($order_id)
241241
242242 if (!$ method ) {
243243 wc_add_notice (__ ('Unsupported payment method ' , 'wc-gateway-paylane ' ), 'error ' );
244+ WCPL_Logger::log ("[process_payment] \nUnsupported payment method \norder_id: " .$ order_id ,'error ' );
244245 return array ('success ' => false );
245246 }
246247
247248 if (!$ this ->validate_fields ()) {
249+ WCPL_Logger::log ("[process_payment] \nNOT valid fields \norder_id: " .$ order_id ,'error ' );
248250 return array ('success ' => false );
249251 }
250252
@@ -276,6 +278,7 @@ public function process_payment($order_id)
276278
277279 if (is_null ($ payload ) || !$ this ->isCorrectpayload ($ payload )) {
278280 wc_add_notice (__ ('Incorrect Apple Pay payload ' , 'wc-gateway-paylane ' ), 'error ' );
281+ WCPL_Logger::log ("[process_payment] \nIncorrect Apple Pay payload \norder_id: " .$ order_id ,'error ' );
279282 return array ('success ' => false );
280283 }
281284
@@ -362,6 +365,7 @@ public function process_payment($order_id)
362365 }
363366
364367 $ this ->set_order_paylane_type ($ order_id , $ method );
368+ WCPL_Logger::log ("[process_payment] \nWoocommerce process finished \norder_id: " .$ order_id ."\ntype: " .$ method );
365369 return array (
366370 'result ' => 'success ' ,
367371 'redirect ' => add_query_arg (array ('order_id ' => $ order_id , 'type ' => $ method ), $ this ->notify_link ),
@@ -448,6 +452,7 @@ public function handle_notification($data, $token, $communication_id)
448452 $ this ->checkBasicAuth ();
449453 }
450454 if (empty ($ _POST ['communication_id ' ])) {
455+ WCPL_Logger::log ("[handle_notification] \nEmpty communication id " ,'error ' );
451456 die ('Empty communication id ' );
452457 }
453458
@@ -472,22 +477,27 @@ private function parseNotification($notification, $order)
472477
473478 if ($ notification ['type ' ] === 'S ' ) {
474479 $ order ->add_order_note ('PayLane: ' . __ ('Transaction complete ' , 'wc-gateway-paylane ' ));
480+ WCPL_Logger::log ("[handle_notification] \nTransaction complete \nsale_id: " .$ id_sale );
475481 }
476482
477483 if ($ notification ['type ' ] === 'R ' ) {
478484 $ order ->add_order_note ('PayLane: ' . __ ('Refund complete ' , 'wc-gateway-paylane ' ));
485+ WCPL_Logger::log ("[handle_notification] \nRefund complete \nsale_id: " .$ id_sale );
479486 }
480487
481488 if ($ notification ['type ' ] === 'RV ' ) {
482489 $ order ->update_status ('on-hold ' , __ ('Reversal received ' , 'wc-gateway-paylane ' ));
490+ WCPL_Logger::log ("[handle_notification] \nReversal received \nsale_id: " .$ id_sale );
483491 }
484492
485493 if ($ notification ['type ' ] === 'RRO ' ) {
486494 $ order ->update_status ('on-hold ' , __ ('Retrieval request / chargeback opened ' , 'wc-gateway-paylane ' ));
495+ WCPL_Logger::log ("[handle_notification] \nRetrieval request / chargeback opened (RRO) \nsale_id: " .$ id_sale );
487496 }
488497
489498 if ($ notification ['type ' ] === 'CAD ' ) {
490499 $ order ->update_status ('on-hold ' , __ ('Retrieval request / chargeback opened ' , 'wc-gateway-paylane ' ));
500+ WCPL_Logger::log ("[handle_notification] \nRetrieval request / chargeback opened (CAD) \nsale_id: " .$ id_sale );
491501 }
492502
493503 update_post_meta ($ order ->get_id (), 'paylane-notification-timestamp ' , time ());
0 commit comments