本文整理汇总了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)
示例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')
示例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")
示例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)
示例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')