我有django paypal视图.py地址:
from paypal.standard.forms import PayPalPaymentsForm
def view_that_asks_for_money(request):
paypal_dict = {
"business": settings.PAYPAL_RECEIVER_EMAIL,
"amount": "10000000.00",
"item_name": "name of the item",
"invoice": "unique-invoice-id",
"notify_url": "https://www.example.com" + reverse('paypal-ipn'),
"return_url": "https://www.example.com/your-return-location/",
"cancel_return": "https://www.example.com/your-cancel-location/",
}
# Create the instance.
form = PayPalPaymentsForm(initial=paypal_dict)
context = {"form": form}
return render_to_response("payment.html", context)
我必须包括在我的基本应用程序的例子,使所有的功能将工作和付款.html渲染
PayPalPaymentsForm应该是一个对象,而不是一个dict。 因此,可以构建一个对象作为参数。 例如:
相关问题 更多 >
编程相关推荐