WeChat Pay Development Rights Protection Notice

高洛峰
Release: 2017-02-25 17:25:46
Original
1896 people have browsed it

1. Rights Protection Notification URL

As mentioned in WeChat Payment Development (1) WeChat Payment URL Configuration, the rights protection notification URL is http://www.doucube.com/wxpay/rights.php

2. User Rights Protection System Interface

When users have abnormal payment and purchase behavior on the official account, they usually complain to Tencent customer service, so WeChat needs to know the official account in real time No details of user transactions. At the same time, in order to solve users' problems as quickly and efficiently as possible, WeChat, as a bridge connecting users and merchants, will instantly synchronize problems to merchants through this customer service system and feedback the solution results to users.

After the user adds a complaint form, the WeChat background will notify (post) the merchant server (payfeedback_url) of the payment result. Merchants can use the notification results of payfeedback_url to display personalized pages. Note: Please submit payfeedback_url to the relevant interface person on WeChat. It will be available after registration on WeChat side.

Background notification is carried out through payfeedback_url in the request, using the post mechanism.

3. User application for rights protection

WeChat Pay Development Rights Protection NoticeWeChat Pay Development Rights Protection Notice

WeChat Pay Development Rights Protection NoticeWeChat Pay Development Rights Protection Notice

##4. Procedure Implementation

Directly obtain the xml data package mentioned in the rights protection program file. The program implementation is as follows:

<?php

$postStr = $GLOBALS["HTTP_RAW_POST_DATA"];
logger($postStr);
//日志记录
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);
}
?>
Copy after login

When the user adds a new complaint, the XML is obtained as follows

<xml>
    <OpenId><![CDATA[o0pk9uIVnlY-fJkzFKEbQ6LJ4cFc]]></OpenId>
    <AppId><![CDATA[wxc04ce1d87dcd13cd]]></AppId>
    <TimeStamp>1401206434</TimeStamp>
    <MsgType><![CDATA[request]]></MsgType>
    <FeedBackId>13275936403980775178</FeedBackId>
    <TransId><![CDATA[1218614901201405273313470595]]></TransId>
    <Reason><![CDATA[没有收到货品]]></Reason>
    <Solution><![CDATA[退款,并不退货]]></Solution>
    <ExtInfo><![CDATA[Test 13456780012]]></ExtInfo>
    <AppSignature><![CDATA[1f4a626f59f9ae8007158b0a9510e88db56fa80b]]></AppSignature>
    <SignMethod><![CDATA[sha1]]></SignMethod>
</xml>
Copy after login

User After confirming that the complaint has been processed, the developer will then parse the xml data and perform subsequent processing.

For more articles related to WeChat payment development rights protection notice, please pay attention to the PHP Chinese website!

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template