mirror of
https://git.oceanpay.cc/danial/kami_script.git
synced 2025-12-18 22:06:37 +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"`
|
|
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)
|
|
}
|