Esempio n. 1
0
 def put_pay(self, test_data, quick_id):
     """
     quick 2方支付, 支付订单
     :meth test_data: 测试数据 type: dict
     :meth quickid: quickpay_id type: str
     :return:
     """
     test_pay = Sub.SubmitPage(self.driver)
     log.info("----- 页面标题: %s -----" % self.driver.title)
     addr = self.gate.read_val(
         "gateway", "proj_domain") + self.gate.read_val("addr", "twopay")
     test_data.update({
         "提交地址": addr,
         "接口类型": "pay",
         "quickpay_id": quick_id
     })
     for item in test_data:
         tag_name = test_pay.update_info(item, test_data[item])
         if tag_name is not None:
             if tag_name.lower() == "select":
                 log.info("选择{}".format(item))
             elif tag_name.lower() == "input":
                 log.info("输入{}".format(item))
     log.info("点击 make payment")
     test_pay.click_submit("make payemnt")
 def put_create(self, test_data1=None, test_data2=None, payval=None):
     """
     quick 3方支付, 创建订单
     :meth test_data1: 测试数据, 交易信息 type: dict
     :meth test_data2: 测试数据, 支付信息 type: dict
     :meth payval: 支付域名列表 type: list
     :return:
     """
     if test_data1 is None:
         test_data1 = {}
     elif test_data2 is None:
         test_data2 = {}
     test_pay = Sub.SubmitPage(self.driver)
     log.info("----- quick 3方支付, 创建订单 -----")
     log.info("----- 页面标题: %s -----" % self.driver.title)
     addr = self.gate.read_val(
         "gateway", "proj_domain") + self.gate.read_val("addr", "thrcre")
     test_data1.update({"提交地址": addr, "接口类型": "create", "quickpay_id": ""})
     for item in test_data1:
         tag_name = test_pay.update_info(item, test_data1[item])
         if tag_name is not None:
             if tag_name.lower() == "select":
                 log.info("选择{}".format(item))
             elif tag_name.lower() == "input":
                 log.info("输入{}".format(item))
     log.info("点击 make payment")
     test_pay.click_submit("make payemnt")
     # 信用卡支付
     domain = re.findall(r"/\w+/\w+\.",
                         self.driver.current_url)[0].replace(".", "")
     for val in payval:
         for domain_conf in val[1].split(","):
             if domain == domain_conf.strip():
                 getattr(Pa.PayAction(self.driver), val[0])(test_data2)
                 break
Esempio n. 3
0
 def moto(self, test_data=None):
     """
     预授权
     :param test_data: 测试数据 type: dict
     """
     if test_data is None:
         test_data = {}
     test_pay = Sub.SubmitPage(self.driver)
     log.info("----- 页面标题: %s -----" % self.driver.title)
     addr = self.gate.read_val("gateway", "proj_domain") + self.gate.read_val("addr", "moto")
     test_data.update({"提交地址": addr})
     for item in test_data:
         tag_name = test_pay.update_info(item, test_data[item])
         if tag_name is not None:
             if tag_name.lower() == "select":
                 log.info("选择{}".format(item))
             elif tag_name.lower() == "input":
                 log.info("输入{}".format(item))
     log.info("点击 make payment")
     test_pay.click_submit("make payemnt")
 def create_trade(self, test_data1=None):
     """
     提交 3方支付
     :meth test_data1: 测试数据, 交易信息 type: dict
     :return:
     """
     if test_data1 is None:
         test_data1 = {}
     test_pay = Sub.SubmitPage(self.driver)
     log.info("----- 页面标题: %s -----" % self.driver.title)
     addr = self.gate.read_val("gateway", "proj_domain") + self.gate.read_val("addr", "thr")
     test_data1.update({"提交地址": addr})
     for item in test_data1:
         tag_name = test_pay.update_info(item, test_data1[item])
         if tag_name is not None:
             if tag_name.lower() == "select":
                 log.info("选择{}: {}".format(item, test_data1[item]))
             elif tag_name.lower() == "input":
                 log.info("输入{}: {}".format(item, test_data1[item]))
     log.info("点击 make payment")
     test_pay.click_submit("make payemnt")
