MCPcopy Create free account
hub / github.com/53AI/53AIHub / getCachedOrder

Function getCachedOrder

api/controller/pay.go:197–210  ·  view source on GitHub ↗

Cache order data func cacheOrderData(order *model.Order) { orderData, _ := json.Marshal(order) common.RedisSet(order.OrderId, string(orderData), 2*time.Hour) } Get cached order data

(orderId string)

Source from the content-addressed store, hash-verified

195
196// Get cached order data
197func getCachedOrder(orderId string) (*model.Order, bool) {
198 data, err := common.RedisGet(orderId)
199 if err != nil || data == "" {
200 return nil, false
201 }
202
203 var order model.Order
204 err = json.Unmarshal([]byte(data), &order)
205 if err != nil {
206 return nil, false
207 }
208
209 return &order, true
210}
211
212// Remove cached order data
213func removeCachedOrder(orderId string) {

Callers 4

WechatPayNotifyFunction · 0.85
QueryOrderStatusFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected