pp

package
v1.245.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlipayPaymentProvider

type AlipayPaymentProvider struct {
	Client *alipay.Client
}

func NewAlipayPaymentProvider

func NewAlipayPaymentProvider(appId string, appCertificate string, appPrivateKey string, authorityPublicKey string, authorityRootPublicKey string) *AlipayPaymentProvider

func (*AlipayPaymentProvider) GetInvoice added in v1.44.9

func (pp *AlipayPaymentProvider) GetInvoice(paymentName string, personName string, personIdCard string, personEmail string, personPhone string, invoiceType string, invoiceTitle string, invoiceTaxId string) (string, error)

func (*AlipayPaymentProvider) Notify added in v1.29.0

func (pp *AlipayPaymentProvider) Notify(request *http.Request, body []byte, authorityPublicKey string) (string, string, float64, string, string, error)

func (*AlipayPaymentProvider) Pay

func (pp *AlipayPaymentProvider) Pay(providerName string, productName string, payerName string, paymentName string, productDisplayName string, price float64, returnUrl string, notifyUrl string) (string, error)

type GcInvoiceReqInfo added in v1.44.9

type GcInvoiceReqInfo struct {
	BusNo        string `json:"busno"`
	PayerName    string `json:"payername"`
	IdNum        string `json:"idnum"`
	PayerType    string `json:"payertype"`
	InvoiceTitle string `json:"invoicetitle"`
	Tin          string `json:"tin"`
	Phone        string `json:"phone"`
	Email        string `json:"email"`
}

type GcInvoiceRespInfo added in v1.44.9

type GcInvoiceRespInfo struct {
	BusNo     string `json:"busno"`
	State     string `json:"state"`
	EbillCode string `json:"ebillcode"`
	EbillNo   string `json:"ebillno"`
	CheckCode string `json:"checkcode"`
	Url       string `json:"url"`
	Content   string `json:"content"`
}

type GcNotifyRespInfo added in v1.29.0

type GcNotifyRespInfo struct {
	Xmpch      string  `json:"xmpch"`
	OrderDate  string  `json:"orderdate"`
	OrderNo    string  `json:"orderno"`
	Amount     float64 `json:"amount"`
	Jylsh      string  `json:"jylsh"`
	TradeNo    string  `json:"tradeno"`
	PayMethod  string  `json:"paymethod"`
	OrderState string  `json:"orderstate"`
	ReturnType string  `json:"return_type"`
	PayerId    string  `json:"payerid"`
	PayerName  string  `json:"payername"`
}

type GcPayReqInfo added in v1.29.0

type GcPayReqInfo struct {
	OrderDate string `json:"orderdate"`
	OrderNo   string `json:"orderno"`
	Amount    string `json:"amount"`
	Xmpch     string `json:"xmpch"`
	Body      string `json:"body"`
	ReturnUrl string `json:"return_url"`
	NotifyUrl string `json:"notify_url"`
	PayerId   string `json:"payerid"`
	PayerName string `json:"payername"`
	Remark1   string `json:"remark1"`
	Remark2   string `json:"remark2"`
}

type GcPayRespInfo added in v1.29.0

type GcPayRespInfo struct {
	Jylsh     string `json:"jylsh"`
	Amount    string `json:"amount"`
	PayerId   string `json:"payerid"`
	PayerName string `json:"payername"`
	PayUrl    string `json:"payurl"`
}

type GcPaymentProvider added in v1.29.0

type GcPaymentProvider struct {
	Xmpch     string
	SecretKey string
	Host      string
}

func NewGcPaymentProvider added in v1.29.0

func NewGcPaymentProvider(clientId string, clientSecret string, host string) *GcPaymentProvider

func (*GcPaymentProvider) GetInvoice added in v1.44.9

func (pp *GcPaymentProvider) GetInvoice(paymentName string, personName string, personIdCard string, personEmail string, personPhone string, invoiceType string, invoiceTitle string, invoiceTaxId string) (string, error)

func (*GcPaymentProvider) Notify added in v1.29.0

func (pp *GcPaymentProvider) Notify(request *http.Request, body []byte, authorityPublicKey string) (string, string, float64, string, string, error)

func (*GcPaymentProvider) Pay added in v1.29.0

func (pp *GcPaymentProvider) Pay(providerName string, productName string, payerName string, paymentName string, productDisplayName string, price float64, returnUrl string, notifyUrl string) (string, error)

type GcRequestBody added in v1.29.0

type GcRequestBody struct {
	Op          string `json:"op"`
	Xmpch       string `json:"xmpch"`
	Version     string `json:"version"`
	Data        string `json:"data"`
	RequestTime string `json:"requesttime"`
	Sign        string `json:"sign"`
}

type GcResponseBody added in v1.29.0

type GcResponseBody struct {
	Op         string `json:"op"`
	Xmpch      string `json:"xmpch"`
	Version    string `json:"version"`
	ReturnCode string `json:"return_code"`
	ReturnMsg  string `json:"return_msg"`
	Data       string `json:"data"`
	NotifyTime string `json:"notifytime"`
	Sign       string `json:"sign"`
}

type PaymentProvider

type PaymentProvider interface {
	Pay(providerName string, productName string, payerName string, paymentName string, productDisplayName string, price float64, returnUrl string, notifyUrl string) (string, error)
	Notify(request *http.Request, body []byte, authorityPublicKey string) (string, string, float64, string, string, error)
	GetInvoice(paymentName string, personName string, personIdCard string, personEmail string, personPhone string, invoiceType string, invoiceTitle string, invoiceTaxId string) (string, error)
}

func GetPaymentProvider

func GetPaymentProvider(typ string, appId string, clientSecret string, host string, appCertificate string, appPrivateKey string, authorityPublicKey string, authorityRootPublicKey string) PaymentProvider

Jump to

Keyboard shortcuts

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