qpay

package
v1.2.33 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	QPayAuthToken = utils.API{
		Url:    "/auth/token",
		Method: http.MethodPost,
	}
	QPayAuthRefresh = utils.API{
		Url:    "/auth/refresh",
		Method: http.MethodPost,
	}
	QPayPaymentGet = utils.API{
		Url:    "/payment/get/",
		Method: http.MethodGet,
	}
	QPayPaymentCheck = utils.API{
		Url:    "/payment/check",
		Method: http.MethodPost,
	}
	QPayPaymentCancel = utils.API{
		Url:    "/payment/cancel",
		Method: http.MethodDelete,
	}
	QPayPaymentRefund = utils.API{
		Url:    "/payment/refund/",
		Method: http.MethodDelete,
	}
	QPayPaymentList = utils.API{
		Url:    "/payment/url",
		Method: http.MethodPost,
	}
	QPayInvoiceCreate = utils.API{
		Url:    "/invoice",
		Method: http.MethodPost,
	}
	QPayInvoiceGet = utils.API{
		Url:    "/invoice/",
		Method: http.MethodGet,
	}
	QPayInvoiceCancel = utils.API{
		Url:    "/invoice/",
		Method: http.MethodDelete,
	}
)

Functions

This section is empty.

Types

type Deeplink struct {
	Name        string `json:"name"`        // Банкны нэр
	Description string `json:"description"` // Утга
	Link        string `json:"link"`        // Холбоос линк
}

type QPay

type QPay interface {
	CreateInvoice(input QPayCreateInvoiceInput) (QPaySimpleInvoiceResponse, error)
	GetInvoice(invoiceId string) (QpayInvoiceGetResponse, error)
	CancelInvoice(invoiceId string) (interface{}, error)
	GetPayment(invoiceId string) (interface{}, error)
	CheckPayment(invoiceId string, pageLimit, pageNumber int64) (QpayPaymentCheckResponse, error)
	CancelPayment(invoiceId, paymentUUID string) (QpayPaymentCheckResponse, error)
	RefundPayment(invoiceId, paymentUUID string) (interface{}, error)
}

func New

func New(username, password, endpoint, callback, invoiceCode, merchantId string) QPay

type QPayCreateInvoiceInput added in v1.0.2

type QPayCreateInvoiceInput struct {
	SenderCode    string
	ReceiverCode  string
	Description   string
	Amount        int64
	CallbackParam map[string]string
}

type QPaySimpleInvoiceRequest

type QPaySimpleInvoiceRequest struct {
	InvoiceCode         string `json:"invoice_code"`          // qpay-ээс өгсөн нэхэмжлэхийн код
	SenderInvoiceCode   string `json:"sender_invoice_no"`     // Байгууллагаас үүсгэх давтагдашгүй нэхэмжлэлийн дугаар
	InvoiceReceiverCode string `json:"invoice_receiver_code"` // Байгууллагын нэхэмжлэхийг хүлээн авч буй харилцагчийн дахин давтагдашгүй дугаар
	InvoiceDescription  string `json:"invoice_description"`   // Нэхэмжлэлийн утга
	Amount              int64  `json:"amount"`                // Мөнгөн дүн
	CallbackUrl         string `json:"callback_url"`
}

type QPaySimpleInvoiceResponse

type QPaySimpleInvoiceResponse struct {
	InvoiceID    string      `json:"invoice_id"`    // Object id
	QpayShortUrl string      `json:"qPay_shortUrl"` // qr shortcut
	QrText       string      `json:"qr_text"`       // Данс болон картын гүйлгээ дэмжих QR утга
	QrImage      string      `json:"qr_image"`      // Base64  зурган QR код, Qpay лого голдоо агуулсан
	Urls         []*Deeplink `json:"urls"`
}

type QpayInput

type QpayInput struct {
}

type QpayInvoiceGetResponse

type QpayInvoiceGetResponse struct {
	AllowExceed        bool               `json:"allow_exceed"`
	AllowPartial       bool               `json:"allow_partial"`
	CallbackUrl        string             `json:"callback_url"`
	DiscountAmount     int64              `json:"discount_amount"`
	EnableExpiry       bool               `json:"enable_expiry"`
	ExpiryDate         string             `json:"expiry_date"`
	GrossAmount        int64              `json:"gross_amount"`
	Inputs             []*QpayInput       `json:"inputs"`
	InvoiceDescription string             `json:"invoice_description"`
	InvoiceDueDate     interface{}        `json:"invoice_due_date"`
	InvoiceID          string             `json:"invoice_id"`
	InvoiceStatus      string             `json:"invoice_status"`
	Lines              []*QpayLine        `json:"lines"`
	MaximumAmount      int64              `json:"maximum_amount"`
	MinimumAmount      int64              `json:"minimum_amount"`
	Note               string             `json:"note"`
	SenderBranchCode   string             `json:"sender_branch_code"`
	SenderBranchData   string             `json:"sender_branch_data"`
	SenderInvoiceNo    string             `json:"sender_invoice_no"`
	SurchargeAmount    int64              `json:"surcharge_amount"`
	TaxAmount          int64              `json:"tax_amount"`
	TotalAmount        int64              `json:"total_amount"`
	Transactions       []*QpayTransaction `json:"transactions"`
}

