WeChat payment Development alert notification

Source: Internet
Author: User
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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.