dev_util

package
v1.0.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2020 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Overview

Package dev_util 开发辅助

Package dev_util 开发辅助

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSignKey

func GetSignKey(ctx *wxpay.WXPay, params map[string]string) (result map[string]string, err error)

沙箱获取 signKey

验收仿真测试系统的API验签密钥需从API获取

See: https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=23_1&index=2

POST https://api.mch.weixin.qq.com/sandboxnew/pay/getsignkey

Example
package main

import (
	"fmt"

	"github.com/fastwego/wxpay"
	"github.com/fastwego/wxpay/apis/dev_util"
)

func main() {
	var ctx *wxpay.WXPay

	params := map[string]string{
		"appid": "APPID",
		// ...
	}
	resp, err := dev_util.GetSignKey(ctx, params)

	fmt.Println(resp, err)
}
Output:

func Report

func Report(ctx *wxpay.WXPay, params map[string]string) (result map[string]string, err error)

交易保障 上报

商户在调用微信支付提供的相关接口时,会得到微信支付返回的相关信息以及获得整个接口的响应时间。为提高整体的服务水平,协助商户一起提高服务质量,微信支付提供了相关接口调用耗时和返回信息的主动上报接口,微信支付可以根据商户侧上报的数据进一步优化网络部署,完善服务监控,和商户更好的协作为用户提供更好的业务体验。

See: https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=9_8&index=10

POST https://api.mch.weixin.qq.com/payitil/report

Example
package main

import (
	"fmt"

	"github.com/fastwego/wxpay"
	"github.com/fastwego/wxpay/apis/dev_util"
)

func main() {
	var ctx *wxpay.WXPay

	params := map[string]string{
		"appid": "APPID",
		// ...
	}
	resp, err := dev_util.Report(ctx, params)

	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