国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Home WeChat Applet WeChat Development WeChat payment development alarm notification

WeChat payment development alarm notification

Feb 24, 2017 pm 05:07 PM

This article introduces how to obtain alarm notifications in WeChat payment.

1. Alarm notification

In order to promptly notify merchants of abnormalities and improve merchants’ service quality on the WeChat platform. The WeChat backend will push alarm notifications to merchants, including delivery delays, call failures, notification failures, etc. The notification address is the alarm notification URL filled in by the merchant when applying for payment, which can be found in "Public Platform - Service - Service Center - Merchant Functions - Merchant Basic Information - Alarm Notification URL" can be viewed. After receiving the alarm notification, merchants need to repair the problems mentioned in it 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:

<xml>
    <AppId><![CDATA[wxf8b4f85f3a794e77]]></AppId>
    <ErrorType>1001</ErrorType>
    <Description><![CDATA[錯識描述]]></Description>
    <AlarmContent><![CDATA[錯誤詳情]]></AlarmContent>
    <TimeStamp>1393860740</TimeStamp>
    <AppSignature><![CDATA[f8164781a303f4d5a944a2dfc68411a8c7e4fbea]]></AppSignature>
    <SignMethod><![CDATA[sha1]]></SignMethod>
</xml>

2. Program reception

Developed in WeChat payment (1) WeChat payment URL configuration As mentioned in, the alarm notification url is set to

http://www.doucube.com/wxpay/alarm.php

Now is the alarm.php function has been implemented, just imitate the WeChat basic interface SDK to obtain it. Write detailed information to the database or other storage

$postStr = $GLOBALS["HTTP_RAW_POST_DATA"];
$postObj = simplexml_load_string($postStr, &#39;SimpleXMLElement&#39;, LIBXML_NOCDATA);
logger("錯誤類型:".$postObj->ErrorType."錯識描述:".$postObj->Description."錯誤詳情:".$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(&#39;H:i:s&#39;)." ".$log_content."\r\n", FILE_APPEND);
}

For more WeChat payment development and alarm notification related articles, please pay attention to the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)