golomt

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

View Source
const (
	MN = Lang("MN")
	EN = Lang("EN")
)
View Source
const (
	EcommercePay = PaymentMethod("payment")
	SocialPay    = PaymentMethod("socialpay")
)
View Source
const (
	POST   = ReturnType("POST")
	GET    = ReturnType("GET")
	MOBILE = ReturnType("MOBILE")
)

Variables

View Source
var (
	ECommerceInvoiceCreate = utils.API{
		Url:    "/api/invoice",
		Method: http.MethodPost,
	}

	ECommerceInquiry = utils.API{
		Url:    "/api/inquiry",
		Method: http.MethodPost,
	}

	ECommercePayByToken = utils.API{
		Url:    "/api/pay",
		Method: http.MethodPost,
	}
)

Functions

This section is empty.

Types

type ByTokenRequest

type ByTokenRequest struct {
	Amount        string `json:"amount"`
	Invoice       string `json:"invoice"`
	Checksum      string `json:"checksum"`
	TransactionID string `json:"transactionId"`
	Token         string `json:"token"`
	Lang          string `json:"lang"`
}

type ByTokenResponse

type ByTokenResponse struct {
	Amount        string `json:"amount"`
	ErrorDesc     string `json:"errorDesc"`
	ErrorCode     string `json:"errorCode"`
	TransactionID string `json:"transactionId"`
	Checksum      string `json:"checksum"`
	CardNumber    string `json:"cardNumber"`
}

type CreateInvoiceInput added in v1.0.1

type CreateInvoiceInput struct {
	Amount         float64    `json:"amount"`
	TransactionID  string     `json:"transactionId"`
	ReturnType     ReturnType `json:"returnType"`
	Callback       string     `json:"callback"`
	GetToken       bool       `json:"getToken"`
	SocialDeeplink bool       `json:"socialDeeplink"`
}

type CreateInvoiceRequest

type CreateInvoiceRequest struct {
	Amount         string `json:"amount"`
	Checksum       string `json:"checksum"`
	TransactionID  string `json:"transactionId"`
	ReturnType     string `json:"returnType"`
	Callback       string `json:"callback"`
	GenerateToken  string `json:"genToken"`
	SocialDeeplink string `json:"socialDeeplink"`
}

type CreateInvoiceResponse

type CreateInvoiceResponse struct {
	Invoice        string `json:"invoice"`
	Checksum       string `json:"checksum"`
	TransactionID  string `json:"transactionId"`
	Timestamp      string `json:"timestamp"`
	Status         int    `json:"status"`
	Error          string `json:"error"`
	Message        string `json:"message"`
	Path           string `json:"path"`
	SocialDeeplink string `json:"socialDeeplink"`
}

type Ecommerce

type Ecommerce interface {
	CreateInvoice(input CreateInvoiceInput) (CreateInvoiceResponse, error)
	Inquiry(transactionId string) (InquiryResponse, error)
	PayByToken(amount float64, token string, transactionId string, returnUrl string) (ByTokenResponse, error)
	GetUrlByInvoiceId(invoice string, lang Lang, paymentMethod PaymentMethod) string
}

func New

func New(endpoint, secret, token string) Ecommerce

type Error added in v1.0.3

type Error struct {
	Timestamp string `json:"timestamp"`
	Status    int    `json:"status"`
	Error     string `json:"error"`
	Message   string `json:"message"`
	Path      string `json:"path"`
}

type InquiryRequest

type InquiryRequest struct {
	Checksum      string `json:"checksum"`
	TransactionID string `json:"transactionId"`
}

type InquiryResponse

type InquiryResponse struct {
	Amount        string `json:"amount"`
	Bank          string `json:"bank"`
	Status        string `json:"status"`
	ErrorDesc     string `json:"errorDesc"`
	ErrorCode     string `json:"errorCode"`
	CardHolder    string `json:"cardHolder"`
	CardNumber    string `json:"cardNumber"`
	TransactionID string `json:"transactionId"`
	Token         string `json:"token"`
}

type Lang

type Lang string

type PaymentMethod

type PaymentMethod string

type ReturnType added in v1.0.1

type ReturnType string

Jump to

Keyboard shortcuts

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