django - Django paypal 返回错误:render() got an unexpected keyword argument 'renderer'
问题描述
我正在尝试实现贝宝结帐按钮。我正在使用 django-paypal。我不断收到此错误:render() 有一个意外的关键字参数“renderer”。我不知道是什么原因造成的。我正在使用 django 2.1。
这是我的贝宝流程视图:
def payment_process(request):
template = loader.get_template("payment/process.html")
paypal_dict = {
"business": "henryemeka34@yahoo.com",
"amount": "100.00",
"item_name": "name of the item",
"invoice": "unique-invoice-id",
"currency_code": "USD",
"notify_url": request.build_absolute_uri(reverse('paypal-ipn')),
"return": request.build_absolute_uri(reverse('payment:done')),
"cancel_return":
request.build_absolute_uri(reverse('payment:cancelled')),
# "custom": "premium_plan", # Custom command to correlate to some function later (optional)
}
# Create the instance.
form = PayPalPaymentsForm(initial=paypal_dict)
context = {"form": form}
return HttpResponse(template.render(context,request))
解决方案
推荐阅读
- c# - 物体卡在 Navmesh 表面的边缘
- ios - 如何使用 Swift 5 从 Firebase 的快照中保存数据?
- python - 使用 BeautifulSoup 在网页上查找特定文本?
- purescript - 在 Purescript 中使用 Data.String.Regex(正则表达式)
- google-cloud-platform - GCP 实例元数据未通过范围
- xml - 如何定义具有无限最大值的元素
- typescript - 从函数重载签名中的对象值推断键类型
- junit5 - PiTest无缘无故“改变条件边界突变存活”?
- c# - 无法捕获 DbUpdateConcurrencyException
- laravel - 如何在 Laravel 中实现/执行“加载更多”或“查看更多”