예제 #1
0
파일: server.py 프로젝트: zongxiao/unionpay
def main():
    tornado.options.parse_command_line()
    config = load_config(options.config)
    application = Application(
        config,
        notify_url=options.notify_url
    )
    http_server = tornado.httpserver.HTTPServer(application)
    http_server.listen(options.port)
    tornado.ioloop.IOLoop.instance().start()
예제 #2
0
파일: client.py 프로젝트: zongxiao/unionpay
def main():
    import sys
    from util.helper import load_config, make_order_id
    config = load_config(sys.argv[1])
    # pay
    # orderid = make_order_id('TESTPAY')
    # response = UnionpayWapClient(config).pay(
    #     25, orderid, front_url='http://zhouyang.me/front')

    # query
    # response = UnionpayClient(config).query(
    #     'TESTAUTH20151112160025',
    #     '20151112160025'
    # )

    # revoke
    # orderid = make_order_id('TESTREVOKE')
    # response = UnionpayClient(config).revoke(
    #     orderid,
    #     '201511121421433768498',
    #     20
    # )

    # refund
    # orderid = make_order_id('TESTREFUND')
    # response = UnionpayClient(config).refund(
    #     orderid,
    #     '201511121426015315048',
    #     '20151112142601',
    #     5
    # )

    # auth
    # orderid = make_order_id('TESTAUTH')
    # response = UnionpayWapClient(config).auth(
    #     1000,
    #     orderid,
    #     front_url='http://zhouyang.me/front'
    # )

    # auth_revoke
    # orderid = make_order_id('TESTAUTHREVOKE')
    # response = UnionpayClient(config).auth_revoke(
    #     orderid,
    #     '201511121509455397448',
    #     1000
    # )

    # auth_complete
    # orderid = make_order_id('TESTAUTHCOMPLETE')
    # print(orderid)
    # response = UnionpayClient(config).auth_complete(
    #     1000,
    #     orderid,
    #     '201511121600253932498'
    # )

    # auth_complete_revoke
    # orderid = make_order_id('TESTAUTHCCRE')
    # response = UnionpayClient(config).auth_complete_revoke(
    #     1000,
    #     orderid,
    #     '201511121602513936818'
    # )

    # file transfer
    response = UnionpayClient(config).file_transfer(
        file_type='00',
        settle_date='0119',
        merchant_id='700000000000001'
    )

    print('RES:%s' % response)
예제 #3
0
def main():
    import sys
    from util.helper import load_config, make_order_id
    config = load_config(sys.argv[1])
    # pay
    # orderid = make_order_id('TESTPAY')
    # response = UnionpayWapClient(config).pay(
    #     25, orderid, front_url='http://zhouyang.me/front')

    # query
    # response = UnionpayClient(config).query(
    #     'TESTAUTH20151112160025',
    #     '20151112160025'
    # )

    # revoke
    # orderid = make_order_id('TESTREVOKE')
    # response = UnionpayClient(config).revoke(
    #     orderid,
    #     '201511121421433768498',
    #     20
    # )

    # refund
    # orderid = make_order_id('TESTREFUND')
    # response = UnionpayClient(config).refund(
    #     orderid,
    #     '201511121426015315048',
    #     '20151112142601',
    #     5
    # )

    # auth
    # orderid = make_order_id('TESTAUTH')
    # response = UnionpayWapClient(config).auth(
    #     1000,
    #     orderid,
    #     front_url='http://zhouyang.me/front'
    # )

    # auth_revoke
    # orderid = make_order_id('TESTAUTHREVOKE')
    # response = UnionpayClient(config).auth_revoke(
    #     orderid,
    #     '201511121509455397448',
    #     1000
    # )

    # auth_complete
    # orderid = make_order_id('TESTAUTHCOMPLETE')
    # print(orderid)
    # response = UnionpayClient(config).auth_complete(
    #     1000,
    #     orderid,
    #     '201511121600253932498'
    # )

    # auth_complete_revoke
    # orderid = make_order_id('TESTAUTHCCRE')
    # response = UnionpayClient(config).auth_complete_revoke(
    #     1000,
    #     orderid,
    #     '201511121602513936818'
    # )

    # file transfer
    response = UnionpayClient(config).file_transfer(
        file_type='00', settle_date='0119', merchant_id='700000000000001')

    print('RES:%s' % response)