mongolchat

package
v1.2.41 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MchatAuth = utils.API{
		Url:    "/application/auth",
		Method: http.MethodGet,
	}
	MchatOnlineQrGenerate = utils.API{
		Url:    "/worker/onlineqr/generate",
		Method: http.MethodPost,
	}
	MchatOnlineQrcheck = utils.API{
		Url:    "/worker/onlineqr/status",
		Method: http.MethodPost,
	}
	MchatTransactionSettlement = utils.API{
		Url:    "/worker/settle/upload",
		Method: http.MethodPost,
	}
)

Functions

This section is empty.

Types

type MchatOnlineQrCheckResponse

type MchatOnlineQrCheckResponse struct {
	Status    string `json:"status"`
	Code      int    `json:"code"`
	Message   string `json:"message"`
	ID        string `json:"id"`          // if status is paid this field filled with transaction id
	WhoPaid   string `json:"who_paid"`    // if status is paid this field filled with who_paid
	UserRefID string `json:"user_ref_id"` // if status is paid this field filled with user_ref_id
}

type MchatOnlineQrGenerateRequest

type MchatOnlineQrGenerateRequest struct {
	Amount          int            `json:"amount"`
	BranchID        string         `json:"branch_id"` // optional
	Products        []MchatProduct `json:"products"`
	Title           string         `json:"title"`
	SubTitle        string         `json:"sub_title"`
	NOAT            string         `json:"noat"`
	NHAT            string         `json:"nhat"`
	TTD             string         `json:"ttd"`
	ReferenceNumber string         `json:"reference_number"`
	ExpireTime      string         `json:"expire_time"`
}

type MchatOnlineQrGenerateResponse

type MchatOnlineQrGenerateResponse struct {
	Qr      string `json:"qr"`
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type MchatProduct

type MchatProduct struct {
	ProductName string `json:"product_name"`
	Quantity    string `json:"quantity"`
	Price       int    `json:"price"`
	Tag         string `json:"tag"`
}

type MchatQrGenerateInput

type MchatQrGenerateInput struct {
	Amount      int            `json:"amount"`
	PaymentUUID string         `json:"payment_uuid"`
	Products    []MchatProduct `json:"products"`
}

type MchatWebookInput

type MchatWebookInput struct {
	Type string      `json:"type"`
	Data interface{} `json:"data"`
}

type MchatWebookOrder

type MchatWebookOrder struct {
	ReferenceNumber string         `json:"reference_number"`
	WhoPaid         string         `json:"who_paid"`
	UserRefID       string         `json:"user_ref_id"`
	TransactionID   string         `json:"transaction_id"`
	OrderID         string         `json:"order_id"`
	Amount          float64        `json:"amount"`
	Date            string         `json:"date"`
	Products        []MchatProduct `json:"products"`
}

type MchatWebookQuickpay

type MchatWebookQuickpay struct {
	ReferenceNumber string         `json:"reference_number"`
	WhoPaid         string         `json:"who_paid"`
	UserRefID       string         `json:"user_ref_id"`
	TransactionID   string         `json:"transaction_id"`
	Amount          float64        `json:"amount"`
	Date            string         `json:"date"`
	Products        []MchatProduct `json:"products"`
}

type MchatWebookScanQR

type MchatWebookScanQR struct {
	ReferenceNumber string         `json:"reference_number"`
	WhoPaid         string         `json:"who_paid"`
	UserRefID       string         `json:"user_ref_id"`
	TransactionID   string         `json:"transaction_id"`
	GeneratedQRcode string         `json:"generated_qrcode"`
	Amount          float64        `json:"amount"`
	Date            string         `json:"date"`
	Products        []MchatProduct `json:"products"`
}

type MongolChat

type MongolChat interface {
	GenerateQR(input MchatOnlineQrGenerateRequest) (MchatOnlineQrGenerateResponse, error)
	CheckQR(qr string) (MchatOnlineQrCheckResponse, error)
}

func New

func New(endpoint, apikey, workerkey, appsecret, branchno string) MongolChat

Jump to

Keyboard shortcuts

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