First, Alarm notification
In order to inform merchant abnormal, improve the service quality of the micro-trust platform. Micro-letter background will be pushed to the merchant alarm notice, including delivery delay, call failure, notification failure, etc., the address of the notice is the merchant in the application for payment when the alarm notification URL, in the "Public platform-service-service center-merchant Function-Merchant basic information-alarm notification URL" can be viewed. When the merchant receives the warning notice, it needs to fix the problems mentioned in it as soon as possible so as not to affect the online operation.
The alert notification URL receives a postdata containing XML data in the following format:
<xml>
<appid><![ cdata[wxf8b4f85f3a794e77]]></appid>
<ErrorType>1001</ErrorType>
<description ><! [cdata[false Description]]></description>
<alarmcontent><![ cdata[Error Details]]></alarmcontent>
<TimeStamp>1393860740</TimeStamp>
<appsignature ><! [cdata[f8164781a303f4d5a944a2dfc68411a8c7e4fbea]]></appsignature>
<signmethod><![ Cdata[sha1]]></signmethod>
</xml>
Second, the procedure receives
In the micro-credit payment development (1) micro-letter Payment URL configuration has been mentioned, set the alarm notification URL for
http://www.doucube.com/wxpay/alarm.php
Now is the implementation of the alarm.php function, modeled after the micro-letter Basic Interface SDK access. Write details to a database or other storage
$POSTSTR = $GLOBALS ["Http_raw_post_data"];
$POSTOBJ = simplexml_load_string ($postStr, ' simplexmlelement ', libxml_nocdata);
Logger ("Error type:". $POSTOBJ->errortype. " Wrong description: ". $POSTOBJ->description." Error details: ". $POSTOBJ->alarmcontent);
Log record
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);
}
The above is to micro-letter payment development alarm Notification data collation, micro-credit payment development friends can refer to, thank you support!