Documentation
¶
Index ¶
- Constants
- Variables
- type BaseError
- type CreateOrderInput
- type CreateOrderResponse
- type CustomerData
- type Datum
- type OrderCancelInput
- type OrderCancelResponse
- type OrderInqueryInput
- type OrderInqueryResponse
- type OrderNotifyInput
- type OrderNotifyResponse
- type OrderVoidInput
- type OrderVoidResponse
- type Pass
- type RetCreateOrder
- type RetInqueryOrder
- type RetNotifyOrder
- type RetOrderCancel
- type RetOrderVoid
- type WebhookCallbackResponse
Constants ¶
View Source
const ( OrderInqueryStatusPaid string = "paid" OrderInqueryStatusPending string = "pending" OrderInqueryStatusCancelled string = "cancelled" OrderInqueryStatusVoided string = "voided" )
View Source
const ( WebhookOperationPayment string = "payment" WebhookOperationVoid string = "void" )
Variables ¶
View Source
var ( PassCreateOrder = utils.API{ Url: "/create_order", Method: http.MethodPost, } PassInqueryOrder = utils.API{ Url: "/order_inquiry", Method: http.MethodPost, } PassNotifyOrder = utils.API{ Url: "/order_notify", Method: http.MethodPost, } PassCancelOrder = utils.API{ Url: "/cancel_order", Method: http.MethodPost, } PassVoidOrder = utils.API{ Url: "/void", Method: http.MethodPost, } )
Functions ¶
This section is empty.
Types ¶
type CreateOrderInput ¶
type CreateOrderResponse ¶
type CreateOrderResponse struct { StatusCode string `json:"status_code"` Ret *RetCreateOrder `json:"ret,omitempty"` Msg *BaseError `json:"msg,omitempty"` }
type CustomerData ¶
type OrderCancelInput ¶
type OrderCancelResponse ¶
type OrderCancelResponse struct { StatusCode string `json:"status_code"` Ret *RetOrderCancel `json:"ret,omitempty"` Msg *BaseError `json:"msg,omitempty"` }
type OrderInqueryInput ¶
type OrderInqueryResponse ¶
type OrderInqueryResponse struct { StatusCode string `json:"status_code"` Ret *RetInqueryOrder `json:"ret,omitempty"` Msg *BaseError `json:"msg,omitempty"` }
type OrderNotifyInput ¶
type OrderNotifyResponse ¶
type OrderNotifyResponse struct { StatusCode string `json:"status_code"` Ret *RetNotifyOrder `json:"ret,omitempty"` Msg *BaseError `json:"msg,omitempty"` }
type OrderVoidInput ¶
type OrderVoidResponse ¶
type OrderVoidResponse struct { StatusCode string `json:"status_code"` Ret *RetOrderVoid `json:"ret,omitempty"` Msg *BaseError `json:"msg,omitempty"` }
type Pass ¶
type Pass interface { CreateOrder(amount int64, callbackParams map[string]string) (CreateOrderResponse, error) InqueryOrder(orderID string) (OrderInqueryResponse, error) NotifyOrder(orderID, phone string) (OrderNotifyResponse, error) CancelOrder(orderID string) (OrderCancelResponse, error) VoidOrder(orderID string) (OrderVoidResponse, error) }
type RetCreateOrder ¶
type RetInqueryOrder ¶
type RetInqueryOrder struct { RespCode string `json:"resp_code"` RespMsg string `json:"resp_msg"` Status string `json:"status"` Amount string `json:"amount"` CustomerData *CustomerData `json:"customer_data,omitempty"` LoyaltyData interface{} `json:"loyalty_data,omitempty"` DBRefNo string `json:"db_ref_no"` ExtraData map[string]string `json:"extra_data,omitempty"` StatusText string `json:"status_text"` }
type RetNotifyOrder ¶
type RetOrderCancel ¶
type RetOrderVoid ¶
type RetOrderVoid struct { RespCode string `json:"resp_code"` RespMsg string `json:"resp_msg"` Status string `json:"status"` Amount string `json:"amount"` LoyaltyData interface{} `json:"loyalty_data"` DBRefNo string `json:"db_ref_no"` ServiceName string `json:"service_name"` DateTime string `json:"date_time"` TraceNo string `json:"trace_no"` Rrn string `json:"rrn"` TerminalID string `json:"terminal_id"` MerchantID string `json:"merchant_id"` }
type WebhookCallbackResponse ¶
type WebhookCallbackResponse struct { OrderID string `json:"order_id"` PaymentRequestID string `json:"payment_request_id"` PosID string `json:"pos_id"` Operation string `json:"operation"` IsSuccess bool `json:"is_success"` Amount string `json:"amount"` CreatedTime string `json:"created_time"` CustomerData *CustomerData `json:"customer_data,omitempty"` ExtraData map[string]string `json:"extra_data,omitempty"` DBRefNo string `json:"db_ref_no"` }
Click to show internal directories.
Click to hide internal directories.