C# Class Senparc.Weixin.MP.TenPayLibV3.RedPackApi

红包发送和查询Api(暂缺裂变红包发送)
ファイルを表示 Open project: JeffreySu/WeiXinMPSDK

Public Methods

Method Description
SearchRedPack ( string appId, string mchId, string tenPayKey, string tenPayCertPath, string mchBillNo ) : SearchRedPackResult

查询红包(包括普通红包和裂变红包)

SendNGroupRedPack ( string appId, string mchId, string tenPayKey, string tenPayCertPath, string openId, string senderName, string iP, int redPackAmount, string wishingWord, string actionName, string remark, string &nonceStr, string &paySign, string mchBillNo, RedPack_Scene scene = null, string riskInfo = null, string consumeMchId = null, string amtType = "ALL_RAND" ) : NormalRedPackResult

裂变红包发送

裂变红包:一次可以发放一组红包。首先领取的用户为种子用户,种子用户领取一组红包当中的一个,并可以通过社交分享将剩下的红包给其他用户。裂变红包充分利用了人际传播的优势。

SendNormalRedPack ( string appId, string mchId, string tenPayKey, string tenPayCertPath, string openId, string senderName, string iP, int redPackAmount, string wishingWord, string actionName, string remark, string &nonceStr, string &paySign, string mchBillNo, RedPack_Scene scene = null, string riskInfo = null, string consumeMchId = null ) : NormalRedPackResult

普通红包发送

Private Methods

Method Description
CheckValidationResult ( object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors ) : bool
GetNewBillNo ( string mchId ) : string

Method Details

SearchRedPack() public static method

查询红包(包括普通红包和裂变红包)
public static SearchRedPack ( string appId, string mchId, string tenPayKey, string tenPayCertPath, string mchBillNo ) : SearchRedPackResult
appId string 公众账号AppID
mchId string 商户MchID
tenPayKey string 支付密钥,微信商户平台(pay.weixin.qq.com)-->账户设置-->API安全-->密钥设置
tenPayCertPath string 证书地址(硬盘地址,形如E://cert//apiclient_cert.p12)
mchBillNo string 商家订单号
return SearchRedPackResult

SendNGroupRedPack() public static method

裂变红包发送

裂变红包:一次可以发放一组红包。首先领取的用户为种子用户,种子用户领取一组红包当中的一个,并可以通过社交分享将剩下的红包给其他用户。裂变红包充分利用了人际传播的优势。

public static SendNGroupRedPack ( string appId, string mchId, string tenPayKey, string tenPayCertPath, string openId, string senderName, string iP, int redPackAmount, string wishingWord, string actionName, string remark, string &nonceStr, string &paySign, string mchBillNo, RedPack_Scene scene = null, string riskInfo = null, string consumeMchId = null, string amtType = "ALL_RAND" ) : NormalRedPackResult
appId string 公众账号AppID
mchId string 商户MchID
tenPayKey string 支付密钥,微信商户平台(pay.weixin.qq.com)-->账户设置-->API安全-->密钥设置
tenPayCertPath string 证书地址(硬盘物理地址,形如E:\\cert\\apiclient_cert.p12)
openId string 要发红包的用户的OpenID
senderName string 红包发送者名称,会显示给接收红包的用户
iP string 发送红包的服务器地址
redPackAmount int 红包金额(单位分)
wishingWord string 祝福语
actionName string 活动名称
remark string 活动描述,用于低版本微信显示
nonceStr string 将nonceStr随机字符串返回,开发者可以存到数据库用于校验
paySign string 将支付签名返回,开发者可以存到数据库用于校验
mchBillNo string 商户订单号,新的订单号可以从RedPackApi.GetNewBillNo(mchId)方法获得,如果传入null,则系统自动生成
scene RedPack_Scene 场景id(非必填)
riskInfo string 活动信息(非必填),String(128)posttime:用户操作的时间戳。 /// 示例:posttime%3d123123412%26clientversion%3d234134%26mobile%3d122344545%26deviceid%3dIOS /// mobile:业务系统账号的手机号,国家代码-手机号。不需要+号 /// deviceid :mac 地址或者设备唯一标识 /// clientversion :用户操作的客户端版本 /// 把值为非空的信息用key = value进行拼接,再进行urlencode /// urlencode(posttime= xx & mobile = xx & deviceid = xx) ///
consumeMchId string 资金授权商户号,服务商替特约商户发放时使用(非必填),String(32)。示例:1222000096
amtType string 红包金额设置方式,默认填写“ALL_RAND”,ALL_RAND—全部随机,商户指定总金额和红包发放总人数,由微信支付随机计算出各红包金额
return NormalRedPackResult

SendNormalRedPack() public static method

普通红包发送
public static SendNormalRedPack ( string appId, string mchId, string tenPayKey, string tenPayCertPath, string openId, string senderName, string iP, int redPackAmount, string wishingWord, string actionName, string remark, string &nonceStr, string &paySign, string mchBillNo, RedPack_Scene scene = null, string riskInfo = null, string consumeMchId = null ) : NormalRedPackResult
appId string 公众账号AppID
mchId string 商户MchID
tenPayKey string 支付密钥,微信商户平台(pay.weixin.qq.com)-->账户设置-->API安全-->密钥设置
tenPayCertPath string 证书地址(硬盘物理地址,形如E:\\cert\\apiclient_cert.p12)
openId string 要发红包的用户的OpenID
senderName string 红包发送者名称,会显示给接收红包的用户
iP string 发送红包的服务器地址
redPackAmount int 红包金额(单位分)
wishingWord string 祝福语
actionName string 活动名称
remark string 活动描述,用于低版本微信显示
nonceStr string 将nonceStr随机字符串返回,开发者可以存到数据库用于校验
paySign string 将支付签名返回,开发者可以存到数据库用于校验
mchBillNo string 商户订单号,新的订单号可以从RedPackApi.GetNewBillNo(mchId)方法获得,如果传入null,则系统自动生成
scene RedPack_Scene 场景id(非必填)
riskInfo string 活动信息(非必填),String(128)posttime:用户操作的时间戳。 /// 示例:posttime%3d123123412%26clientversion%3d234134%26mobile%3d122344545%26deviceid%3dIOS /// mobile:业务系统账号的手机号,国家代码-手机号。不需要+号 /// deviceid :mac 地址或者设备唯一标识 /// clientversion :用户操作的客户端版本 /// 把值为非空的信息用key = value进行拼接,再进行urlencode /// urlencode(posttime= xx & mobile = xx & deviceid = xx) ///
consumeMchId string 资金授权商户号,服务商替特约商户发放时使用(非必填),String(32)。示例:1222000096
return NormalRedPackResult