1
我使用的Django meerchant爲寶付款http://readthedocs.org/docs/django-merchant/en/latest/offsite/paypal.html ...如何將sanbox.paypal網站更改爲django-merchant的paypal網站?
和我的看法有這樣的代碼:
pay_pal = get_integration("pay_pal")
pay_pal.add_fields({
"business": client.paypal_id,
"item_name": product.name,
"invoice": inst.trans_code,
"notify_url": settings.BASE_DNS + str(client.id) + '/book/'+str(inst.id) +'/success/?booksaved=1',
"return_url": settings.BASE_DNS + str(client.id) + '/book/'+str(inst.id) +'/success/?booksaved=1',
"cancel_return": settings.BASE_DNS + str(client.id) + '/?booksaved=0',
"amount": inst.book_charged})
return render_to_response("pay_pay.html", {"obj": pay_pal, "product": product.name, "amount": inst.totalcost},context_instance=RequestContext(request))
我的模板pay_pay.html
{% extends "main_base_bookingpage.html" %}
{% load billing_tags %}
{% block content %}
Required Parameters from the view
<ul>
<li> item_name : {{ product }}</li>
<li> amount : {{ amount }}</li>
</ul>
{% paypal obj %}
{% endblock %}
我的問題是如何能我改變它,以便它會更改爲貝寶網站,而不是sandbox.paypal網站?
在此先感謝...
謝謝demalexx,我嘗試你的答案'test_mode = False',它的工作原理。在我的代碼中,在返回render_to_response(...)之前,我添加了:'pay_pal.test_mode = False' ... – gadss 2012-01-14 02:05:38