多个小程序互通数据后,微信支付报appId与OpenId不一致

微信支付 文章 2021-03-17 20:01 715 0 全屏看文

AI助手支持GPT4.0

多个小程序互通数据后,微信支付报appId与OpenId不一致After multiple applets exchange data, WeChat Pay reports that appId is inconsistent with OpenId

多个小程序互通数据后,微信支付报appId与OpenId不一致

由于小程序的功能过于繁杂,上级让我们将小程序根据sass拆分成多个小程序

这多个小程序之间的数据要互通,用户表也是同一个用户

我们在数据库的用户表里存储了用户的openId

现在出现了一个问题:当从小程序A调到小程序B的时候,会进行一次授权登陆,授权登陆会改变用户表存储的openId。授权登陆小程序B后再回小程序A走支付功能,由于现在表存储的是小程序B的openId,发起下单接口时,提示小程序A的appId和 openId对不上

对于这种情况,有什么解决方案?

Because the function of the small program is too complicated, the superior asked us to split the small program into several small programs according to sass. The data between these small programs should be exchanged, and the user table is also the same user. We stored the user's openid in the user table of the database Now there is a problem: when small program a is transferred to small program B, an authorized login will be performed, and the authorized login will change the openid stored in the user table. After logging in to applet B, you can go back to applet a for payment function. Since the table now stores the openid of applet B, when you initiate the order interface, you will be prompted that the appid and openid of applet a are not matched. What is the solution to this situation?

回答:

peng:

每个小程序对应的openid是不同的,注册开放平台(open.weixin.qq.com)用到的小程序绑上去,wx.login会获取到unionid,这个针对用户是唯一,你们用户主表可以存unionid,加个子表记录小程序appid,和对应的openid。支付可以时可以根据从哪个appid发起取对应的openid.

老张:

谢邀。

具体你怎么弄,你随便。

只要统一下单填的openid与调用wx.requestPayment的用户的openid是同一个就行了。

Memory:

不要存储openid,发起支付的商户要重新获取

Eric:

使用unionid 打通用户

-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
体验版都可以看到激励视频广告,发布到正式环境没法看
开发者工具显示正常,编译到手机上就乱了?
微信JSAPI申请退款问题
微信开放平台认证之后,授权绑定的appID提示:不支持关联该类型的appID,微信客服说目前不支持,
OPPO K1屏幕适配的问题,必现
随便看看
微信公众号免300认证教程 5892
小程序已经上线,作为管理员无法在小程序数据助手查看数据? 5299
小程序广告组件通过审核,但是小程序内没有显示广告? 5067
企业微信通讯录账号被管理员误/恶意删除,怎么办? 9568
问题? 9048
如何快速搭建抽奖助手小程序(无需代码知识) 6177
许涛 大哥在吗, 要解冻小程序的时候提示信息主体不一致, 能帮忙看下吗? 7472
小程序搜一搜全称搜索不显示 麻烦解决一下!谢谢 6793
我的小程序广告收款主体是个体工商户,每个月邮寄两次发票很是麻烦,我年底的时候打包邮寄一次可以么? 6128
如何解决渲染层网络错误Failed to load media? 17394