首页 > 解决方案 > 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))

标签: djangodjango-paypal

解决方案


推荐阅读