Django paypal返回错误:render()获得了意外的关键字参数“ renderer”

时间:2019-05-03 17:56:05

标签: django django-paypal

我正在尝试实现Paypal结帐按钮。我正在使用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))

0 个答案:

没有答案