github.com/chanxuehong/wechat@v0.0.0-20230222024006-36f0325263cd/mp/card/code/unavailable.go (about)

     1  package code
     2  
     3  import (
     4  	"github.com/chanxuehong/wechat/mp/core"
     5  )
     6  
     7  // 设置卡券失效接口.
     8  func Unavailable(clt *core.Client, id *CardItemIdentifier) (err error) {
     9  	var result core.Error
    10  
    11  	incompleteURL := "https://api.weixin.qq.com/card/code/unavailable?access_token="
    12  	if err = clt.PostJSON(incompleteURL, id, &result); err != nil {
    13  		return
    14  	}
    15  
    16  	if result.ErrCode != core.ErrCodeOK {
    17  		err = &result
    18  		return
    19  	}
    20  	return
    21  }