Home>Article>Backend Development> PHP code for processing WeChat payment callbacks to change order payment status

PHP code for processing WeChat payment callbacks to change order payment status

不言
不言 Original
2018-08-04 14:12:05 6868browse

The content this article brings to you is about the PHP server APP WeChat payment callback verification signature to change the order payment status. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

  "; //如果操作失败 return "fail"; } } /* * 格式化参数格式化成url参数 生成签名sign */ function appgetSign($Obj,$appwxpay_key) { foreach ($Obj as $k => $v) { $Parameters[$k] = $v; } //签名步骤一:按字典序排序参数 ksort($Parameters); $String = formatBizQueryParaMap($Parameters, false); //echo '【string1】'.$String.'
'; //签名步骤二:在string后加入KEY if($appwxpay_key){ $String = $String."&key=".$appwxpay_key; } //echo "【string2】".$String."
"; //签名步骤三:MD5加密 $String = md5($String); //echo "【string3】 ".$String."
"; //签名步骤四:所有字符转为大写 $result_ = strtoupper($String); //echo "【result】 ".$result_."
"; return $result_; } //xml格式数据解析函数 function XMLDataParse($data){ $xml = simplexml_load_string($data,NULL,LIBXML_NOCDATA); $array=json_decode(json_encode($xml),true); return $array; } ?>

Recommended related articles:

POST and GET request codes in curl of php

About PHP intermediate keys Analysis

The above is the detailed content of PHP code for processing WeChat payment callbacks to change order payment status. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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