giftcard

package
v1.0.0-beta.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package giftcard 微信礼品卡

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func GeneralCardUpdateUser

func GeneralCardUpdateUser(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)

更新用户礼品卡信息

当礼品卡被使用后,开发者可以通过该接口变更某个礼品卡的余额信息

See: https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/gift_card.html

POST https://api.weixin.qq.com/card/generalcard/updateuser?access_token=TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/offiaccount"
	"github.com/fastwego/offiaccount/apis/card/giftcard"
)

func main() {
	var ctx *offiaccount.OffiAccount

	payload := []byte("{}")
	resp, err := giftcard.GeneralCardUpdateUser(ctx, payload)

	fmt.Println(resp, err)
}
Output:

func InvoiceGetAuthData

func InvoiceGetAuthData(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)

查询开票信息

用户完成授权后,商户可以调用该接口查询某一个订单

See: https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/gift_card.html

POST https://api.weixin.qq.com/card/invoice/getauthdata

Example
package main

import (
	"fmt"

	"github.com/fastwego/offiaccount"
	"github.com/fastwego/offiaccount/apis/card/giftcard"
)

func main() {
	var ctx *offiaccount.OffiAccount

	payload := []byte("{}")
	resp, err := giftcard.InvoiceGetAuthData(ctx, payload)

	fmt.Println(resp, err)
}
Output:

func InvoiceSetBizAttr

func InvoiceSetBizAttr(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)

设置支付后开票信息

商户可以通过该接口设置某个商户号发生收款后在支付消息上出现开票授权按钮

See: https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/gift_card.html

POST https://api.weixin.qq.com/card/invoice/setbizattr?action=set_pay_mch&access_token={access_token}

Example
package main

import (
	"fmt"

	"github.com/fastwego/offiaccount"
	"github.com/fastwego/offiaccount/apis/card/giftcard"
)

func main() {
	var ctx *offiaccount.OffiAccount

	payload := []byte("{}")
	resp, err := giftcard.InvoiceSetBizAttr(ctx, payload)

	fmt.Println(resp, err)
}
Output:

func MaintainSet

func MaintainSet(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)

下架-礼品卡货架

开发者可以通过该接口查询当前商户下所有的礼品卡货架id

See: https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/gift_card.html

POST https://api.weixin.qq.com/card/giftcard/maintain/set?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/offiaccount"
	"github.com/fastwego/offiaccount/apis/card/giftcard"
)

func main() {
	var ctx *offiaccount.OffiAccount

	payload := []byte("{}")
	resp, err := giftcard.MaintainSet(ctx, payload)

	fmt.Println(resp, err)
}
Output:

func OrderBatchGet

func OrderBatchGet(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)

批量查询礼品卡订单信息

开发者可以通过该接口查询该商户某个时间段内创建的所有订单详情

See: https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/gift_card.html

POST https://api.weixin.qq.com/card/giftcard/order/batchget?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/offiaccount"
	"github.com/fastwego/offiaccount/apis/card/giftcard"
)

func main() {
	var ctx *offiaccount.OffiAccount

	payload := []byte("{}")
	resp, err := giftcard.OrderBatchGet(ctx, payload)

	fmt.Println(resp, err)
}
Output:

func OrderGet

func OrderGet(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)

查询-单个礼品卡订单信息

开发者可以通过该接口查询某个订单号对应的订单详情

See: https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/gift_card.html

POST https://api.weixin.qq.com/card/giftcard/order/get?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/offiaccount"
	"github.com/fastwego/offiaccount/apis/card/giftcard"
)

func main() {
	var ctx *offiaccount.OffiAccount

	payload := []byte("{}")
	resp, err := giftcard.OrderGet(ctx, payload)

	fmt.Println(resp, err)
}
Output:

func OrderRefund

func OrderRefund(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)

退款

开发者可以通过该接口对某一笔订单操作退款,注意该接口比较隐私,请开发者提高操作该功能的权限等级

See: https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/gift_card.html

POST https://api.weixin.qq.com/card/giftcard/order/refund?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/offiaccount"
	"github.com/fastwego/offiaccount/apis/card/giftcard"
)

