mirror of
https://git.oceanpay.cc/danial/kami_script.git
synced 2025-12-18 20:56:47 +00:00
47 lines
1.1 KiB
Go
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"`
|
|
PayWayCode string `json:"payWayCode"`
|
|
OsType string `json:"osType"`
|
|
NotifyUrl string `json:"notifyUrl"`
|
|
AppKey string `json:"payKey"`
|
|
TimeStamp string `json:"timestamp"`
|
|
Sign string `json:"sign"`
|
|
}
|
|
|
|
func (d *Data) Url() url.Values {
|
|
return url.Values{
|
|
"exValue": {d.ExValue.Json()},
|
|
"orderNo": {d.OrderNo},
|
|
"orderPeriod": {d.OrderPeriod},
|
|
"orderPrice": {d.OrderPrice},
|
|
"payWayCode": {d.PayWayCode},
|
|
"osType": {d.OsType},
|
|
"notifyUrl": {d.NotifyUrl},
|
|
"payKey": {d.AppKey},
|
|
"timestamp": {d.TimeStamp},
|
|
"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)
|
|
}
|