Note that there are some explanatory texts on larger screens.

plurals
  1. POdjango-paypal setup
    text
    copied!<p>Has anyone setup django-paypal? Here is the link to it <a href="https://github.com/johnboxall/django-paypal" rel="noreferrer">here</a>? </p> <p>I have "myproject" setup, and my folder sturecture looks like this:</p> <p>myproject > paypal > (stdandard and pro folders)</p> <p>to my settins.py file I added</p> <pre><code>INSTALLED_APPS = ( 'myproject.paypal.standard', 'myproject.paypal.pro', ) </code></pre> <p>in my url's file for my account app I added:</p> <pre><code>urlpatterns += patterns('myproject.account.views', (r'^payment-url/$', 'buy_my_item'), ) </code></pre> <p>and in my account view I added:</p> <pre><code>from myproject.paypal.pro.views import PayPalPro from myproject.paypal.pro.forms import PaymentForm, ConfirmForm def buy_my_item(request): item = {'amt':"10.00", # amount to charge for item 'inv':"1111", # unique tracking variable paypal 'custom':"2222", # custom tracking variable for you 'cancelurl':"http://127.0.0.1:8000/", # Express checkout cancel url 'returnurl':"http://127.0.0.1:8000/"} # Express checkout return url kw = {'item':'item', # what you're selling 'payment_template': 'pro/payment.html', # template to use for payment form 'confirm_template': ConfirmForm, # form class to use for Express checkout confirmation 'payment_form_cls': PaymentForm, # form class to use for payment 'success_url': '/success', # where to redirect after successful payment } ppp = PayPalPro(**kw) return ppp(request) </code></pre> <p>--- EDIT --------- Then, I added the pro and standard template folders to my projects template folder.</p> <p>When I go to <a href="http://127.0.0.1:8000/account/payment-url/" rel="noreferrer">http://127.0.0.1:8000/account/payment-url/</a> and submit the form...</p> <p>I get a ValueError : "dictionary update sequence element #0 has length 1; 2 is required"</p> <p>Traceback:</p> <pre><code>File "...\accounts\views.py" in buy_my_item 655. return ppp(request) File "...\paypal\pro\views.py" in __call__ 115. return self.validate_payment_form() File "...\paypal\pro\views.py" in validate_payment_form 133. success = form.process(self.request, self.item) File "...\paypal\pro\forms.py" in process </code></pre> <ol start="35"> <li>params.update(item)</li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload