首页
开发手册
应用中心
工具
用户中心
FoundPHP 微信平台设置
English
中文简体
English
上一篇
下一篇
#Foundphp wechat payment ### Introduction to PHP wechat payment Wechat payment is applied to mobile payment. Wechat provides a convenient payment platform, which can bind bank cards and credit cards. Calling wechat payment is equivalent to using bank cards and credit cards. ------------ ### 1.Register merchant number and obtain appid #### Login official account platform of WeChat ![](data/files/edit/20/08/12/200812_15222930.png) ##### Enter the basic configuration menu to obtain the appid ![](data/files/edit/20/08/12/200812_15222957.png) ![](data/files/edit/20/08/12/200812_15239185.png) ##### Expand the advertising and service menu and click wechat payment ![](data/files/edit/21/07/28/210728_16149889.png) Enter the payment application interface and click apply to access ![](data/files/edit/20/08/12/200812_15248965.png) Open wechat merchants ![](data/files/edit/20/08/12/200812_15246539.png) WeChat super code administrator using official account binding ![](data/files/edit/21/07/28/210728_16152565.png) Fill in the application information according to the prompts ![](data/files/edit/20/08/12/200812_15246341.png) Submit and wait for approval #### 2.Wechat merchant ID acquisition and configuration Wechat merchant login website: https://pay.weixin.qq.com/index.php/partner/public/home ##### Enter the product center and choose to open jsapi payment ![](data/files/edit/20/08/12/200812_15298269.png) ##### After opening the jsapi, enter the development configuration and configure the payment authorization directory ![](data/files/edit/20/08/12/200812_15305016.png) Configure authorization directory ![](data/files/edit/20/08/12/200812_15317483.png) ##### Obtain wechat merchant ID and other configurations After entering the account center, the login account number is the wechat merchant number ![](data/files/edit/20/08/12/200812_15332994.png) ##### Enter the operation certificate menu. The browser that installs the "security control" needs to install the control. After the control is installed, install the operation certificate ![](data/files/edit/20/08/13/200813_10419546.png) ##### Enter the API security menu and set the merchant certificate and API secret key ![](data/files/edit/20/08/13/200813_10442786.png) ###### Merchant certificate application. Merchant certificate is used for order refund operation Download the wechat payment merchant platform tool (for merchants who have not generated a certificate, click generate certificate to download), open it and operate according to the tool prompt ![](data/files/edit/20/08/13/200813_10477784.png) ![](data/files/edit/20/08/13/200813_10474832.png) ###### Set API secret key (i.e. key value in config setting) ![](data/files/edit/20/08/13/200813_10495090.png) ##### Parameter use ```php //configuration information $config['pay']['type'] = 'wechat';//Wechat payment $config['pay']['id'] = '';//APPID $config['pay']['key'] = '';//mch id $config['pay']['mch_key'] = '';//mch secret $config['pay']['sslcert'] = 'apiclient_cert.pem';//certificate $config['pay']['sslkey'] = 'apiclient_key.pem';//certificate key $config['pay']['log_file'] = $RAND_DIR."pay_logs/".dates(time(),"Y-m-d").".txt";//Log file ```