当前位置:网站首页>小程序企业发放红包功能
小程序企业发放红包功能
2022-07-25 09:24:00 【|刘钊|】
注意:
使用小程序红包的领取需要公众号的openid,而企业付款到零钱则直接使用的是小程序的openid
个人建议使用企业付款到零钱的方式发放红包
原因:
小程序的红包只能通过扫码的方式进入的小程序才能领取红包,见链接,需要讨论;
https://pay.weixin.qq.com/wiki/doc/api/tools/miniprogram_hb.php?chapter=18_4&index=1
https://developers.weixin.qq.com/community/develop/doc/00006450df4f183f449969b4f54c00

1、企业付款到零钱:
https://pay.weixin.qq.com/wiki/doc/api/tools/mch_pay.php?chapter=14_1
直接使用小程序的openid;
注意:
- 1、商户号(或同主体其他非服务商商户号)已入驻90日
- 2、截止今日回推30天,商户号(或同主体其他非服务商商户号)连续不间断保持有交易
- 3、 登录微信支付商户平台-产品中心,开通企业付款。
2、小程序红包
https://pay.weixin.qq.com/wiki/doc/api/tools/miniprogram_hb.php?chapter=13_8&index=1
如果必须使用小程序的红包功能,则需要公众号的openid;
小程序领取红包实现方案:
从小程序web-view到公众号网页,使用jssdk获取用户信息,拿到公众号的openid,然后通过js-sdk跳回小程序,从而实现红包的领取;
3、 微信小程序发红包接口调用流程
1. 后台API调用:待进入联调过程时与开发进行详细沟通;
2. 告知服务器:告知服务器接收微信红包的用户openID,告知服务器该用户获得的金额;
3. 从商户号扣款:服务器获取信息后从对应商户号的可用余额中扣除对应的金额;
4. 调用失败:因不符合发送规则,商户号余额不足等原因造成调用失败,反馈至调用方;
5. 红包创建成功:返回红包package;
6. 小程序发放红包:用户在小程序里通过jsapi领取并拆开红包;

小程序端领取红包代码实现:
|
边栏推荐
猜你喜欢

NLM5系列无线振弦传感采集仪的工作模式及休眠模式下状态

¥ 1-1 SWUST OJ 941: implementation of consolidation operation of ordered sequence table

ESP32连接阿里云MQTT物联网平台

工程监测无线中继采集仪和无线网络的优势

Solve the Chinese garbled code error of qtcreator compiling with vs
![[machine translation] scones -- machine translation with multi tag tasks](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
[machine translation] scones -- machine translation with multi tag tasks

TM1638 LED数码显示模块ARDUINO驱动代码

ARMV8体系结构简介

无线振弦采集仪参数配置工具的设置

MLX90640 红外热成像传感器测温模块开发笔记(二)
随机推荐
Advanced introduction to digital IC Design SOC
¥ 1-1 SWUST OJ 941: implementation of consolidation operation of ordered sequence table
用ESP32+TM1638实验NTP网络校时闹钟的ARDUINO代码
SD/SDIO/EMMC
CDA Level1复盘总结
目标检测与分割之MaskRCNN代码结构流程全面梳理+总结
工程监测无线中继采集仪和无线网络的优势
LoRA转4G及网关中继器工作原理
Solve the Chinese garbled code error of qtcreator compiling with vs
pytorch使用tensorboard实现可视化总结
Introduction to armv8 architecture
@5-1 CCF 2019-12-1 reporting
CCF 201604-2 Tetris
Introduction to arm GIC
Verdi 基础介绍
AI模型风险评估 第1部分:动机
Internal structure of SOC chip
Development history of convolutional neural network (part)
[RNN] analyze the RNN from rnn- (simple|lstm) to sequence generation, and then to seq2seq framework (encoder decoder, or seq2seq)
Data viewing and parameter modification of multi-channel vibrating wire, temperature and analog sensing signal acquisition instrument