Documentation ¶
Overview ¶
Package coupon 代金券
Package coupon 代金券 ¶
Package coupon 代金券
Index ¶
- func QueryCouponStock(ctx *wxpay.WXPay, params map[string]string) (result map[string]string, err error)
- func QueryCouponsInfo(ctx *wxpay.WXPay, params map[string]string) (result map[string]string, err error)
- func SendCoupon(ctx *wxpay.WXPay, params map[string]string) (result map[string]string, err error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func QueryCouponStock ¶
func QueryCouponStock(ctx *wxpay.WXPay, params map[string]string) (result map[string]string, err error)
查询代金券批次
See: https://pay.weixin.qq.com/wiki/doc/api/tools/sp_coupon.php?chapter=12_4&index=5
POST https://api.mch.weixin.qq.com/mmpaymkttransfers/query_coupon_stock
Example ¶
package main import ( "fmt" "github.com/fastwego/wxpay" "github.com/fastwego/wxpay/apis/coupon" ) func main() { var ctx *wxpay.WXPay params := map[string]string{ "appid": "APPID", // ... } resp, err := coupon.QueryCouponStock(ctx, params) fmt.Println(resp, err) }
Output:
func QueryCouponsInfo ¶
func QueryCouponsInfo(ctx *wxpay.WXPay, params map[string]string) (result map[string]string, err error)
查询代金券信息
See: https://pay.weixin.qq.com/wiki/doc/api/tools/sp_coupon.php?chapter=12_5&index=6
POST https://api.mch.weixin.qq.com/mmpaymkttransfers/querycouponsinfo
Example ¶
package main import ( "fmt" "github.com/fastwego/wxpay" "github.com/fastwego/wxpay/apis/coupon" ) func main() { var ctx *wxpay.WXPay params := map[string]string{ "appid": "APPID", // ... } resp, err := coupon.QueryCouponsInfo(ctx, params) fmt.Println(resp, err) }
Output:
func SendCoupon ¶
发放代金券
用于商户主动调用接口给用户发放代金券的场景,已做防小号处理,给小号发放代金券将返回错误码。
注意:通过接口发放的代金券不会进入微信卡包
See: https://pay.weixin.qq.com/wiki/doc/api/tools/sp_coupon.php?chapter=12_3&index=4
POST https://api.mch.weixin.qq.com/mmpaymkttransfers/send_coupon
Example ¶
package main import ( "fmt" "github.com/fastwego/wxpay" "github.com/fastwego/wxpay/apis/coupon" ) func main() { var ctx *wxpay.WXPay params := map[string]string{ "appid": "APPID", // ... } resp, err := coupon.SendCoupon(ctx, params) fmt.Println(resp, err) }
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.