In order to promptly notify merchants of exceptions and improve the service quality of sellers on the platform. The background will push an alarm notification to the merchant, including delivery delay, call failure, and notification failure. the notification address is the alarm notification URL filled in by the merchant when applying for payment, go to "public platform-service-Service Center-merchant function-merchant basic info-alarm notification URL. After receiving the alarm notification, the merchant must fix the problems mentioned in the issue as soon as possible to avoid affecting online operations. This topic describes how to receive alarm notifications during payment.
I. Alarm Notification
In order to promptly notify merchants of exceptions and improve the service quality of sellers on the platform. The background will push an alarm notification to the merchant, including delivery delay, call failure, and notification failure. the notification address is the alarm notification URL filled in by the merchant when applying for payment, go to "public platform-service-Service Center-merchant function-merchant basic info-alarm notification URL. After receiving the alarm notification, the merchant must fix the problems mentioned in the issue as soon as possible to avoid affecting online operations.
The postData received by the alarm notification URL will also contain xml data in the following format:
wxf8b4f85f3a794e77
1001
错识描述
错误详情
1393860740
f8164781a303f4d5a944a2dfc68411a8c7e4fbea
sha1
II. program reception
As mentioned in payment development (1) payment URL configuration, the alarm notification url is set
Http://www.doucube.com/wxpay/alarm.php
Now the implementation of the alarm. php function can be obtained just like the basic interface SDK. Write detailed information to the database or other storage
$ PostStr = $ GLOBALS ["HTTP_RAW_POST_DATA"]; $ postObj = simplexml_load_string ($ postStr, 'simplexmlelement ', LIBXML_NOCDATA); logger ("error type :". $ postObj-> ErrorType. "Error description :". $ postObj-> Description. "Error details :". $ postObj-> AlarmContent); // function logger ($ log_content) {$ max_size = 100000; $ log_filename = "log. xml "; if (file_exists ($ log_filename) and (abs (filesize ($ log_filename) >$ max_size) {unlink ($ log_filename);} file_put_contents ($ log_filename, date ('H: I: s '). "". $ log_content. "\ r \ n", FILE_APPEND );}
For more information about alert notifications for payment development, see PHP!