Paypal error after switch to live Paypal API credentials from sandbox "An error occurred communicating with PayPal"

386 views
Skip to first unread message

Sean Liu

unread,
Oct 14, 2013, 8:20:02 PM10/14/13
to django...@googlegroups.com
Hi,

My site is build to take payment using Django-Oscar_paypal, everything works fine when I use Paypal sandbox API credentials.
But after switched settings.py to live Paypal credentials, I got this error message after click on checkout using paypal button: "An error occurred communicating with PayPal".

It is very annoying, I cannot fingered out what is the cause, basket value is plus 0, so, not caused by 0 basket charge error.

Can anyone please help, or let me know how to find the real detailed error message or how to debug to find the root of this problem.

Sean

David Winterbottom

unread,
Oct 15, 2013, 4:44:51 AM10/15/13
to django-oscar
Two things to check:
  • Ensure you have a logger defined for name 'paypal.express' set at DEBUG level
  • Use the admin to look at the ExpressTransaction models
This should show you what the error is.  It's very likely to be that your production credentials aren't being accepted.​


--
https://github.com/tangentlabs/django-oscar
http://django-oscar.readthedocs.org/en/latest/
https://twitter.com/django_oscar
---
You received this message because you are subscribed to the Google Groups "django-oscar" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-oscar...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-oscar.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-oscar/e6616ae5-2d5b-4fa0-ba93-53b184b208f4%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
David Winterbottom
Head of Programming

Tangent Labs
84-86 Great Portland Street
London W1W 7NR
England, UK

Sean Liu

unread,
Oct 15, 2013, 10:50:23 AM10/15/13
to django...@googlegroups.com, david.win...@tangentlabs.co.uk
Thanks David.
The error message shows: "Callback URL is wrong type; you must use the HTTPS."
Surely I need to setup the server with ssl and https access.

David Winterbottom

unread,
Oct 15, 2013, 11:14:22 AM10/15/13
to django-oscar
On 15 October 2013 15:50, Sean Liu <liush...@gmail.com> wrote:
Thanks David.
The error message shows: "Callback URL is wrong type; you must use the HTTPS."
Surely I need to setup the server with ssl and https access.

​Yes, that sounds right.​

 

For more options, visit https://groups.google.com/groups/opt_out.

Sean Liu

unread,
Oct 15, 2013, 8:33:47 PM10/15/13
to django...@googlegroups.com, david.win...@tangentlabs.co.uk
After switched site to https, still got this error, cannot find where to define call back url

Sean Liu

unread,
Oct 15, 2013, 10:08:02 PM10/15/13
to django...@googlegroups.com, david.win...@tangentlabs.co.uk
Finally, works it out now!

In site-packages/paypal/express/views.py, it was hard coded into ' params['scheme'] = 'http'', which is a bug I suggest, as even in the debug mode, https options should be included too, like the circumstance I am in now. Otherwise, paypal express will never work for testing on live credentials.  

        if settings.DEBUG:
            # Determine the localserver's hostname to use when
            # in testing mode
            params['host'] = self.request.META['HTTP_HOST']
            params['scheme'] = 'http' 

David Winterbottom

unread,
Oct 18, 2013, 5:08:31 PM10/18/13
to django-oscar
Glad you got it fixed.

I've create an issue for the http thing: 



For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages