def call_run(self): status = str(self.data.get("ret_code")) signature = self.data.pop('signature', False) self.data = self.data.get("biz_content") print(self.data) print(type(self.data)) self.check_sign(signature) # self.data["payment_fee"] = float(self.data.get("payment_fee")) / 100.0 if not self.data.get( "mch_id") or self.data.get("mch_id") != self.businessId: raise PubErrorCustom("商户ID不存在!") if not self.data.get("payment_fee"): raise PubErrorCustom("金额不能为空!") if not self.data.get("out_order_no"): raise PubErrorCustom("商户订单号为空!") if status == '0': try: order = Order.objects.select_for_update().get( ordercode=self.data.get("out_order_no")) except Order.DoesNotExist: raise PubErrorCustom("订单号不正确!") if order.status == '0': raise PubErrorCustom("订单已处理!") PayCallLastPass().run(order=order)
def call_run(self): self.check_sign() if not self.data.get("businessId") or self.data.get( "businessId") != self.businessId: raise PubErrorCustom("商户ID不存在!") if not self.data.get("amount"): raise PubErrorCustom("金额不能为空!") if not self.data.get("signType") or self.data.get("signType") != 'MD5': raise PubErrorCustom("签名类型不正确") if not self.data.get("outTradeNo"): raise PubErrorCustom("商户订单号为空!") if not self.data.get("orderState"): raise PubErrorCustom("订单状态为空!") if self.data.get("orderState") == 'success': try: order = Order.objects.select_for_update().get( ordercode=self.data.get("outTradeNo")) except Order.DoesNotExist: raise PubErrorCustom("订单号不正确!") if order.status == '0': raise PubErrorCustom("订单已处理!") PayCallLastPass().run(order=order)
def order_status_upd(self, request, *args, **kwargs): if self.request.data_format.get("orders") and len( self.request.data_format.get("orders")) > 1: raise PubErrorCustom("手工上分只允许单笔操作!") if len(self.request.data_format.get("orders")): try: order = Order.objects.select_for_update().get( ordercode=self.request.data_format.get("orders")[0]) except Order.DoesNotExist: raise PubErrorCustom("订单号不存在!") if order.status == '0': raise PubErrorCustom("请勿重复补单!") else: raise PubErrorCustom("订单号不能为空") if order.paypass in (0, 1): if order.qr_type == 'QR001': PayCallWechat().handwork_run(order=order) elif order.qr_type == 'QR005': PayCallFlm().handwork_run(order=order) elif order.qr_type == 'QR010': PayCallNxys().handwork_run(order=order) elif order.qr_type == 'QR015': PayCallJyys().handwork_run(order=order) elif order.qr_type == 'QR020': PayCallZjnx().handwork_run(order=order) else: PayCallLastPass().handwork_run(order=order)
def call_run(self): self.check_sign() if not self.data.get("money"): raise PubErrorCustom("金额不能为空!") if not self.data.get("orderid"): raise PubErrorCustom("商户订单号为空!") if self.data.get("status") == '1': try: order = Order.objects.select_for_update().get( ordercode=self.data.get("orderid")) except Order.DoesNotExist: raise PubErrorCustom("订单号不正确!") if order.status == '0': raise PubErrorCustom("订单已处理!") PayCallLastPass().run(order=order)
def call_run(self): self.check_sign() if not self.data.get("total"): raise PubErrorCustom("金额不能为空!") if not self.data.get("api_order_sn"): raise PubErrorCustom("商户订单号为空!") if self.data.get("callbacks") == 'CODE_SUCCESS': try: order = Order.objects.select_for_update().get( ordercode=self.data.get("api_order_sn")) except Order.DoesNotExist: raise PubErrorCustom("订单号不正确!") if order.status == '0': raise PubErrorCustom("订单已处理!") PayCallLastPass().run(order=order)
def call_run(self): if not self.data.get("total_fee"): raise PubErrorCustom("金额不能为空!") if not self.data.get("out_order_no"): raise PubErrorCustom("商户订单号为空!") self.check_sign() if self.data.get("trade_status") == 'TRADE_SUCCESS': try: order = Order.objects.select_for_update().get( ordercode=self.data.get("out_order_no")) except Order.DoesNotExist: raise PubErrorCustom("订单号不正确!") if order.status == '0': raise PubErrorCustom("订单已处理!") PayCallLastPass().run(order=order)
def order_status_upd(self, request, *args, **kwargs): if self.request.data_format.get("orders") and len( self.request.data_format.get("orders")) > 1: raise PubErrorCustom("手工上分只允许单笔操作!") if len(self.request.data_format.get("orders")): try: order = Order.objects.select_for_update().get( ordercode=self.request.data_format.get("orders")[0]) except Order.DoesNotExist: raise PubErrorCustom("订单号不存在!") if order.status == '0': raise PubErrorCustom("请勿重复补单!") else: raise PubErrorCustom("订单号不能为空") PayCallLastPass().handwork_run(order=order)
def call_run(self): self.check_sign() if not self.data.get("amount"): raise PubErrorCustom("金额不能为空!") if not self.data.get("mchOrderNo"): raise PubErrorCustom("商户订单号为空!") self.data["amount"] = float(self.data.get("amount")) / 100.0 if str(self.data.get("status")) == '2': try: order = Order.objects.select_for_update().get( ordercode=self.data.get("mchOrderNo")) except Order.DoesNotExist: raise PubErrorCustom("订单号不正确!") if order.status == '0': raise PubErrorCustom("订单已处理!") PayCallLastPass().run(order=order)
def call_run(self): self.check_sign() if not self.data.get( "memberid") or self.data.get("memberid") != self.businessId: raise PubErrorCustom("商户ID不存在!") if not self.data.get("amount"): raise PubErrorCustom("金额不能为空!") if not self.data.get("orderid"): raise PubErrorCustom("商户订单号为空!") if self.data.get("returncode") == '00': try: order = Order.objects.select_for_update().get( ordercode=self.data.get("orderid")) except Order.DoesNotExist: raise PubErrorCustom("订单号不正确!") if order.status == '0': raise PubErrorCustom("订单已处理!") PayCallLastPass().run(order=order)