feat: support expiring cashier sessions
This commit is contained in:
@@ -20,6 +20,9 @@ type SubmitRequest struct {
|
||||
ReturnURL string
|
||||
Body string
|
||||
Attach string
|
||||
// ExpireTime accepts a positive lifetime in minutes, RFC3339, or YYYY-MM-DD HH:mm:ss.
|
||||
// Empty uses the platform default of 10 minutes.
|
||||
ExpireTime string
|
||||
}
|
||||
|
||||
func (r SubmitRequest) params() map[string]string {
|
||||
@@ -33,14 +36,17 @@ func (r SubmitRequest) params() map[string]string {
|
||||
"return_url": r.ReturnURL,
|
||||
"body": r.Body,
|
||||
"attach": r.Attach,
|
||||
"expire_time": r.ExpireTime,
|
||||
})
|
||||
}
|
||||
|
||||
type SubmitResponse struct {
|
||||
OrderNo string `json:"order_no"`
|
||||
OutTradeNo string `json:"out_trade_no"`
|
||||
Amount int64 `json:"amount"`
|
||||
CashierURL string `json:"cashier_url"`
|
||||
OrderNo string `json:"order_no"`
|
||||
OutTradeNo string `json:"out_trade_no"`
|
||||
Amount int64 `json:"amount"`
|
||||
CashierURL string `json:"cashier_url"`
|
||||
ExpireTime *time.Time `json:"expire_time"`
|
||||
PageToken string `json:"page_token"`
|
||||
}
|
||||
|
||||
type QueryRequest struct {
|
||||
@@ -64,6 +70,7 @@ type QueryResponse struct {
|
||||
Completed bool `json:"completed"`
|
||||
ChannelChecked bool `json:"channel_checked"`
|
||||
PaidAt *time.Time `json:"paid_at"`
|
||||
ExpireTime *time.Time `json:"expire_time"`
|
||||
}
|
||||
|
||||
type RefundRequest struct {
|
||||
@@ -128,6 +135,7 @@ type Order struct {
|
||||
IsManual bool `json:"is_manual"`
|
||||
PaidAt *time.Time `json:"paid_at"`
|
||||
CreatedAt *time.Time `json:"created_at"`
|
||||
ExpireTime *time.Time `json:"expire_time"`
|
||||
}
|
||||
|
||||
type ManualRequest struct {
|
||||
|
||||
Reference in New Issue
Block a user