优化结构
This commit is contained in:
+118
-53
@@ -6,14 +6,21 @@ import (
|
||||
)
|
||||
|
||||
type PaymentOrderListRequest struct {
|
||||
Page int `form:"page"`
|
||||
PageSize int `form:"pageSize"`
|
||||
Provider string `form:"provider"`
|
||||
TradeNo string `form:"tradeNo"`
|
||||
BusinessType string `form:"businessType"`
|
||||
BusinessID string `form:"businessId"`
|
||||
PaymentStatus string `form:"paymentStatus"`
|
||||
RefundStatus string `form:"refundStatus"`
|
||||
Page int `form:"page"`
|
||||
PageSize int `form:"pageSize"`
|
||||
Provider string `form:"provider"`
|
||||
TradeNo string `form:"tradeNo"`
|
||||
ProviderTradeNo string `form:"providerTradeNo"`
|
||||
Keyword string `form:"keyword"`
|
||||
BusinessType string `form:"businessType"`
|
||||
BusinessID string `form:"businessId"`
|
||||
PaymentStatus string `form:"paymentStatus"`
|
||||
RefundStatus string `form:"refundStatus"`
|
||||
CreatedFrom string `form:"createdFrom"`
|
||||
CreatedTo string `form:"createdTo"`
|
||||
PaidFrom string `form:"paidFrom"`
|
||||
PaidTo string `form:"paidTo"`
|
||||
IssueOnly bool `form:"issueOnly"`
|
||||
}
|
||||
|
||||
type PaymentRequest struct {
|
||||
@@ -30,29 +37,49 @@ type PaymentRequest struct {
|
||||
BusinessType string `json:"businessType"`
|
||||
BusinessID string `json:"businessId"`
|
||||
PaymentMode string `json:"paymentMode"`
|
||||
UserAgent string `json:"-"`
|
||||
DeviceID string `json:"-"`
|
||||
}
|
||||
type PaymentQueryRequest struct {
|
||||
Provider string `json:"provider"`
|
||||
TradeNo string `json:"tradeNo"`
|
||||
Provider string `json:"provider"`
|
||||
TradeNo string `json:"tradeNo"`
|
||||
OperatorID uint `json:"-"`
|
||||
OperatorName string `json:"-"`
|
||||
ClientIP string `json:"-"`
|
||||
UserAgent string `json:"-"`
|
||||
DeviceID string `json:"-"`
|
||||
}
|
||||
type PaymentRefundRequest struct {
|
||||
Provider string `json:"provider"`
|
||||
TradeNo string `json:"tradeNo"`
|
||||
Amount int64 `json:"amount"`
|
||||
Provider string `json:"provider"`
|
||||
TradeNo string `json:"tradeNo"`
|
||||
Amount int64 `json:"amount"`
|
||||
Reason string `json:"reason"`
|
||||
OperatorID uint `json:"-"`
|
||||
OperatorName string `json:"-"`
|
||||
ClientIP string `json:"-"`
|
||||
UserAgent string `json:"-"`
|
||||
DeviceID string `json:"-"`
|
||||
}
|
||||
|
||||
type PaymentFulfillRequest struct {
|
||||
Provider string `json:"provider"`
|
||||
TradeNo string `json:"tradeNo"`
|
||||
Provider string `json:"provider"`
|
||||
TradeNo string `json:"tradeNo"`
|
||||
OperatorID uint `json:"-"`
|
||||
OperatorName string `json:"-"`
|
||||
ClientIP string `json:"-"`
|
||||
UserAgent string `json:"-"`
|
||||
DeviceID string `json:"-"`
|
||||
}
|
||||
|
||||
// PaymentCallbackRequest is populated by the HTTP transport and converted to
|
||||
// the biz callback object inside service.
|
||||
type PaymentCallbackRequest struct {
|
||||
Provider string
|
||||
Headers map[string]string
|
||||
Body []byte
|
||||
Query map[string]string
|
||||
Provider string
|
||||
Headers map[string]string
|
||||
Body []byte
|
||||
Query map[string]string
|
||||
ClientIP string
|
||||
UserAgent string
|
||||
}
|
||||
|
||||
type PaymentCallbackAck struct {
|
||||
@@ -103,38 +130,76 @@ type PaymentTestResult struct {
|
||||
}
|
||||
|
||||
type PaymentOrderResponse struct {
|
||||
ID uint64 `json:"ID"`
|
||||
Provider string `json:"provider"`
|
||||
TradeNo string `json:"tradeNo"`
|
||||
ProviderTradeNo string `json:"providerTradeNo"`
|
||||
BusinessType string `json:"businessType"`
|
||||
BusinessID string `json:"businessId"`
|
||||
Subject string `json:"subject"`
|
||||
PaymentMode string `json:"paymentMode"`
|
||||
OriginalAmount int64 `json:"originalAmount"`
|
||||
Amount int64 `json:"amount"`
|
||||
PaidAmount int64 `json:"paidAmount"`
|
||||
PayerPaidAmount int64 `json:"payerPaidAmount"`
|
||||
CashPaidAmount int64 `json:"cashPaidAmount"`
|
||||
PointPaidAmount int64 `json:"pointPaidAmount"`
|
||||
DiscountAmount int64 `json:"discountAmount"`
|
||||
ProviderDiscountAmount int64 `json:"providerDiscountAmount"`
|
||||
MerchantDiscountAmount int64 `json:"merchantDiscountAmount"`
|
||||
SettlementAmount int64 `json:"settlementAmount"`
|
||||
Currency string `json:"currency"`
|
||||
PayerCurrency string `json:"payerCurrency,omitempty"`
|
||||
AmountBreakdownKnown bool `json:"amountBreakdownKnown"`
|
||||
PaymentStatus string `json:"paymentStatus"`
|
||||
ProviderStatus string `json:"providerStatus"`
|
||||
FulfillmentStatus string `json:"fulfillmentStatus"`
|
||||
RefundStatus string `json:"refundStatus"`
|
||||
RefundedAmount int64 `json:"refundedAmount"`
|
||||
RefundRequestedAmount int64 `json:"refundRequestedAmount"`
|
||||
RefundNo string `json:"refundNo,omitempty"`
|
||||
LastError string `json:"lastError,omitempty"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
PaidAt *time.Time `json:"paidAt,omitempty"`
|
||||
FulfilledAt *time.Time `json:"fulfilledAt,omitempty"`
|
||||
RefundedAt *time.Time `json:"refundedAt,omitempty"`
|
||||
ID uint64 `json:"ID"`
|
||||
Provider string `json:"provider"`
|
||||
TradeNo string `json:"tradeNo"`
|
||||
ProviderTradeNo string `json:"providerTradeNo"`
|
||||
BusinessType string `json:"businessType"`
|
||||
BusinessID string `json:"businessId"`
|
||||
Subject string `json:"subject"`
|
||||
PaymentMode string `json:"paymentMode"`
|
||||
OriginalAmount int64 `json:"originalAmount"`
|
||||
Amount int64 `json:"amount"`
|
||||
PaidAmount int64 `json:"paidAmount"`
|
||||
PayerPaidAmount int64 `json:"payerPaidAmount"`
|
||||
CashPaidAmount int64 `json:"cashPaidAmount"`
|
||||
PointPaidAmount int64 `json:"pointPaidAmount"`
|
||||
DiscountAmount int64 `json:"discountAmount"`
|
||||
ProviderDiscountAmount int64 `json:"providerDiscountAmount"`
|
||||
MerchantDiscountAmount int64 `json:"merchantDiscountAmount"`
|
||||
SettlementAmount int64 `json:"settlementAmount"`
|
||||
Currency string `json:"currency"`
|
||||
PayerCurrency string `json:"payerCurrency,omitempty"`
|
||||
AmountBreakdownKnown bool `json:"amountBreakdownKnown"`
|
||||
PaymentStatus string `json:"paymentStatus"`
|
||||
ProviderStatus string `json:"providerStatus"`
|
||||
FulfillmentStatus string `json:"fulfillmentStatus"`
|
||||
RefundStatus string `json:"refundStatus"`
|
||||
RefundedAmount int64 `json:"refundedAmount"`
|
||||
RefundRequestedAmount int64 `json:"refundRequestedAmount"`
|
||||
RefundNo string `json:"refundNo,omitempty"`
|
||||
LastError string `json:"lastError,omitempty"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
PaidAt *time.Time `json:"paidAt,omitempty"`
|
||||
FulfilledAt *time.Time `json:"fulfilledAt,omitempty"`
|
||||
RefundedAt *time.Time `json:"refundedAt,omitempty"`
|
||||
Events []*PaymentEventResponse `json:"events,omitempty"`
|
||||
}
|
||||
|
||||
type PaymentEventResponse struct {
|
||||
ID uint64 `json:"id"`
|
||||
Type string `json:"type"`
|
||||
Source string `json:"source"`
|
||||
Status string `json:"status"`
|
||||
ProviderStatus string `json:"providerStatus,omitempty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
EventID string `json:"eventId,omitempty"`
|
||||
PayloadHash string `json:"payloadHash,omitempty"`
|
||||
Amount int64 `json:"amount,omitempty"`
|
||||
Currency string `json:"currency,omitempty"`
|
||||
OperatorID uint `json:"operatorId,omitempty"`
|
||||
OperatorName string `json:"operatorName,omitempty"`
|
||||
ClientIP string `json:"clientIp,omitempty"`
|
||||
UserAgent string `json:"userAgent,omitempty"`
|
||||
DeviceID string `json:"deviceId,omitempty"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
}
|
||||
|
||||
type PaymentCurrencySummaryResponse struct {
|
||||
Currency string `json:"currency"`
|
||||
OrderAmount int64 `json:"orderAmount"`
|
||||
PaidAmount int64 `json:"paidAmount"`
|
||||
RefundedAmount int64 `json:"refundedAmount"`
|
||||
SettlementAmount int64 `json:"settlementAmount"`
|
||||
NetAmount int64 `json:"netAmount"`
|
||||
}
|
||||
|
||||
type PaymentOrderSummaryResponse struct {
|
||||
OrderCount int64 `json:"orderCount"`
|
||||
PendingCount int64 `json:"pendingCount"`
|
||||
PaidCount int64 `json:"paidCount"`
|
||||
RefundedCount int64 `json:"refundedCount"`
|
||||
IssueCount int64 `json:"issueCount"`
|
||||
Currencies []*PaymentCurrencySummaryResponse `json:"currencies"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user