示例#1
0
def _weixin_pay_params(payment_type, payment_entity, extra_params=None):
    from . import config
    from api_x.config import weixin_pay
    from api_x.zyt.evas.weixin_pay.payment import payment_param

    # payment_type中包含了wx_name, 使用在app支付的情况
    payment_type, info = config.get_pure_payment_type_and_info(payment_type)
    if info is None:
        app_config = weixin_pay.AppConfig()
    else:
        wx_name = info
        app_config = weixin_pay.AppConfig(wx_name)

    params = payment_param(payment_type,
                           payment_entity.source,
                           app_config,
                           payment_entity.tx_sn,
                           int(100 * payment_entity.amount),
                           req.ip(),
                           payment_entity.product_name,
                           payment_entity.tx_created_on,
                           detail=payment_entity.product_desc,
                           extra_params=extra_params)
    if '_info' in params:
        params['_info'] = payment_entity.dict()
    return params
示例#2
0
def _lianlian_pay_params(payment_type, payment_entity):
    from api_x.zyt.evas.lianlian_pay import payment_param

    return payment_param(payment_type, payment_entity.source,
                         payment_entity.user_id,
                         payment_entity.user_created_on, req.ip(),
                         payment_entity.tx_sn, payment_entity.tx_created_on,
                         payment_entity.product_name,
                         payment_entity.product_desc, payment_entity.amount)
示例#3
0
def _pay_by_zyt_pay(payment_type, payment_entity):
    from api_x.zyt.vas import payment_param

    return payment_param(payment_type, payment_entity.source,
                         payment_entity.tx_sn)
示例#4
0
def _ali_pay_params(payment_type, payment_entity):
    from api_x.zyt.evas.ali_pay import payment_param

    return payment_param(payment_type, payment_entity.source,
                         payment_entity.tx_sn, payment_entity.product_name,
                         payment_entity.product_desc, payment_entity.amount)
示例#5
0
def _test_pay_params(payment_type, payment_entity):
    from api_x.zyt.evas.test_pay import payment_param

    return payment_param(payment_type, payment_entity.source,
                         payment_entity.user_id, payment_entity.tx_sn,
                         payment_entity.product_name, payment_entity.amount)