native

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 native Native 支付

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShortUrl

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

转换短链接

该接口主要用于Native支付模式一中的二维码链接转成短链接(weixin://wxpay/s/XXXXXX),减小二维码数据量,提升扫描速度和精确度。

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

POST https://api.mch.weixin.qq.com/tools/shorturl

Example
package main

import (
	"fmt"

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

func main() {
	var ctx *wxpay.WXPay

	params := map[string]string{
		"appid": "APPID",
		// ...
	}
	resp, err := native.ShortUrl(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