e nl-222 ol-222"> 222
+        goods_info = RoomGoodsInfo.objects.get(room_id=order.room_id, goods_id=order.goods_id, anchor_id=order.anchor_id)
223
+        goods_info.inventory += order.amount
224
+        goods_info.save()
225
+    except:
226
+        return
227
+
228
+@logit
229
+@transaction.atomic
230
+def notify_url_api(request):
231
+    """ 支付异步通知回调地址 """
232
+    notify_data, success = check_pay_notify(request.body, wx_configs=settings.WECHAT)
233
+    if not success:
234
+        return HttpResponse(WXPAY_NOTIFY_FAIL)
235
+
236
+    order = RoomOrderInfo.objects.select_for_update().get(order_id=notify_data.get('out_trade_no', ''), status=True)
237
+
238
+    order.notify_msg = request.body
239
+    order.transaction_id = notify_data.get('transaction_id', '')
240
+    order.save()
241
+
242
+    result_code = notify_data.get('result_code', '')
243
+    if result_code == 'SUCCESS':
244
+        live_views.order_paid_success(order)
245
+    else:
246
+        live_views.order_paid_fail(order)
247
+
248
+    return HttpResponse(WXPAY_NOTIFY_SUCCESS)

+ 16 - 10
pay/views.py

@@ -18,8 +18,11 @@ from account.models import UserInfo
18 18
 from goods.models import GoodsInfo, PackGoodsInfo, PackGoodsSaleInfo, PackInfo
19 19
 from kol.models import KOLInfo
20 20
 from pay.models import OrderInfo
21
+from live.models import RoomOrderInfo
21 22
 from utils.error.errno_utils import KOLStatusCode, OrderStatusCode, PackGoodsStatusCode, PackStatusCode, UserStatusCode
22 23
 
24
+from live import views as live_views
25
+
23 26
 
24 27
 WECHAT = settings.WECHAT
25 28
 
@@ -215,19 +218,22 @@ def wx_notify_url_api(request):
215 218
     if not success:
216 219
         return HttpResponse(WXPAY_NOTIFY_FAIL)
217 220
 
221
+    #尖货接龙订单
218 222
     try:
219 223
         order = OrderInfo.objects.select_for_update().get(order_id=notify_data.get('out_trade_no', ''), status=True)
220
-    except OrderInfo.DoesNotExist:
221
-        return HttpResponse(WXPAY_NOTIFY_FAIL)
224
+        order.notify_msg = request.body
225
+        order.transaction_id = notify_data.get('transaction_id', '')
226
+        order.save()
222 227
 
223
-    order.notify_msg = request.body
224
-    order.transaction_id = notify_data.get('transaction_id', '')
225
-    order.save()
228
+        result_code = notify_data.get('result_code', '')
229
+        if result_code == 'SUCCESS':
230
+            order_paid_success(order)
231
+        else:
232
+            order_paid_fail(order)
233
+        
234
+        return HttpResponse(WXPAY_NOTIFY_SUCCESS)
235
+    except:
236
+        return HttpResponse(WXPAY_NOTIFY_FAIL)
226 237
 
227
-    result_code = notify_data.get('result_code', '')
228
-    if result_code == 'SUCCESS':
229
-        order_paid_success(order)
230
-    else:
231
-        order_paid_fail(order)
232 238
 
233 239
     return HttpResponse(WXPAY_NOTIFY_SUCCESS)

lensman - Gogs: Go Git Service

Няма описание

chengzhenyu: f4c7901669 热修复框架 преди 9 години
..
commons-lang-2.6.jar 5b2b05624a session activity when debugging преди 9 години
gprintersdkv2.1.4.jar 5b2b05624a session activity when debugging преди 9 години
hotpatch_framework.jar f4c7901669 热修复框架 преди 9 години
jcc-bate-0.7.3.jar 5b2b05624a session activity when debugging преди 9 години
libammsdk.jar 31a4158013 weixin login преди 9 години
universal-image-loader-1.9.4.jar b3c70a53c5 update main page преди 9 години
zxing.jar 30b119f214 first commit преди 9 години