Esempio n. 1
0
def asoc_country_with_money(id_country, id_money):
    user_id = get_jwt_identity()
    res = None
    try:
        custom_res = dict()
        custom_res['id_user'] = get_jwt_identity()
        params = dict()
        kwargs = get_kwargs(request, id_country, id_money)
        if request.method == "POST":
            if kwargs:
                res = connection.get_list_queryset_sp(sp_name='sp_tmp',
                                                      **kwargs)
            else:
                custom_res['data'] = str(res)
                custom_res['code'] = 200 if res else 500
                raise ValueError(500)
        else:
            merge, msg = sanitizer(base=params,
                                   data=request.json,
                                   types=CountryMoney)
            if msg is not True:
                custom_res['data'] = str(res)
                custom_res['code'] = 400
                raise ValueError(400)
    except ValueError:
        log.error("")
    finally:
        register_logger(rekuest=request, response=custom_res)
    return jsonify(res) if res else abort(500)
Esempio n. 2
0
def payments():
    """
    :return:
    """
    custom_res = dict()
    kwargs = get_kwargs(request)
    if kwargs:
        res = get_list_queryset_sp(sp_name='sp_list_payment_method_all',
                                   pagination=True,
                                   **kwargs)
        custom_res['data'] = str(res)
        custom_res['code'] = 200 if res else 500
        register_logger(rekuest=request, response=custom_res)
        return jsonify(res) if res else abort(500)
    abort(500)
Esempio n. 3
0
def payments_per_moneycountry(id_money, id_country):
    """
    :param id_money:
    :param id_country:
    :return:
    """
    custom_res = dict()
    kwargs = get_kwargs(request, id_money, id_country)
    if kwargs:
        res = get_list_queryset_sp(sp_name='sp_list_payment_method',
                                   pagination=True,
                                   **kwargs)
        custom_res['data'] = str(res)
        custom_res['code'] = 200 if res else 500
        register_logger(rekuest=request, response=custom_res)
        return jsonify(res) if res else abort(500)
    abort(500)
Esempio n. 4
0
def countries_per_money(id_money):
    """
    :param id_money: ID moneda para filtrar la lista de paises asociados --ok
    :return:
    """
    custom_res = dict()
    kwargs = get_kwargs(
        request,
        id_money,
    )
    if kwargs:
        res = get_list_queryset_sp(sp_name='sp_list_country',
                                   pagination=True,
                                   **kwargs)
        custom_res['data'] = str(res)
        custom_res['code'] = 200 if res else 500
        register_logger(rekuest=request, response=custom_res)
        return jsonify(res) if res else abort(500)
    abort(500)
Esempio n. 5
0
def deposit_per_platform(platform):
    """
    :param platform:
    :return:
    """
    custom_res = dict()
    custom_res['id_user'] = get_jwt_identity()
    kwargs = get_kwargs(
        request,
        platform,
    )
    if kwargs:
        res = connection.get_list_queryset_sp(sp_name='sp_list_payment_method',
                                              **kwargs)
        custom_res['data'] = str(res)
        custom_res['code'] = 200 if res else 500
        register_logger(rekuest=request, response=custom_res)
        return jsonify(res) if res else abort(500)
    abort(500)
Esempio n. 6
0
def deposit_per_platformmoneycountrypaymentcollectorstatus(
        platform, id_money, id_country, id_payment, id_collect, status):
    """
    :param platform:
    :param id_money:
    :param id_country:
    :param id_payment:
    :param id_collect:
    :param status:
    :return:
    """
    custom_res = dict()
    custom_res['data'] = ''
    custom_res['code'] = 200

    try:
        kwargs = get_kwargs(request, get_jwt_identity(), id_money, status,
                            id_country, id_payment, id_collect)
        if kwargs:
            res = connection.get_list_queryset_sp(
                sp_name='sp_listar_depositos', **kwargs)
            if res:
                custom_res['data'] = res
                custom_res['code'] = 200
            else:
                custom_res['data'] = build_msg_dict(error_code=404,
                                                    msg='error sp')
                custom_res['code'] = 404
                raise ValueError(404)
        else:
            custom_res['data'] = build_msg_dict(error_code=500,
                                                msg='error kwargs')
            custom_res['code'] = 500
            raise ValueError(500)

    except ValueError:
        log.error("Exception on deposits_cancel_delay - code:{}".format(
            sys.exc_info()[1].args[0]))
    finally:
        register_logger(rekuest=request, response=custom_res)

    return jsonify(custom_res['data']), custom_res['code']
Esempio n. 7
0
def payment_instructions_per_moneycountrypaymentcollector(
        id_money, id_country, id_payment, id_collect, id_lang):
    """
    :param id_money:
    :param id_country:
    :param id_payment:
    :param id_collect:
    :param id_lang:
    :return:
    """
    custom_res = dict()
    kwargs = get_kwargs(request, id_money, id_country, id_collect, id_payment,
                        id_lang)
    if kwargs:
        res = get_list_queryset_sp(sp_name='sp_list_info_pago_05',
                                   pagination=True,
                                   **kwargs)
        custom_res['data'] = str(res)
        custom_res['code'] = 200 if res else 500
        register_logger(rekuest=request, response=custom_res)
        return jsonify(res) if res else abort(500)
    abort(500)