diff --git a/plugins/cipf_plugin/cipf_plugin.php b/plugins/cipf_plugin/cipf_plugin.php index 2455e35..f8a8dde 100644 --- a/plugins/cipf_plugin/cipf_plugin.php +++ b/plugins/cipf_plugin/cipf_plugin.php @@ -4,7 +4,7 @@ Plugin Name: hggg_cipf Plugin URI: Description: Author: hugogogo -Version: 0.5.3 +Version: 0.5.4 Author URI: */ @@ -180,6 +180,16 @@ contactez la fipf directement", 'confirmation_subject'=>"[CIPF - paiement echoué]", 'confirmation_message'=>"votre paiement a echoué", ], + 'payment_problem'=>[ + 'name'=>'prof - le paiement a rencontré un problem', + 'notification_send'=>true, + 'notification_to'=>'$$__admin_email__$$', + 'notification_subject'=>"[CIPF /prof - paiement probleme]", + 'notification_message'=>'probleme de paiement pour $$user_login$$ : $$__author_page_url__$$', + 'confirmation_send'=>false, + 'confirmation_subject'=>"[CIPF - paiement problème]", + 'confirmation_message'=>"votre paiement a rencontré un probleme", + ], 'transfert_success'=>[ 'name'=>'prof - le virement a été validé', 'notification_send'=>true, diff --git a/plugins/cipf_plugin/php/paypal/route_api_orders_capture.php b/plugins/cipf_plugin/php/paypal/route_api_orders_capture.php index 8953755..3e70a1f 100644 --- a/plugins/cipf_plugin/php/paypal/route_api_orders_capture.php +++ b/plugins/cipf_plugin/php/paypal/route_api_orders_capture.php @@ -43,10 +43,12 @@ function handle_orders_capture_request_CIPF($request) { catch (HttpException $error) { $status_code = $error->getStatusCode(); $message = array('ERROR_TREATMENT'=>true, 'message'=>'Failed to handle order after capture in server: ' . $error->getMessage()); + send_emails_CIPF('payment_problem'); return new WP_REST_Response($message, $status_code); } catch (Exception $error) { $message = array('ERROR_TREATMENT'=>true, 'message'=>'Failed to handle order after capture in server: ' . $error->getMessage()); + send_emails_CIPF('payment_problem'); return new WP_REST_Response($message, 500); } diff --git a/plugins/cipf_plugin/php/paypal/update_user_payment.php b/plugins/cipf_plugin/php/paypal/update_user_payment.php index b2c6fcf..f52d7fe 100644 --- a/plugins/cipf_plugin/php/paypal/update_user_payment.php +++ b/plugins/cipf_plugin/php/paypal/update_user_payment.php @@ -30,6 +30,7 @@ if (!defined('ABSPATH')) { * */ + /* * * @@ -180,7 +181,6 @@ function success_payment_for_user_CIPF($user_id, $order_id) { - /* * @return mixed num - user_id * bool false - if no match found