func main() {
	var ctx *offiaccount.OffiAccount

	payload := []byte("{}")
	resp, err := giftcard.OrderRefund(ctx, payload)

	fmt.Println(resp, err)
}
Output:

func PageAdd

func PageAdd(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)

创建-礼品卡货架

开发者可以通过该接口创建一个礼品卡货架并且用于公众号、门店的礼品卡售卖

See: https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/gift_card.html

POST https://api.weixin.qq.com/card/giftcard/page/add?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/offiaccount"
	"github.com/fastwego/offiaccount/apis/card/giftcard"
)

func main() {
	var ctx *offiaccount.OffiAccount

	payload := []byte("{}")
	resp, err := giftcard.PageAdd(ctx, payload)

	fmt.Println(resp, err)
}
Output:

func PageBatchGet

func PageBatchGet(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)

查询-礼品卡货架列表

开发者可以通过该接口查询当前商户下所有的礼品卡货架id

See: https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/gift_card.html

POST https://api.weixin.qq.com/card/giftcard/page/batchget?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/offiaccount"
	"github.com/fastwego/offiaccount/apis/card/giftcard"
)

func main() {
	var ctx *offiaccount.OffiAccount

	payload := []byte("{}")
	resp, err := giftcard.PageBatchGet(ctx, payload)

	fmt.Println(resp, err)
}
Output:

func PageGet

func PageGet(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)

查询-礼品卡货架信息

开发者可以查询某个礼品卡货架信息

See: https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/gift_card.html

POST https://api.weixin.qq.com/card/giftcard/page/get?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/offiaccount"
	"github.com/fastwego/offiaccount/apis/card/giftcard"
)

func main() {
	var ctx *offiaccount.OffiAccount

	payload := []byte("{}")
	resp, err := giftcard.PageGet(ctx, payload)

	fmt.Println(resp, err)
}
Output:

func PageUpdate

func PageUpdate(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)

修改-礼品卡货架信息

开发者可以通过该接口更新礼品卡货架信息

See: https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/gift_card.html

POST https://api.weixin.qq.com/card/giftcard/page/update?access_token=ACCESS_TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/offiaccount"
	"github.com/fastwego/offiaccount/apis/card/giftcard"
)

func main() {
	var ctx *offiaccount.OffiAccount

	payload := []byte("{}")
	resp, err := giftcard.PageUpdate(ctx, payload)

	fmt.Println(resp, err)
}
Output:

func PaySubmchBind

func PaySubmchBind(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)

绑定商户号到礼品卡小程序

See: https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/gift_card.html

POST https://api.weixin.qq.com/card/giftcard/pay/submch/bind?access_token=TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/offiaccount"
	"github.com/fastwego/offiaccount/apis/card/giftcard"
)

func main() {
	var ctx *offiaccount.OffiAccount

	payload := []byte("{}")
	resp, err := giftcard.PaySubmchBind(ctx, payload)

	fmt.Println(resp, err)
}
Output:

func PayWhitelistAdd

func PayWhitelistAdd(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)

申请微信支付礼品卡权限

See: https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/gift_card.html

POST https://api.weixin.qq.com/card/giftcard/pay/whitelist/add?access_token=TOKEN

Example
package main

import (
	"fmt"

	"github.com/fastwego/offiaccount"
	"github.com/fastwego/offiaccount/apis/card/giftcard"
)

func main() {
	var ctx *offiaccount.OffiAccount

	payload := []byte("{}")
	resp, err := giftcard.PayWhitelistAdd(ctx, payload)

	fmt.Println(resp, err)
}
Output:

func WxaSet

func WxaSet(ctx *offiaccount.OffiAccount, payload []byte) (resp []byte, err error)

上传小程序代码

See: https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/gift_card.html

POST https://api.weixin.qq.com/card/giftcard/wxa/set

Example
package main

import (
	"fmt"

	"github.com/fastwego/offiaccount"
	"github.com/fastwego/offiaccount/apis/card/giftcard"
)

func main() {
	var ctx *offiaccount.OffiAccount

	payload := []byte("{}")
	resp, err := giftcard.WxaSet(ctx, payload)

	fmt.Println(resp, err)
}
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL