**SDK體驗地址**
----
http://paysdk.weixin.qq.com/
**快速搭建指南**
-----
①、安裝配置nginx+phpfpm+php
②、建SDK解壓到網站根目錄
③、修改lib/WxPay.Config.php為自己申請的商戶號的信息(配置詳見說明)
⑤、下載證書替換cert下的文件
⑥、搭建完成
**SDK目錄結構**
----
|-- cert
| |-- apiclient_cert.pem
| `-- apiclient_key.pem
|-- index.php
|-- lib
| |-- WxPay.Api.php
| |-- WxPay.Config.php
| |-- WxPay.Data.php
| |-- WxPay.Exception.php
| `-- WxPay.Notify.php
|-- logs
| |-- 2015-03-06.log
| `-- 2015-03-11.log
`-- example
|-- WxPay.JsApiPay.php
|-- WxPay.MicroPay.php
|-- WxPay.NativePay.php
|-- download.php
|-- micropay.php
|-- native.php
|-- native_notify.php
|-- notify.php
|-- orderquery.php
|-- qrcode.php
|-- refund.php
|-- refundquery.php
|-- jsapi.php
|-- log.php
`-- phpqrcode
**目錄功能簡介**
------
**lib**
API接口封裝代碼
WxPay.Api.php 包括所有微信支付API接口的封裝
WxPay.Config.php 商戶配置
WxPay.Data.php 輸入參數封裝
WxPay.Exception.php 異常類
WxPay.Notify.php 回調通知基類
**cert**
證書存放路徑,證書可以登錄商戶平臺https://pay.weixin.qq.com/index.php/account/api_cert下載
**example**
樣例程序代碼路徑
**example/phpqrcode**
開源二維碼php代碼
**logs**
日志文件
**※配置指南**
MCHID = '1225312702';
這里填開戶郵件中的商戶號
**APPID = 'wx426b3015555a46be';**
這里填開戶郵件中的(公眾賬號APPID或者應用APPID)
**KEY = 'e10adc3949ba59abbe56e057f20f883e'**
這里請使用商戶平臺登錄賬戶和密碼登錄http://pay.weixin.qq.com 平臺設置的“API密鑰”,為了安全,請設置為32字符串。
**APPSECRET = '01c6d59a3f9024db6336662ac95c8e74'**
改參數在JSAPI支付(open平臺賬戶不能進行JSAPI支付)的時候需要用來獲取用戶openid,可使用APPID對應的公眾平臺登錄http://mp.weixin.qq.com 的開發者中心獲取AppSecret。