74 lines
2.0 KiB
Go
74 lines
2.0 KiB
Go
|
package front
|
||
|
|
||
|
import (
|
||
|
"encoding/json"
|
||
|
)
|
||
|
|
||
|
type XinYeOrderRequest struct {
|
||
|
SAppId string `json:"sAppId"`
|
||
|
TxnType string `json:"txnType"`
|
||
|
ProdId string `json:"prodId"`
|
||
|
AccessType string `json:"accessType"`
|
||
|
MchtId string `json:"mchtId"`
|
||
|
MchtUserId string `json:"mchtUserId"`
|
||
|
MchtOrderId string `json:"mchtOrderId"`
|
||
|
MchtOrderDateTime string `json:"mchtOrderDateTime"`
|
||
|
MchtOrderAmt string `json:"mchtOrderAmt"`
|
||
|
MchtTxnAmt string `json:"mchtTxnAmt"`
|
||
|
MainPayType string `json:"mainPayType"`
|
||
|
CcyType string `json:"ccyType"`
|
||
|
BuRealFlag string `json:"buRealFlag"`
|
||
|
FrontEndUrl string `json:"frontEndUrl"`
|
||
|
OrderRemark string `json:"orderRemark"`
|
||
|
}
|
||
|
|
||
|
type XinYeOrderResponse struct {
|
||
|
Code string `json:"code"`
|
||
|
Msg string `json:"msg"`
|
||
|
RccsSuccess string `json:"rccsSuccess"`
|
||
|
PayInfo payInfo `json:"payInfo"`
|
||
|
}
|
||
|
|
||
|
type XinYeOrderQueryResponse struct {
|
||
|
Code string `json:"code"`
|
||
|
Msg string `json:"msg"`
|
||
|
RccsSuccess string `json:"rccsSuccess"`
|
||
|
OrderInfo OrderInfo `json:"orderInfo"`
|
||
|
}
|
||
|
|
||
|
type OrderInfo struct {
|
||
|
TxnStatus string `json:"txnStatus"`
|
||
|
}
|
||
|
|
||
|
type payInfo struct {
|
||
|
PayToken string `json:"payToken"`
|
||
|
PayTokenTime string `json:"payTokenTime"`
|
||
|
TxnOrderId string `json:"txnOrderId"`
|
||
|
TxnOrderTime string `json:"txnOrderTime"`
|
||
|
MchtOrderId string `json:"mchtOrderId"`
|
||
|
}
|
||
|
|
||
|
type XinYeOrderQueryRequest struct {
|
||
|
SAppId string `json:"sAppId"`
|
||
|
TxnType string `json:"txnType"`
|
||
|
ProdId string `json:"prodId"`
|
||
|
AccessType string `json:"accessType"`
|
||
|
MchtId string `json:"mchtId"`
|
||
|
OriMchtOrderId string `json:"oriMchtOrderId"`
|
||
|
}
|
||
|
|
||
|
func (this *XinYeOrderRequest) toMap() (resultMap map[string]interface{}) {
|
||
|
// Marshal the struct to JSON, ignoring omitempty fields.
|
||
|
jsonBytes, err := json.Marshal(this)
|
||
|
if err != nil {
|
||
|
return
|
||
|
}
|
||
|
// Unmarshal the JSON into a map to get the final result.
|
||
|
err = json.Unmarshal(jsonBytes, &resultMap)
|
||
|
if err != nil {
|
||
|
return
|
||
|
}
|
||
|
|
||
|
return resultMap
|
||
|
}
|