vmq

package
v0.0.0-...-b941d56 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: AGPL-3.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSign

func GetSign(data interface{}) (sign string, err error)

GetSign 拿到签名

func ValidateSign

func ValidateSign(data interface{}) (err error)

ValidateSign 验签

Types

type CreateOrderParams

type CreateOrderParams struct {
	R           *ghttp.Request
	PayFlowId   int64
	PayChannel  int
	OrderAmount int
	Param       string // 需要原样返回的参数
}

type CreateOrderResponse

type CreateOrderResponse struct {
	PayId        string `json:"payId"`        // 商户订单号
	OrderId      string `json:"orderId"`      // 云端订单号,可用于查询订单是否支付成功
	PayType      int    `json:"payType"`      // 微信支付为1 支付宝支付为2
	Price        string `json:"price"`        // 订单金额
	ReallyPrice  string `json:"reallyPrice"`  // 实际需付金额
	PayUrl       string `json:"payUrl"`       // 支付二维码内容
	IsAuto       int    `json:"isAuto"`       // 1需要手动输入金额 0扫码后自动输入金额
	State        int    `json:"state"`        // 订单状态:-1|订单过期 0|等待支付 1|完成 2|支付完成但通知失败
	TimeOut      int    `json:"timeOut"`      // 订单有效时间(分钟)
	Date         string `json:"date"`         // 订单创建时间时间戳(10位)
	ResponseData string `json:"responseData"` // 支付接口返回原文
}

func CreateOrder

func CreateOrder(params *CreateOrderParams) (re *CreateOrderResponse, err error)

CreateOrder 创建订单

type GetStateParams

type GetStateParams struct {
	R *ghttp.Request
}

type GetStateResponse

type GetStateResponse struct {
	LastPay      int64  `json:"Lastpay"`      // 最后一次监控到支付的时间戳(10位)
	LastHeart    int64  `json:"lastheart"`    // 最后一次监控端向服务器发送心跳的时间戳(10位)
	JKState      int    `json:"jkstate"`      // 监控端状态 1|在线 0|掉线 -1|还未绑定监控端
	ResponseData string `json:"responseData"` // 支付接口返回原文
}

func GetState

func GetState(params *GetStateParams) (re *GetStateResponse, err error)

GetState 获取当前支付接口状态

type VmqClient

type VmqClient struct {
	// contains filtered or unexported fields
}

VmqClient VmqClient

func Instance

func Instance() *VmqClient

Instance 单例

func (*VmqClient) GetApiKey

func (c *VmqClient) GetApiKey() string

GetApiKey 获取通讯密钥

func (*VmqClient) GetHost

func (c *VmqClient) GetHost() string

GetHost 获取host

Jump to

Keyboard shortcuts

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