type QpayLine

type QpayLine struct {
	Discounts       []interface{} `json:"discounts"`
	LineDescription string        `json:"line_description"`
	LineQuantity    string        `json:"line_quantity"`
	LineUnitPrice   string        `json:"line_unit_price"`
	Note            string        `json:"note"`
	Surcharges      []interface{} `json:"surcharges"`
	TaxProductCode  interface{}   `json:"tax_product_code"`
	Taxes           []interface{} `json:"taxes"`
}

QLine V2

type QpayOffset

type QpayOffset struct {
	PageNumber int64 `json:"page_number"` // Хуудасны тоо
	PageLimit  int64 `json:"page_limit"`  // Хуудасны хязгаар max <= 100
}

type QpayPaymentCancelRequest

type QpayPaymentCancelRequest struct {
	CallbackUrl string `json:"callback_url"` // Төлөгдсөн төлбөрийн ID-г Callback URL-аар авсаны дараа тухайн хэсэгт оруулж өгнө. Жш: https://qpay.mn/payment/result?payment_id=a2ab7ab0-80b0-4045-b79a-3052eda1ca89
	Note        string `json:"note"`         // Тэмдэглэл
}

type QpayPaymentCheckRequest

type QpayPaymentCheckRequest struct {
	ObjectID   string     `json:"object_id" `  // Обьектын төрөл // INVOICE: Нэхэмжлэх // QR: QR код // ITEM: Бүтээгдэхүүн
	ObjectType string     `json:"object_type"` // Обьектын ID //Обьектын төрөл QR үед QR кодыг ашиглана
	Offset     QpayOffset `json:"offset"`
}

type QpayPaymentCheckResponse

type QpayPaymentCheckResponse struct {
	Count      int64      `json:"count"`       // Нийт гүйлгээний мөрийн тоо
	PaidAmount int64      `json:"paid_amount"` // Гүйлгээний дүн
	Rows       []*QpayRow `json:"rows"`        // Гүйлгээний мөр
}

type QpayPaymentListRequest

type QpayPaymentListRequest struct {
	// ObjectID             string     `json:"object_id"`              // Обьектын ID // Обьектын төрөл INVOICE үед Нэхэмлэхийн код(invoice_code) // Обьектын төрөл QR үед QR кодыг ашиглана
	// ObjectType           string     `json:"object_type"`            // Обьектын төрөл // INVOICE: Нэхэмжлэх // MERCHANT: Байгууллага // QR: QR код
	MerchantID           string     `json:"merchant_id"`            // Байгууллагын дугаар
	MerchantBranchCode   string     `json:"merchant_branch_code"`   // Байгууллагын салбарын код
	MerchantTerminalCode string     `json:"merchant_terminal_code"` // Байгууллагын терминал код
	MerchantStaffCode    string     `json:"merchant_staff_code"`    // Ажилтаны код
	Offset               QpayOffset `json:"offset"`
}

type QpayRow

type QpayRow struct {
	PaymentID       string      `json:"payment_id"`       // QPay-ээс үүссэн гүйлгээний дугаар
	PaymentStatus   string      `json:"payment_status"`   // Гүйлгээ төлөв // NEW: Гүйлгээ үүсгэгдсэн // FAILED: Гүйлгээ амжилтгүй // PAID: Төлөгдсөн // REFUNDED: Гүйлгээ буцаагдсан
	PaymentDate     interface{} `json:"payment_date"`     // Гүйлгээ хийгдсэн хугацаа
	PaymentFee      string      `json:"payment_fee"`      // Гүйлгээний шимтгэл шимтгэл
	PaymentAmount   string      `json:"payment_amount"`   // Гүйлгээний дүн
	PaymentCurrency string      `json:"payment_currency"` // Гүйлгээний валют
	PaymentWallet   string      `json:"payemnt_wallet"`   // Гүйлгээ хийгдэн воллет
	TransactionType string      `json:"transaction_type"` // P2P or CARD
}

type QpayTransaction

type QpayTransaction struct {
}

QpayTransaction V2

Jump to

Keyboard shortcuts

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