Files
kami_script/models/model.go
2024-07-06 19:46:48 +08:00

47 lines
1.1 KiB
Go

package models
import (
"encoding/json"
"net/url"
)
type Data struct {
ExValue ExValue `json:"exValue"`
OrderNo string `json:"orderNo"`
OrderPeriod string `json:"orderPeriod"`
OrderPrice string `json:"orderPrice"`
ProductCode string `json:"productCode"`
NotifyUrl string `json:"notifyUrl"`
PayKey string `json:"PayKey"`
TimeStamp string `json:"timestamp"`
Sign string `json:"sign"`
Ip string `json:"ip"`
}
func (d *Data) Url() url.Values {
return url.Values{
"exValue": {d.ExValue.Json()},
"orderNo": {d.OrderNo},
"orderPeriod": {d.OrderPeriod},
"orderPrice": {d.OrderPrice},
"notifyUrl": {d.NotifyUrl},
"productCode": {d.ProductCode},
"payKey": {d.PayKey},
"timestamp": {d.TimeStamp},
"ip": {d.Ip},
"sign": {d.Sign},
}
}
type ExValue struct {
Data string `json:"data"`
CardNo string `json:"cardNo"`
FaceType string `json:"faceType"`
RecoveryType string `json:"recoveryType"`
}
func (v *ExValue) Json() string {
data, _ := json.Marshal(v)
return string(data)
}