【问题标题】:how to change sanbox.paypal site to paypal site in django-merchant?如何在 django-merchant 中将 sandbox.paypal 站点更改为 paypal 站点?
【发布时间】:2012-02-09 08:54:01
【问题描述】:

我正在使用 django-meerchant 进行贝宝付款 http://readthedocs.org/docs/django-merchant/en/latest/offsite/paypal.html ...

我的观点有这个代码:

                            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 %}  

我的问题是如何更改它以使其更改为 paypal 网站而不是 sandbox.paypal 网站?

提前谢谢...

【问题讨论】:

    标签: python django paypal django-paypal


    【解决方案1】:

    根据文档,您可以在调用get_integration (pay_pal = get_integration("pay_pal", test_mode=False)) 时指定test_mode 参数,或者在设置文件中设置MERCHANT_TEST_MODE。此外,您可能还需要更改 PAYPAL_TEST 设置。

    PS。我不与 django-merchant 合作,也不知道这是否可行,这只是文档中的假设。

    【讨论】:

    • 感谢 demalexx,我试试你的回答 test_mode=False,它可以工作。在我的代码中,在return render_to_response(...) 之前,我添加了:pay_pal.test_mode = False ...
    猜你喜欢
    • 2014-05-04
    • 1970-01-01
    • 1970-01-01
    • 2017-10-19
    • 2010-10-03
    • 2014-07-16
    • 2012-08-13
    • 1970-01-01
    • 2018-01-16
    相关资源
    最近更新 更多