sandsdk

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

README

sandsdk

sand pay sdk

Documentation

Index

Constants

View Source
const (
	WebPayChannelH5       = WebPayChannel(iota) // 浏览器h5
	WebPayChannelWeChatMp                       // 微信公众号
)

Variables

This section is empty.

Functions

func ChunkSplit

func ChunkSplit(body string, chunklen uint, end string) string

func GeneratePem

func GeneratePem(data []byte) string

Types

type PayNotify

type PayNotify struct {
	Charset  string
	SignType string
	Sign     string

	Data *PayNotifyData
	// contains filtered or unexported fields
}

type PayNotifyData

type PayNotifyData struct {
	Head PayNotifyDataHead
	Body PayNotifyDataBody
}

type PayNotifyDataBody

type PayNotifyDataBody struct {
	Mid                 string `json:"mid"`
	OrderCode           string `json:"orderCode"`
	TotalAmount         string `json:"totalAmount"`
	OrderStatus         string `json:"orderStatus"`
	TradeNo             string `json:"tradeNo"`
	SettleAmount        string `json:"settleAmount"`
	BuyerPayAmount      string `json:"buyerPayAmount"`
	DiscAmount          string `json:"discAmount"`
	PayTime             string `json:"payTime"`
	ClearDate           string `json:"clearDate"`
	AccNo               string `json:"accNo"`
	MidFee              string `json:"midFee"`
	ExtraFee            string `json:"extraFee"`
	SpecialFee          string `json:"specialFee"`
	PlMidFee            string `json:"plMidFee"`
	BankSerial          string `json:"bankserial"`
	TxnCompleteTime     string `json:"txnCompleteTime"`
	PayOrderCode        string `json:"payordercode"`
	ExternalProductCode string `json:"externalProductCode"`
	CardNo              string `json:"cardNo"`
	CreditFlag          string `json:"creditFlag"`
	Bid                 string `json:"bid"`
	Extend              string `json:"extend"`
	FundBillList        string `json:"fundBillList"`
	PayDetail           string `json:"payDetail"`
	BenefitAmount       string `json:"benefitAmount"`
	RemittanceCode      string `json:"remittanceCode"`
	AccLogonNo          string `json:"accLogonNo"`
}

type PayNotifyDataHead

type PayNotifyDataHead struct {
	Version  string `json:"version"`
	RespTime string `json:"respTime"`
	RespCode string `json:"respCode"`
	RespMsg  string `json:"respMsg"`
}

type Service

type Service struct {
	MerId             string // 商户号
	AppPrivateKeyPath string // 应用私钥路径
	SandPublicKeyPath string // 杉德公钥路径
}

func NewService

func NewService(merId, appPrivateKeyPath, sandPublicKeyPath string) *Service

func (*Service) PayNotifyResponse

func (s *Service) PayNotifyResponse() []byte

func (*Service) PayNotifyVerifySign

func (s *Service) PayNotifyVerifySign(notify *PayNotify) error

func (*Service) PayParseNotify

func (s *Service) PayParseNotify(data string) (*PayNotify, error)

func (*Service) Sign

func (s *Service) Sign(data []byte) (string, error)

func (*Service) WebPay

func (s *Service) WebPay(param *WebPayParam) (string, error)

type WebPayChannel

type WebPayChannel uint8

type WebPayParam

type WebPayParam struct {
	Title     string            // 标题
	Info      map[string]string // 信息
	OrderId   string            // 订单号
	Amount    uint32            // 金额,单位:分
	NotifyUrl string            // 异步通知地址
	ResultUrl string            // 同步返回地址
	Channel   WebPayChannel     // 支付渠道
	Extend    string            // 扩展域
}

Jump to

Keyboard shortcuts

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