Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

微信扣款服务的申请扣款接口(V2 接口)目前有实现吗? #436

Open
wms-github opened this issue Dec 16, 2024 · 1 comment
Labels
good first issue Good for newcomers

Comments

@wms-github
Copy link

https://pay.weixin.qq.com/wiki/doc/api/wxpay_v2/papay/chapter3_8.shtml

@thahao
Copy link
Contributor

thahao commented Dec 17, 2024

有的

// 申请扣款
// 文档地址:https://pay.weixin.qq.com/wiki/doc/api/wxpay_v2/papay/chapter3_8.shtml
func (w *Client) EntrustApplyPay(ctx context.Context, bm gopay.BodyMap) (wxRsp *EntrustApplyPayResponse, err error) {
	err = bm.CheckEmptyError("nonce_str", "body", "out_trade_no", "total_fee", "notify_url", "trade_type", "contract_id")
	if err != nil {
		return nil, err
	}
	bs, err := w.doProdPost(ctx, bm, entrustApplyPay)
	if err != nil {
		return nil, err
	}
	wxRsp = new(EntrustApplyPayResponse)
	if err = xml.Unmarshal(bs, wxRsp); err != nil {
		return nil, fmt.Errorf("[%w]: %v, bytes: %s", gopay.UnmarshalErr, err, string(bs))
	}
	return wxRsp, nil
}

@iGoogle-ink iGoogle-ink added the good first issue Good for newcomers label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants