Beispiel #1
0
    def success(self, payOrder):
        """
        支付成功
        by: 范俊伟 at:2015-03-07
        修改支付处理
        by: 王健 at:2015-03-17
        """
        update = (
            Order.objects.filter(id=self.id)
            .exclude(status=STATUS_SUCCESS)
            .update(
                pay_date=payOrder.close_time,
                pay_type=payOrder.pay_type,
                trade_no=payOrder.trade_no,
                payer_bank_account=payOrder.payer_bank_account,
                into_bank_account=payOrder.into_bank_account,
                status=STATUS_SUCCESS,
            )
        )
        if update:
            projectRechargeRecord = ProjectRechargeRecord()
            projectRechargeRecord.project = self.project
            projectRechargeRecord.date = payOrder.close_time
            projectRechargeRecord.order_id = self.id
            projectRechargeRecord.price0 = self.product.gold
            projectRechargeRecord.price_type = 0
            projectRechargeRecord.save(user_id=self.user_id)

            if hasattr(self, "contract"):
                from ns_manage.models import CONTRACT_STATUS_PAYED_ARRIVED

                contract = self.contract
                contract.status = CONTRACT_STATUS_PAYED_ARRIVED
                contract.save()
Beispiel #2
0
    def success(self, payOrder):
        """
        支付成功
        by: 范俊伟 at:2015-03-07
        修改支付处理
        by: 王健 at:2015-03-17
        """
        update = Order.objects.filter(id=self.id).exclude(
            status=STATUS_SUCCESS).update(
                pay_date=payOrder.close_time,
                pay_type=payOrder.pay_type,
                trade_no=payOrder.trade_no,
                payer_bank_account=payOrder.payer_bank_account,
                into_bank_account=payOrder.into_bank_account,
                status=STATUS_SUCCESS)
        if update:
            projectRechargeRecord = ProjectRechargeRecord()
            projectRechargeRecord.project = self.project
            projectRechargeRecord.date = payOrder.close_time
            projectRechargeRecord.order_id = self.id
            projectRechargeRecord.price0 = self.product.gold
            projectRechargeRecord.price_type = 0
            projectRechargeRecord.save(user_id=self.user_id)

            if hasattr(self, 'contract'):
                from ns_manage.models import CONTRACT_STATUS_PAYED_ARRIVED

                contract = self.contract
                contract.status = CONTRACT_STATUS_PAYED_ARRIVED
                contract.save()
Beispiel #3
0
def add_price_2_project(request):
    """
    测试充值
    by:王健 at:2015-05-08
    :param request:
    :return:
    """
    if settings.ENVIRONMENT != 'aliyun':
        pr = ProjectRechargeRecord()
        pr.project = Project.objects.get(pk=49)
        pr.date = timezone.now()
        pr.order_id = None
        pr.price0 = 10
        pr.price_type = 1
        pr.save(sysmessage=1)
    return HttpResponse("success")
Beispiel #4
0
def add_price_2_project(request):
    """
    测试充值
    by:王健 at:2015-05-08
    :param request:
    :return:
    """
    if settings.ENVIRONMENT != 'aliyun':
        pr = ProjectRechargeRecord()
        pr.project = Project.objects.get(pk=49)
        pr.date = timezone.now()
        pr.order_id = None
        pr.price0 = 10
        pr.price_type = 1
        pr.save(sysmessage=1)
    return HttpResponse("success")