ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# 微信支付配置 # 微信支付配置: #### **1.首先登陆微信公众号获取两个信息:登陆后—设置与开发–基本设置。就可以看到公众号开发信息** ![](https://docs.suteshop.com/uploads/suteshop-cn/images/m_c756121ecb2c31efc096661899fec109_r.png "null")      获取开发者ID(AppID)和开发者密码(AppSecret)      开发者ID(AppID )== wechat\_app\_id      开发者密码(AppSecret)== wechat\_app\_secret #### 2.微信公众号—设置—公众号设置—功能设置 配置:业务域名、JS接口安全域名、网页授权域名。 ![](https://docs.suteshop.com/uploads/suteshop-cn/images/m_0fc146ea08e56aa4267b2d0a03ed7a73_r.png "null") #### 3.登陆微信支付商户平台—-账户设置—商户信息 获取微信支付商户号 微信支付商户号 == mchid ![](https://docs.suteshop.com/uploads/suteshop-cn/images/m_2a0c4a07b2ac797fd2afb08eee3b58ce_r.png "null") #### 4.登陆微信支付商户平台—-账户设置—API安全 API密钥这里设置密钥 API密钥 == key ![](https://docs.suteshop.com/uploads/suteshop-cn/images/m_c70ddb88c0675334531840aa5fd80d8e_r.png "null") #### 4.1 登陆商户平台–账户中心–API安全–API证书–申请证书 ![](https://docs.suteshop.com/uploads/suteshop-cn/images/m_e5d6c5de08df6f6e11b6e5f1eaf9e705_r.png "null") #### 5.登陆微信支付商户平台—产品中心—开发设置 设置之前确保已开通这些产品,如果未开通需先申请开通 ![](https://docs.suteshop.com/uploads/suteshop-cn/images/m_ccd518e4f38a817b8ae85b8b31200e49_r.png "null") 配置支付域名:JSAPI支付、Native支付、H5支付 ![](https://docs.suteshop.com/uploads/suteshop-cn/images/m_6409aad41f645ce85d47041987d28084_r.png "null") #### 6.微信支付开通后还需要和微信公众号,微信小程序,开放平台的移动应用的APPID进行绑定。 登陆微信商户后台。打开产品中心,APPID授权管理,添加公众号绑定,微信小程序,开放平台的移动应用的APPID。然后在到对应的账号后台微信支付那里确认绑定。 ![](https://docs.suteshop.com/uploads/suteshop-cn/images/screenshot_1584789477722.png "null") ![](https://docs.suteshop.com/uploads/suteshop-cn/images/screenshot_1584789823995.png "null") ![](https://docs.suteshop.com/uploads/suteshop-cn/images/screenshot_1584789736008.png "null") ![](https://docs.suteshop.com/uploads/suteshop-cn/images/screenshot_1584790004927.png "null") ## **各项参数说明:** {“mchid”:商户ID, “key”:”商户API秘钥”, “wechat\_app\_id”:”公众号开发者ID”, “wechat\_app\_secret”:”公众号开发者密码”, “wechat\_xcx\_app\_id”:”小程序开发者ID”, “wechat\_xcx\_app\_secret”:”小程序开发者秘钥”, “weixin\_app\_id”:”开放平台移动应用开发者ID”, “weixin\_app\_key”:”开放平台移动应用开发者密钥”, “weixin\_mchid”:商户ID, “weixin\_key”:”商户API秘钥”, “apiclient\_cert”:”apiclient\_cert.pem”,微信支付API证书,根据微信支付的提示生成证书之后上传至account/data/api/wx/key “sslkey\_name”:”apiclient\_key.pem”}微信支付API证书,根据微信支付的提示生成证书之后上传至account/data/api/wx/key apiclient\_cert和sslkey\_name 的申请路径。 登陆商户平台–账户中心–API安全–API证书–申请证书 ## **下面配置替换对应的值:** `{"mchid":商户ID,"key":"商户API秘钥","wechat_app_id":"公众号开发者ID","wechat_app_secret":"公众号开发者密码","wechat_xcx_app_id":"小程序开发者ID","wechat_xcx_app_secret":"小程序开发者秘钥","weixin_app_id":"开放平台移动应用开发者ID","weixin_app_key":"开放平台移动应用开发者密钥","weixin_mchid":商户ID,"weixin_key":"商户API秘钥","apiclient_cert":"apiclient_cert.pem","sslkey_name":"apiclient_key.pem"}` ## **商城后台添加计划任务:** ![](https://docs.suteshop.com/uploads/suteshop-cn/images/screenshot_1588061093596.png "null") #### 注意:支付宝或者微信支付在使用过程中如果突然无法支付,微信出现此情况比较多,需要微信支付后台重新设置MD5密钥。微信原因导致支付密钥失效。 #### 如果微信小程序支付之后订单状态不改变,检查一下和小程序绑定的微信公众号的wechat\_app\_id是否配置且正确,微信公众号的wechat\_app\_id未配置或者不正确会导致此问题。