(self, request=None, dt2py=False, **kwargs)
return rv
调用统一下单接口的参数
        :param attach: 附加数据
        :param kwargs: 覆盖默认生成的数据
        :param dt2py: 将请求微信的datetime格式转换为python的datetime格式
调用统一下单接口的参数
        :param attach: 附加数据
        :param kwargs: 覆盖默认生成的数据
        :param dt2py: 将请求微信的datetime格式转换为python的datetime格式
调用统一下单接口的参数 : param attach : 附加数据 : param kwargs : 覆盖默认生成的数据 : param dt2py : 将请求微信的datetime格式转换为python的datetime格式
def call_args(self, request=None, dt2py=False, **kwargs):
        """调用统一下单接口的参数
        :param attach: 附加数据
        :param kwargs: 覆盖默认生成的数据
        :param dt2py: 将请求微信的datetime格式转换为python的datetime格式
        """
        # 更新ip
        self.spbill_create_ip = kwargs.pop(
            "client_ip",
            get_ip(request) or self.spbill_create_ip or get_external_ip())
        if self._call_args:
            self._call_args["client_ip"] = self.spbill_create_ip
        else:
            self.time_start = kwargs.pop("time_start", self.time_start)
            self.time_expire = kwargs.pop("time_expire", self.time_expire)
            # 显式设置起止时间
            if not self.time_start:
                self.time_start = self.created_at
            if not self.time_expire:
                self.time_expire = self.created_at + datetime.timedelta(hours=2)
            # 构建call_args并缓存
            notify_url = self.pay.app.build_url(
                "order_notify", request=request,
                kwargs=dict(payname=self.pay.name), absolute=True)
            self._call_args = dict(
                trade_type=self.trade_type,
                body=self.body,
                total_fee=self.total_fee,
                notify_url=notify_url,
                client_ip=self.spbill_create_ip,
                user_id=self.openid,
                out_trade_no=self.out_trade_no,
                detail=self.detail,
                fee_type=self.fee_type,
                time_start=PayDateTimeField.dt2str(self.time_start),
                time_expire=PayDateTimeField.dt2str(self.time_expire),
                goods_tag=self.goods_tag,
                product_id=self.product_id,
                device_info=self.device_info,
                limit_pay=self.limit_pay,
                scene_info=self.scene_info,
                sub_user_id=self.sub_openid,
                receipt=self.receipt
            )
            self._call_args.update(kwargs)
        self.save()

        rv = self._call_args.copy()
        if dt2py:
            # 将时间重新to_python
            rv["time_start"] = PayDateTimeField.str2dt(rv["time_start"])
            rv["time_expire"] = PayDateTimeField.str2dt(rv["time_expire"])
        return rv
def call_args ( self , request = None , dt2py = False , * * kwargs ) : # 更新ip self . spbill_create_ip = kwargs . pop ( "client_ip" , get_ip ( request ) or self . spbill_create_ip or get_external_ip ( ) ) if self . _call_args : self . _call_args [ "client_ip" ] = self . spbill_create_ip else : self . time_start = kwargs . pop ( "time_start" , self . time_start ) self . time_expire = kwargs . pop ( "time_expire" , self . time_expire ) # 显式设置起止时间 if not self . time_start : self . time_start = self . created_at if not self . time_expire : self . time_expire = self . created_at + datetime . timedelta ( hours = 2 ) # 构建call_args并缓存 notify_url = self . pay . app . build_url ( "order_notify" , request = request , kwargs = dict ( payname = self . pay . name ) , absolute = True ) self . _call_args = dict ( trade_type = self . trade_type , body = self . body , total_fee = self . total_fee , notify_url = notify_url , client_ip = self . spbill_create_ip , user_id = self . openid , out_trade_no = self . out_trade_no , detail = self . detail , fee_type = self . fee_type , time_start = PayDateTimeField . dt2str ( self . time_start ) , time_expire = PayDateTimeField . dt2str ( self . time_expire ) , goods_tag = self . goods_tag , product_id = self . product_id , device_info = self . device_info , limit_pay = self . limit_pay , scene_info = self . scene_info , sub_user_id = self . sub_openid , receipt = self . receipt ) self . _call_args . update ( kwargs ) self . save ( ) rv = self . _call_args . copy ( ) if dt2py : # 将时间重新to_python rv [ "time_start" ] = PayDateTimeField . str2dt ( rv [ "time_start" ] ) rv [ "time_expire" ] = PayDateTimeField . str2dt ( rv [ "time_expire" ] ) return rv