Esempio n. 5
0
 def auth(self, test_data, pay_id, order_num):
     """
     预授权
     :param test_data: 测试数据 type: dict
     :param pay_id: 支付ID type: str
     :param order_num: 商户订单 type: str
     """
     if test_data is None:
         test_data = {}
     test_pay = Sub.SubmitPage(self.driver)
     log.info("----- 页面标题: %s -----" % self.driver.title)
     addr = self.gate.read_val("gateway", "proj_domain") + self.gate.read_val("addr", "auth")
     test_data.update({"提交地址": addr, "支付ID": pay_id, "商户订单": order_num})
     for item in test_data:
         tag_name = test_pay.update_info(item, test_data[item])
         if tag_name is not None:
             if tag_name.lower() == "select":
                 log.info("选择{}".format(item))
             elif tag_name.lower() == "input":
                 log.info("输入{}".format(item))
     log.info("点击确定")
     test_pay.click_submit("确定")
Esempio n. 6
0
 def put_two(self, test_data=None):
     """
     提交 2方支付
     :meth test_data: 测试数据 type: dict
     :return:
     """
     if test_data is None:
         test_data = {}
     test_pay = Sub.SubmitPage(self.driver)
     log.info("----- 页面标题: %s -----" % self.driver.title)
     str_two = self.gate.read_val("addr", "two").replace('"', '')
     addr = self.gate.read_val("gateway", "proj_domain") + str_two
     test_data.update({"提交地址": addr})
     for item in test_data:
         tag_name = test_pay.update_info(item, test_data[item])
         if tag_name is not None:
             if tag_name.lower() == "select":
                 log.info("选择{}".format(item))
             elif tag_name.lower() == "input":
                 log.info("输入{}".format(item))
     log.info("点击 make payment")
     test_pay.click_submit("make payemnt")
Esempio n. 7
0
 def put_track(self, test_data, pay_id):
     """
     提交物流信息上传
     :meth test_data: 提交地址选项值 type: dict
     :meth pay_id: 支付ID type: str
     :return:
     """
     if test_data is None:
         test_data = {}
     test_pay = Sub.SubmitPage(self.driver)
     log.info("----- 页面标题: %s -----" % self.driver.title)
     addr = self.check.read_val(
         "autocheck", "proj_domain") + self.check.read_val("addr", "track")
     test_data.update({"提交地址": addr, "支付ID": pay_id})
     for item in test_data:
         tag_name = test_pay.update_info(item, test_data[item])
         if tag_name is not None:
             if tag_name.lower() == "select":
                 log.info("选择{}".format(item))
             elif tag_name.lower() == "input":
                 log.info("输入{}".format(item))
     log.info("点击物流信息上传")
     test_pay.click_submit("物流信息上传")
Esempio n. 8
0
 def put_check(self, test_data, num):
     """
     提交对账
     :meth test_data: 测试数据 type: dict
     :meth num: 网站订单号 type: str
     :return:
     """
     if test_data is None:
         test_data = {}
     test_pay = Sub.SubmitPage(self.driver)
     log.info("----- 页面标题: %s -----" % self.driver.title)
     addr = self.check.read_val(
         "autocheck", "proj_domain") + self.check.read_val("addr", "check")
     test_data.update({"提交地址": addr, "网站订单号": num})
     for item in test_data:
         tag_name = test_pay.update_info(item, test_data[item])
         if tag_name is not None:
             if tag_name.lower() == "select":
                 log.info("选择{}".format(item))
             elif tag_name.lower() == "input":
                 log.info("输入{}".format(item))
     log.info("点击检索交易结果")
     test_pay.click_submit("检索交易结果")
Esempio n. 9
0
 def query_refund(self, test_data, ref_id):
     """
     查询退款信息
     :meth test_data: 测试数据 type: dict
     :meth ref_id: 退款ID type: str
     :return:
     """
     if test_data is None:
         test_data = {}
     test_pay = Sub.SubmitPage(self.driver)
     log.info("----- 页面标题: %s -----" % self.driver.title)
     addr = self.check.read_val("autocheck",
                                "proj_domain") + self.check.read_val(
                                    "addr", "query_ref")
     test_data.update({"提交地址": addr, "退款ID": ref_id})
     for item in test_data:
         tag_name = test_pay.update_info(item, test_data[item])
         if tag_name is not None:
             if tag_name.lower() == "select":
                 log.info("选择{}".format(item))
             elif tag_name.lower() == "input":
                 log.info("输入{}".format(item))
     log.info("点击退款查询")
     test_pay.click_submit("退款查询")