? WeChat ?? ??? ?? ??????? WeChat ??? ???? ?? ?? ??? ???? ???? ??? ?????.
?? ??? ?? ?? ???? ??? ???? ?? ?? ??, ?? ?????, ?? ?????? ??? ???? ?? ?????.

? ?? ?? ? ???? ?????.
WeChat ?? ???? ??
?? ????? ??
???? ????? ? ?? ????? ??
1. ?? ?? ???? ??
?? ?? URL ??? ?? ?? ??? ??? ??? ????. ??? ???? ?? URL ??? ??? ????.
?? ??? URL: http://www.fangbei.org/wxpay/jsapi/index.php
?? ?? URL: http://www.fangbei. org /wxpay/notify/index.php
?? ?? URL: http://www.fangbei.org/wxpay/rights/index.php
?? ?? URL: http://www.fangbei.org/ wxpay /alarm/index.php
2. ?? ????? ??
?? ?????? ???? ?? ???? ???? ?? ??? ?? ??? ?? jsapi ??? ???? ?? ???
<?php
include_once("WxPayHelper.php");
$commonUtil = new CommonUtil();
$wxPayHelper = new WxPayHelper();
$wxPayHelper->setParameter("bank_type", "WX");
$wxPayHelper->setParameter("body", "方倍微信支付測(cè)試");
$wxPayHelper->setParameter("partner", PARTNERID);
$wxPayHelper->setParameter("out_trade_no", $commonUtil->create_noncestr());
$wxPayHelper->setParameter("total_fee", "1");
$wxPayHelper->setParameter("fee_type", "1");
$wxPayHelper->setParameter("notify_url", "http://www.fangbei.org/wxpay/notify/index.php");
$wxPayHelper->setParameter("spbill_create_ip", $_SERVER['REMOTE_ADDR']);
$wxPayHelper->setParameter("input_charset", "GBK");
$biz_package=$wxPayHelper->create_biz_package();
?>
<html>
<meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
<script language="javascript">
function callpay()
{
WeixinJSBridge.invoke('getBrandWCPayRequest',<?php echo $biz_package;?>,function(res){
WeixinJSBridge.log(res.err_msg);
alert(res.err_code+res.err_desc+res.err_msg);
});
}
</script>
<body>
<button type="button" onclick="callpay()">方倍微信支付測(cè)試</button>
</body>
</html>
? ????. ?? ????? ???? ???? ?? ?????? ??? ?? ????? ??? URL? ?????.
http://www.fangbei.org/wxpay/notify/index.php?discount=0&fee_type=1&input_charset=GBK¬ify_id=aCi-cg4m1nr2bbg-De-MK6hQum8XVsw4mYfYnD5umAiEm_J6P_MalPvOisl2NJdurzTW-TJ9IPcnKmZm5TpKjrc8bXT6PEe0&out_trade_no=5DlIL2s5DGR8147c&partner=1219951701&product_fee=1&sign=A7AEF7AE3B70C54C3C0FF642DD2E2004&sign_type=MD5&time_end=20140808185647&total_fee=1&trade_mode=1&trade_state=0&transaction_id=1219951701201408083366666764&transport_fee=0
??? ??? ??? POST?? ?? XML ???
<xml>
<OpenId><![CDATA[ocIywt7h42MwHxXx23sJdBpBV7Q8]]></OpenId>
<AppId><![CDATA[wxa8826d0c0c0b6d6a]]></AppId>
<IsSubscribe>1</IsSubscribe>
<TimeStamp>1407495408</TimeStamp>
<NonceStr><![CDATA[D6iywdqlcdUj8nDQ]]></NonceStr>
<AppSignature><![CDATA[a99a3cb4f5377dc30cca3f7b362412d7e468e0f4]]></AppSignature>
<SignMethod><![CDATA[sha1]]></SignMethod>
</xml>
? ?????. URL??
transaction_id=1219951701201408083366666764
out_trade_no=5DlIL2s5DGR8147c
?, xml??
<OpenId><![CDATA[ocIywt7h42MwHxXx23sJdBpBV7Q8]]></OpenId>
? ??? ?? 3? ???? ?? ?????. ?? ?????? WeChat Pay ?? ?? ??
? ?????. ? ? ???? ?? ?? ?????? ????.
3. ???? ?????? ?? ????? ??
???? ?????? ?? ????? ??? ???? ??? ?? ??? ?? ?????. ??? ????. ??? ?? index.php? ?? ??? ?????. ??? ??? ????.
<?php
echo "success";
?>
4. ???
? ? ?? ?????? ??? ? ??? ??? ? ????. ???. ??? ??? ????

???? ??? ??? ?? ?? ?? ?? ? ?? ?? PHP ??? ????? ??????!