集成 App 支付时出现 “Get Wechat API Error:appid 参数长度有误” 的解决办法

本文的案例是web的扫码支付,移植到app支付时一直报 Get Wechat API Error:appid参数长度有误的错误。
只需要简单的修改微信支付配置文件里面的app_id的字段为appid 即可。

    'wechat' => [
        'appid'      => 'wx*******',   //app_id换成appid 微信开发平台应用 app id
        'mch_id'      => '14*****',  // 第一步获取到的商户号
        'key'         => '******', // 刚刚设置的 API 密钥
        'cert_client' => resource_path('wechat_pay/apiclient_cert.pem'),
        'cert_key'    => resource_path('wechat_pay/apiclient_key.pem'),
        'log'         => [
            'file' => storage_path('logs/wechat_pay.log'),
        ],
    ],
《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
讨论数量: 2
happyqian_ah

谢谢分享,我也碰到这个问题 :+1:

5年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!