config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Module for configure the sdk configurations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetBizContent

func SetBizContent(source m.M) m.MakeMapEndpoint

SetBizContent set bizContent

func SetMethod

func SetMethod(method string) m.MakeMapEndpoint

SetMethod set method

func SetOptionalParam

func SetOptionalParam(c Config) m.MakeMapEndpoint

SetOptionalParam Set Config's Optional Param to map[string]interface{}

target.
Set("app_cert_sn", c.AppCertSN, opt).
Set("alipay_root_cert_sn", c.AliPayRootCertSN, opt).
Set("return_url", c.ReturnUrl, opt).
Set("notify_url", c.NotifyUrl, opt).
Set("app_auth_token", c.AppAuthToken, opt).
Set("auth_token", c.AuthToken, opt)

func SetPublicParam

func SetPublicParam(c Config) m.MakeMapEndpoint

SetPublicParam Set Config's Public Param to map[string]interface{}

target.
Set("app_id", c.AppId).
Set("format", c.Format).
Set("charset", c.Charset).
Set("sign_type", c.SignType).
Set("timestamp", time.Now().In(c.Loc).Format(global.TimeLayout))

func SignParam

func SignParam(c Config) m.MakeMapEndpoint

SignParam sign current params, also set the sign result into map[string]interface{}

Types

type Config

type Config struct {
	Loc                *time.Location
	AppId              string
	PrivateKey         string
	PrivateKeyType     string
	AppCertSN          string
	AliPayPublicCertSN string
	AliPayRootCertSN   string
	SignType           string
	ReturnUrl          string
	NotifyUrl          string
	Charset            string
	Format             string
	Version            string
	AppAuthToken       string
	AuthToken          string
	Production         bool
}

func (Config) Url

func (c Config) Url() string

Url get alipay gateway endpoint

Jump to

Keyboard shortcuts

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