hipay

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 (
	HipayCheckout = utils.API{
		Url:    "/checkout",
		Method: http.MethodPost,
	}
	HipayCheckoutGet = utils.API{
		Url:    "/checkout/get/",
		Method: http.MethodGet,
	}
	HipayPaymentGet = utils.API{
		Url:    "/payment/get/",
		Method: http.MethodGet,
	}
	HipayPaymentCorrection = utils.API{
		Url:    "/pos/correction",
		Method: http.MethodPost,
	}
	HipayStatement = utils.API{
		Url:    "/pos/statement",
		Method: http.MethodPost,
	}
)

Functions

This section is empty.

Types

type CheckOutItem

type CheckOutItem struct {
	ItemNo   string  `json:"itemno"`
	Name     string  `json:"names"`
	Price    float64 `json:"price"`
	Quantity int64   `json:"quantity"`
	Brand    string  `json:"brand"`
	Measure  string  `json:"measure"`
	Vat      float64 `json:"vat"`
	CityTax  float64 `json:"citytax"`
}

type Data

type Data struct {
	List       []*List `json:"list"`
	EntityID   string  `json:"entityId"`
	Date       string  `json:"date"`
	Page       int64   `json:"page"`
	PerPage    int64   `json:"perPage"`
	TotalCount int64   `json:"totalCount"`
	TotalPage  int64   `json:"totalPage"`
}

type Details

type Details struct {
	Field string `json:"field"`
	Issue string `json:"issue"`
}

type Hipay

type Hipay interface {
	Checkout(amount float64) (HipayCheckoutResponse, error)
	CheckoutGet(checkoutId string) (HipayCheckoutGetResponse, error)
	PaymentGet(paymentId string) (HipayPaymentGetResponse, error)
	PaymentCorrection(paymentId string) (HipayPaymentCorrectionResponse, error)
	Statement(date string) (HipayStatementResponse, error)
}

func New

func New(endpoint, token, entityId string) Hipay

type HipayCheckoutGetResponse

type HipayCheckoutGetResponse struct {
	Code           int64      `json:"code"`
	Description    string     `json:"description"`
	Amount         float64    `json:"amount,omitempty"`
	Currency       string     `json:"currency,omitempty"`
	DiscountAmount float64    `json:"discount_amount,omitempty"`
	Status         string     `json:"status,omitempty"`
	StatusDate     string     `json:"status_date,omitempty"`
	PaymentID      string     `json:"paymentId,omitempty"`
	Details        []*Details `json:"details,omitempty"`
}

type HipayCheckoutRequest

type HipayCheckoutRequest struct {
	EntityID string          `json:"entityId"`
	Amount   float64         `json:"amount"`
	Currency string          `json:"currency"`
	QrData   bool            `json:"qrData"`
	Signal   bool            `json:"signal"`
	IpAddres string          `json:"ipaddress"`
	Items    []*CheckOutItem `json:"items,omitempty"`
}

type HipayCheckoutResponse

type HipayCheckoutResponse struct {
	Code        int64      `json:"code"`
	Description string     `json:"description"`
	RequestID   string     `json:"requestId"`
	CheckoutID  string     `json:"checkoutId"`
	Expires     string     `json:"expires"`
	Signal      *Signal    `json:"signal,omitempty"`
	QrData      string     `json:"qrData"`
	Details     []*Details `json:"details,omitempty"`
}

type HipayPaymentCorrectionRequest

type HipayPaymentCorrectionRequest struct {
	EntityID  string `json:"entityId"`
	PaymentID string `json:"paymentId"`
}

type HipayPaymentCorrectionResponse

type HipayPaymentCorrectionResponse struct {
	Code                int64      `json:"code"`
	Description         string     `json:"description"`
	PaymentID           string     `json:"paymentId,omitempty"`
	CorrectionPaymentID string     `json:"correction_paymentId,omitempty"`
	Details             []*Details `json:"details,omitempty"`
}

type HipayPaymentGetResponse

type HipayPaymentGetResponse struct {
	Code         int64      `json:"code"`
	Description  string     `json:"description"`
	ID           string     `json:"id,omitempty"`
	Amount       string     `json:"amount,omitempty"`
	Currency     string     `json:"currency,omitempty"`
	EntityID     string     `json:"entityId,omitempty"`
	CheckoutID   string     `json:"checkoutId,omitempty"`
	PaymentID    string     `json:"paymentId,omitempty"`
	PaymentType  string     `json:"paymentType,omitempty"`
	PaymentBrand string     `json:"paymentBrand,omitempty"`
	PaymentDate  string     `json:"paymentDate,omitempty"`
	PaymentDesc  string     `json:"paymentDesc,omitempty"`
	ResultDesc   string     `json:"result_desc,omitempty"`
	ResultCode   string     `json:"result_code,omitempty"`
	Details      []*Details `json:"details,omitempty"`
}

type HipayStatementRequest

type HipayStatementRequest struct {
	EntityID string `json:"entityId"`
	Date     string `json:"date"` // Format: "2023-02-09"
}

type HipayStatementResponse

type HipayStatementResponse struct {
	Code        int64      `json:"code"`
	Description string     `json:"description"`
	Details     []*Details `json:"details,omitempty"`
	Data        *Data      `json:"data,omitempty"`
}

type List

type List struct {
	PaymentDate  string  `json:"paymentDate"`
	CheckoutID   string  `json:"checkoutId"`
	PaymentID    string  `json:"paymentId"`
	Amount       float64 `json:"amount"`
	Currency     string  `json:"currency"`
	FeeAmount    float64 `json:"feeAmount"`
	FeePrc       float64 `json:"feePrc"`
	PaymentDesc  string  `json:"paymentDesc"`
	ReturnAmount float64 `json:"returnAmount"`
}

type Signal

type Signal struct {
	SubscribeKey string `json:"subscribeKey"`
	Channel      string `json:"channel"`
	UUID         string `json:"uuid"`
}

Jump to

Keyboard shortcuts

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