Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrQueryNotSupported = errors.New("gateway does not support order query API")
ErrQueryNotSupported is returned when the payment gateway implements neither the standard EPay order query API nor the EasyPay-compatible fallback API — the endpoint returns HTTP 404 or answers with something that is not JSON at all (e.g. an HTML error page).
Functions ¶
func FormatMoney ¶ added in v1.14.0
FormatMoney returns the exact two-decimal amount sent to an EPay-compatible gateway. It intentionally preserves the historical truncation behaviour.
func ParseMoney ¶ added in v1.14.0
ParseMoney converts a non-negative decimal amount to its integer minor unit. It rejects floats, exponents and values with more than two decimal places.
Types ¶
type Client ¶
type Client struct {
Pid string
Url string
Key string
Type string
// contains filtered or unexported fields
}
func (*Client) CreatePayUrl ¶
CreatePayUrl builds the browser redirect URL for EPay's submit.php endpoint.
func (*Client) QueryOrder ¶ added in v1.14.0
func (c *Client) QueryOrder(orderNo string) (*QueryResult, error)
QueryOrder obtains payment details directly from the gateway. It first uses the standard EPay api.php protocol. When that endpoint is absent, it falls back to a known EasyPay-compatible POST protocol that exposes only status.
func (*Client) QueryOrderStatus ¶
QueryOrderStatus is kept for callers that only need a status boolean.