作废链接和取消订单
This commit is contained in:
@@ -24,6 +24,10 @@ func (s *DeliveryService) authorizeDeliveryLink(order *model.FulfillmentOrder, a
|
||||
if order.DeliveryLinkRevokedAt != nil {
|
||||
return newDeliveryHTTPError(http.StatusForbidden, "发货链接已作废")
|
||||
}
|
||||
// 订单已取消后链接立即失效,防止已退款订单仍通过链接查看或继续发货。
|
||||
if normalizeOrderStatus(order) == model.OrderStatusCancelled {
|
||||
return newDeliveryHTTPError(http.StatusForbidden, "订单已取消,发货链接不可用")
|
||||
}
|
||||
if order.DeliveryLinkExpiresAt == nil {
|
||||
return newDeliveryHTTPError(http.StatusForbidden, "发货链接未生成")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user