当前位置: 首页>>代码示例>>Python>>正文


Python ProviderHelper.prepare_notice方法代码示例

本文整理汇总了Python中lib.solitude.api.ProviderHelper.prepare_notice方法的典型用法代码示例。如果您正苦于以下问题:Python ProviderHelper.prepare_notice方法的具体用法?Python ProviderHelper.prepare_notice怎么用?Python ProviderHelper.prepare_notice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lib.solitude.api.ProviderHelper的用法示例。


在下文中一共展示了ProviderHelper.prepare_notice方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: error

# 需要导入模块: from lib.solitude.api import ProviderHelper [as 别名]
# 或者: from lib.solitude.api.ProviderHelper import prepare_notice [as 别名]
def error(request, provider_name):
    provider = ProviderHelper(provider_name)
    if provider.name != 'reference':
        raise NotImplementedError(
            'only the reference provider is implemented so far')

    try:
        provider.prepare_notice(request)
    except msg.DevMessage as m:
        return system_error(request, code=m.code)

    # TODO: handle user cancellation, bug 957774.

    log.error('Fatal payment error for {provider}: {code}; query string: {qs}'
              .format(provider=provider.name,
                      code=request.GET.get('ResponseCode'),
                      qs=request.GET))
    return system_error(request, code=msg.EXT_ERROR)
开发者ID:JaredKerim-Mozilla,项目名称:webpay,代码行数:20,代码来源:views.py

示例2: success

# 需要导入模块: from lib.solitude.api import ProviderHelper [as 别名]
# 或者: from lib.solitude.api.ProviderHelper import prepare_notice [as 别名]
def success(request, provider_name):
    provider = ProviderHelper(provider_name)
    if provider.name != 'reference':
        raise NotImplementedError(
            'only the reference provider is implemented so far')

    try:
        transaction_id = provider.prepare_notice(request)
    except msg.DevMessage as m:
        return system_error(request, code=m.code)

    tasks.payment_notify.delay(transaction_id)
    return render(request, 'provider/success.html')
开发者ID:unghost,项目名称:webpay,代码行数:15,代码来源:views.py

示例3: success

# 需要导入模块: from lib.solitude.api import ProviderHelper [as 别名]
# 或者: from lib.solitude.api.ProviderHelper import prepare_notice [as 别名]
def success(request, provider_name):
    provider = ProviderHelper(provider_name)
    if provider.name != "reference":
        raise NotImplementedError("only the reference provider is implemented so far")

    try:
        transaction_id = provider.prepare_notice(request)
    except msg.DevMessage as m:
        return system_error(request, code=m.code)

    tasks.payment_notify.delay(transaction_id)

    if settings.SPA_ENABLE:
        state, fxa_url = fxa_auth_info(request)
        ctx = {"start_view": "payment-success", "fxa_state": state, "fxa_auth_url": fxa_url}
        return render(request, "spa/index.html", ctx)

    return render(request, "provider/success.html")
开发者ID:Joergen,项目名称:webpay,代码行数:20,代码来源:views.py

示例4: success

# 需要导入模块: from lib.solitude.api import ProviderHelper [as 别名]
# 或者: from lib.solitude.api.ProviderHelper import prepare_notice [as 别名]
def success(request, provider_name):
    provider = ProviderHelper(provider_name)
    if provider.name != 'reference':
        raise NotImplementedError(
            'only the reference provider is implemented so far')

    try:
        transaction_id = provider.prepare_notice(request)
    except msg.DevMessage as m:
        return system_error(request, code=m.code)

    tasks.payment_notify.delay(transaction_id)

    state, fxa_url = fxa_auth_info(request)
    ctx = {'start_view': 'payment-success',
           'fxa_state': state,
           'fxa_auth_url': fxa_url}
    return render(request, 'spa/index.html', ctx)
开发者ID:flodolo,项目名称:webpay,代码行数:20,代码来源:views.py

示例5: success

# 需要导入模块: from lib.solitude.api import ProviderHelper [as 别名]
# 或者: from lib.solitude.api.ProviderHelper import prepare_notice [as 别名]
def success(request, provider_name):
    provider = ProviderHelper(provider_name)
    if provider.name != 'reference':
        raise NotImplementedError(
            'only the reference provider is implemented so far')

    try:
        transaction_id = provider.prepare_notice(request)
    except msg.DevMessage as m:
        return system_error(request, code=m.code)

    tasks.payment_notify.delay(transaction_id)

    if settings.SPA_ENABLE:
        ctx = {'start_view': 'payment-success'}
        if settings.USE_FXA:
            ctx['fxa_state'], ctx['fxa_auth_url'] = fxa_auth_info(request)
        return render(request, 'spa/index.html', ctx)

    return render(request, 'provider/success.html')
开发者ID:Nurtas,项目名称:webpay,代码行数:22,代码来源:views.py


注:本文中的lib.solitude.api.ProviderHelper.prepare_notice方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。