Example #1
0
from SHDY.Public import data, conf

seqo = data.Mock().get_time()
print(seqo)
# merid = data.Data().Data_merchants()['HH快速商户']
# merid = data.Data().Data_merchants()['HH小微商户']
merid = data.Data().Data_merchants()['HH标准商户']

bar_code = '287569781775576805'
pay_amount = '1'
#以一下字段确认跳码
pick_mer_id = data.Data().Data_merchants()['HH池商户']
pick_term_no = '08000181'
# pick_mer_id = "872103658120708"     #872103658120708  872290476920001
# pick_term_no = '08231616'           #08231616  08000493
conf.Config().set_param('外部订单号', str(seqo))

url = 'http://192.168.31.161:18380/transaction_agent/scan/trans'
date = {
    "head": {
        "merc_id": merid,
        "pick_mer_id": pick_mer_id,
        "pick_term_no": pick_term_no,
        "station_info": "116.231280,40.220770&上海市浦东新区",  #跳码商户
        "trm_id": "08231257",
        "org_id": "101",
        "sign":
        "Pkb9ZbxckUGvCU6BKafhBFm5U8hM5EWqRe6Ys09SSn2LkHYZpLmcJCchNfgAT8Gi0/aweZ8peSDu2BziNrLuj5HE6dgnbIsKPXy5jjduzzHv5oqAU7aXarDdBxcDRSrKPZOpZGTG80zgHJKMkRkpjpEMHr53A/nw79pbqVkwSf4=",
        "dev_typ": "3",
        "ios_typ": "IOS",
        "ios_ver": "ios9.0",
Example #2
0
# _*_ coding: utf-8 _*_
# 作者    : 一蓑烟雨任平生
# 创建时间 : 2020/1/2 18:27
import requests, json
from SHDY.Public import conf, data

mer_order_no = data.Mock().get_card_number()
print(mer_order_no)
bar_code = '134629715973960295'
pay_type = '01'  #支付方式  01 微信   02支付宝
merc_id = '872112378410001'
pay_amount = '1'  #金额(分)
conf.Config().set_param("mer_order_no", str(mer_order_no))

url = 'http://192.168.31.161:28380/test_agent/testScan/getSign'
data = {
    "body": {
        "trancde": "P00",
        "mer_order_no": mer_order_no,
        "pay_amount": pay_amount,
        "order_name": "testName",
        "pay_type": pay_type,
        "bar_code": bar_code
    },
    "head": {
        "trm_sn": "061310000003",
        "imei": "061310000003",
        "merc_id": merc_id,
        "trm_id": "08001435",
        "org_id": '125',
        "send_time": "20190813195059",
ch.find_element_by_id('MerchantCertPass').clear()
ch.find_element_by_id('MerchantCertPass').send_keys(data.Data_password()[uat])
ch.find_element_by_xpath(
    '//html/body/center/form/table/tbody/tr[4]/td/input').click()
'''标准支付接口'''
ch.find_element_by_xpath(
    '//html/body/center/form/table/tbody/tr[45]/td/a').click()
time.sleep(1)
ch.find_element_by_xpath\
    ('/html/body/form/center/table/tbody/tr[6]/td[2]/input').clear()
ch.find_element_by_xpath\
    ('/html/body/form/center/table/tbody/tr[6]/td[2]/input').send_keys('1')

orderId = ch.find_element_by_xpath\
    ('/html/body/form/center/table/tbody/tr[4]/td[2]/input').get_attribute('value')
conf.Config().set_param(uat + '标准个人网银借记卡支付', orderId)

#提交
ch.find_element_by_xpath('//*[@id="Submit"]').click()
time.sleep(3)
ch.find_element_by_xpath(
    '/html/body/jspfile/div[5]/div[2]/div/div[1]/ul/li[2]/a').click()
ch.find_element_by_xpath('//*[@id="personalPayment"]/li[2]/img').click()
ch.find_element_by_xpath('//*[@id="personalPayment"]/li[2]/div/a[1]').click()
#00  对应借记卡 01贷记卡 05企业网银
#个人网银
ch.switch_to_window(ch.window_handles[1])
time.sleep(2)
# ch.switch_to_frame(ch.find_element_by_id('form-242'))

ch.find_element_by_id('pyerAcctTp').send_keys(00)
Example #4
0
     '//html/body/form/center/table/tbody/tr[4]/td[2]/input').clear()
 ch.find_element_by_xpath('//html/body/form/center/table/tbody/tr[4]/td[2]/input')\
     .send_keys(date.Other()['platSource'])#平台标识platSource
 ch.find_element_by_xpath(
     '//html/body/form/center/table/tbody/tr[5]/td[2]/input').clear()
 ch.find_element_by_xpath('//html/body/form/center/table/tbody/tr[5]/td[2]/input')\
     .send_keys(usrNo)
 ch.find_element_by_xpath(
     '//html/body/form/center/table/tbody/tr[7]/td[2]/input').clear()
 ch.find_element_by_xpath('//html/body/form/center/table/tbody/tr[7]/td[2]/input')\
     .send_keys('1')
 if i == 0:
     orderId=ch.find_element_by_xpath\
         ('/html/body/form/center/table/tbody/tr[3]/td[2]/input')\
           .get_attribute('value')
     conf.Config().set_param(uat + "标准借记卡快捷支付-建行", orderId)
     log.info(uat + "标准借记卡快捷支付:\n%s" % orderId)
     ch.find_element_by_id('Submit').click()  # 提交
     time.sleep(5)
     ch.find_element_by_xpath('//*[@id="app"]/div[2]/div[4]/div/div[2]/div/input') \
         .send_keys(date.card_number()['马敬宾'])
     ch.find_element_by_xpath('//*[@id="app"]/div[2]/div[6]/button').click()
     time.sleep(3)
     ch.find_element_by_xpath('//div[@id="app"]/div[2]/div[2]/div[2]/div[2]/div/input') \
         .send_keys('马敬宾')
     ch.find_element_by_xpath('//div[@id="app"]/div[2]/div[2]/div[3]/div[2]/div/input') \
         .send_keys(date.Idcard()['马敬宾'])
     ch.find_element_by_xpath('//*[@id="app"]/div[2]/div[2]/div[4]/div[2]/div/input') \
         .send_keys(date.Username()['马敬宾'])
     time.sleep(1)
     ch.find_element_by_xpath(
Example #5
0
# -*- coding: utf-8 -*-
import time, unittest
from SHDY.Public import data_url, data, log, conf

url = data_url.Url().url()
data = data.Data()
config = conf.Config()
uat = 'sit'

for i in range(3):
    dr = data_url.Driver().driver()
    dr.get(url[uat])
    dr.implicitly_wait(5)
    dr.find_element_by_id('MercId').clear()
    dr.find_element_by_id('MercId').send_keys(data.Data_merchants()[uat +
                                                                    '商户'])
    dr.find_element_by_id('MerchantCertPass').clear()
    dr.find_element_by_id('MerchantCertPass').send_keys(
        data.Data_password()[uat])
    dr.find_element_by_xpath(
        '//html/body/center/form/table/tbody/tr[4]/td/input').click()
    #点击  商户btb收款
    dr.find_element_by_xpath(
        '//html/body/center/form/table/tbody/tr[24]/td/a').click()
    time.sleep(1)
    dr.find_element_by_id('rcvMerchantId')\
        .send_keys(data.Data_merchants()[uat+'商户'])
    dr.find_element_by_id('totalAmount').clear()
    dr.find_element_by_id('totalAmount').send_keys('1')
    dr.find_element_by_id('payAmount').clear()
    dr.find_element_by_id('payAmount').send_keys('1')
Example #6
0
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# 作者   : Lenovo
# 时间   : 2020/5/21 14:37
import time,re
from selenium.webdriver.support.select import Select
from SHDY.Public import data_url, data,conf
date = data.Data()
url = data_url.Url().url()
config = conf.Config()
uat = 'sit'

for i in range(3):
    ch = data_url.Driver().driver()
    ch.get(url[uat])
    ch.implicitly_wait(5)
    ch.find_element_by_id('MercId').clear()
    ch.find_element_by_id('MercId').send_keys(date.Data_merchants()[uat+'商户'])
    ch.find_element_by_id('MerchantCertPass').clear()
    ch.find_element_by_id('MerchantCertPass').send_keys(date.Data_password()[uat+'张卫'])

    ch.find_element_by_xpath('//html/body/center/form/table/tbody/tr[4]/td/input').click()
    #交易
    ch.find_element_by_xpath('//html/body/center/form/table/tbody/tr[11]/td/a').click()
    time.sleep(1)
    select =Select(ch.find_element_by_xpath
                  ('/html/body/form/center/table/tbody/tr[2]/td[2]/select'))
    if i == 0:
        select.select_by_visible_text('微信公众号')
        ch.find_element_by_xpath\
            ('//html/body/form/center/table/tbody/tr[4]/td[2]/input')\
# -*- coding: utf-8 -*-
import time
from SHDY.Public import data_url, data, log, conf
from selenium.webdriver.common.keys import Keys
url = data_url.Url().url()
data = data.Data()
config = conf.Config()
dr = data_url.Driver().driver()
uat = 'sit'
dr.get(url[uat])

dr.implicitly_wait(5)
dr.find_element_by_id('MercId').clear()
dr.find_element_by_id('MercId').send_keys(data.Data_merchants()[uat + '商户'])
dr.find_element_by_id('MerchantCertPass').clear()
dr.find_element_by_id('MerchantCertPass').send_keys(data.Data_password()[uat])
#重置
dr.find_element_by_xpath(
    '/html/body/center/form/table/tbody/tr[4]/td/input').click()
dr.find_element_by_xpath(
    '/html/body/center/form/table/tbody/tr[30]/td/a').click()
#订单
orderId = dr.find_element_by_id('orderId').get_attribute('value')
conf.Config().set_param(uat + "H5个人网银支付", orderId)

dr.find_element_by_id('rcvMerchantId').clear()
dr.find_element_by_id('rcvMerchantId').send_keys(data.Data_merchants()[uat +
                                                                       '商户'])
dr.find_element_by_id('recEnterpriseId').clear()
dr.find_element_by_id('recEnterpriseId').send_keys(data.Data_merchants()[uat +
                                                                         '商户'])