wego

package module
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2018 License: MIT Imports: 7 Imported by: 2

README

WEGO a wechat interface for go(golang)

GoDoc license Go Report Card

世界上最好的Go微信开发SDK(时尚,简单,性能卓越)

a fashion fast wechat api for golang
WEGO借鉴了并参考了,当前许多流行的开源微信支付框架.并且为了使性能得到更大提高.全部使用golang进行重建架构开发

开发前,请务必仔细阅读并看懂

获取包:

go get github.com/godcong/wego

建议使用golang/dep添加包:

dep ensure --add github.com/godcong/wego

或者vgo添加:

vgo get github.com/godcong/wego@v0.1.0

接口说明可以参考godoc

godoc -http:6060

配置

    cfg := C(util.Map{
        "app_id":"wx1ad61aeexxxxxxx",                //AppId
        "mch_id":"1498xxxxx32",                        //商户ID
        "key":"O9aVVkxxxxxxxxxxxxxxxbZ2NQSJ",    //支付key
        "notify_url":"https://host.address/uri", //支付回调地址

        //如需使用敏感接口(如退款、发送红包等)需要配置 API 证书路径(登录商户平台下载 API 证书)
        "cert_path":"cert/apiclient_cert.pem",   //支付证书地址
        "key_path":"cert/apiclient_key.pem",      //支付证书地址

        //银行转账功能
        "rootca_path":"cert/rootca.pem",     //(可不填)
        "pubkey_path":"cert/publickey.pem",  //(可不填)部分支付使用(如:银行转账)
        "prikey_path":"cert/privatekey.pem", //(可不填)部分支付使用(如:银行转账)
    }

   通过配置config.toml文件,具体参考config.toml.example

    //必要配置
    app_id ='wx1ad61aeexxxxxxx'                //AppId
    mch_id = '1498xxxxx32'                        //商户ID
    key = 'O9aVVkxxxxxxxxxxxxxxxbZ2NQSJ'    //支付key

    notify_url ='https://host.address/uri' //支付回调地址

    //如需使用敏感接口(如退款、发送红包等)需要配置 API 证书路径(登录商户平台下载 API 证书)
    cert_path = 'cert/apiclient_cert.pem'   //支付证书地址
    key_path = 'cert/apiclient_key.pem'      //支付证书地址

    //银行转账功能
    rootca_path = 'cert/rootca.pem'     //(可不填)
    pubkey_path = "cert/publickey.pem"  //(可不填)部分支付使用(如:银行转账)
    prikey_path = "cert/privatekey.pem" //(可不填)部分支付使用(如:银行转账)

Readme

公众号

小程序

微信支付

开放平台 //TODO:

企业微信 //TODO:

企业微信开放平台 //TODO:

具体功能涵盖,微信模板,企业转账,微信红包,微信支付,微信客服,微信小程序等常用接口。

Documentation

Index

Constants

View Source
const RegAccessToken = "access_token"

RegAccessToken access token

View Source
const RegClient = "client"

RegClient client

View Source
const RegConfig = "config"

RegConfig config

Variables

This section is empty.

Functions

func C added in v1.1.2

func C(p util.Map) *core.Config

C parse config from map

func Config added in v1.0.3

func Config() *core.Config

Config ...

func MiniProgram

func MiniProgram() *mini.Program

MiniProgram ...

func OfficialAccount

func OfficialAccount() *official.Account

OfficialAccount 公众号*/

func Payment

func Payment() *payment.Payment

Payment result payment self

func PaymentBill added in v1.1.1

func PaymentBill() *payment.Bill

PaymentBill result payment bill

func PaymentJSSDK added in v1.1.1

func PaymentJSSDK() *payment.JSSDK

PaymentJSSDK result payment JSSDK

func PaymentOrder added in v1.1.1

func PaymentOrder() *payment.Order

PaymentOrder result payment Order

func PaymentRedPack added in v1.1.1

func PaymentRedPack() *payment.RedPack

PaymentRedPack result payment RedPack

func PaymentRefund added in v1.1.1

func PaymentRefund() *payment.Refund

PaymentRefund result payment Refund

func PaymentReverse added in v1.1.1

func PaymentReverse() *payment.Reverse

PaymentReverse result payment Reverse

func PaymentSandbox added in v1.1.1

func PaymentSandbox() *payment.Sandbox

PaymentSandbox result payment Sandbox

func PaymentSecurity added in v1.1.1

func PaymentSecurity() *payment.Security

PaymentSecurity result payment Security

func PaymentTransfer added in v1.1.1

func PaymentTransfer() *payment.Transfer

PaymentTransfer result payment Transfer

Types

type Application

type Application struct {
	*System
	// contains filtered or unexported fields
}

Application Application

func App added in v1.0.1

func App() *Application

App 获取App

func DefaultApplication added in v1.0.1

func DefaultApplication() *Application

DefaultApplication result an default application

func NewApplication added in v1.0.1

func NewApplication(path string) *Application

NewApplication create an application instance with config.toml path

func (*Application) Config added in v1.0.1

func (a *Application) Config() *core.Config

Config get application config interface

func (*Application) Get

func (a *Application) Get(name string) (interface{}, bool)

Get 获取注册的数据

func (*Application) GetInterface added in v1.0.1

func (a *Application) GetInterface(name string) (interface{}, bool)

GetInterface 获取注册的interface

func (*Application) MiniProgram added in v1.0.1

func (a *Application) MiniProgram(cfg string) *mini.Program

MiniProgram return a default MiniProgram

func (*Application) New added in v1.0.1

func (a *Application) New(name string, args ...interface{}) interface{}

New create an new instance

func (*Application) OfficialAccount added in v1.0.1

func (a *Application) OfficialAccount(cfg string) *official.Account

OfficialAccount return a default OfficialAccount

func (*Application) Payment added in v1.0.1

func (a *Application) Payment(cfg string) *payment.Payment

Payment return a default Payment

func (*Application) Register

func (a *Application) Register(name string, v interface{})

Register 注册

type Server

type Server struct {
	*core.Config
}

Server ...

type System added in v1.0.1

type System struct {
	//debug = true
	Debug bool `toml:"debug"`
	//response_type = 'array'
	//ResponseType string `toml:"response_type"`
	//use_cache = true
	//DataType DataType `toml:"data_type"`
	UseSandbox bool `toml:"use_sandbox"`
	UseCache   bool `toml:"use_cache"`
	Log        log.Log
}

System 系统定义

Directories

Path Synopsis
app

Jump to

Keyboard shortcuts

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