Oscar-paypal and Vouchers

89 views
Skip to first unread message

Maarten Idema

unread,
Jul 17, 2016, 11:44:55 PM7/17/16
to django-oscar
Hi all,

I have made a django-oscar cart and attached payments through django-oscar-paypal. It all seems to work well in sandbox mode and on the live server, but when someone uses a promo-code/voucher/coupon the preview details, confirmation page and entry in the dashboard are wrong. 

The discount doesn't come through at all. Up until the Paypal redirect (which I have happening after shipping) everything is fine, but on return the discount isn't coming through. 

I can get basket.vouchers.all() to show on the preview page but not basket.grouped_voucher_discounts. Seems very odd to me.

Any help with this would be a great relief.


Cheers, Maarten Idema

Maarten Idema

unread,
Jul 18, 2016, 9:09:02 PM7/18/16
to django-oscar
I ran the django-oscar-paypal sandbox added a voucher and it doesn't work in that either. Seems like a bug.

06us...@gmail.com

unread,
Jul 24, 2016, 4:48:17 PM7/24/16
to django-oscar
I agree with you, same behaviour on my test and production servers when using VOUCHERS :
On the return from Paypal the discount isn't coming through (even though the discount is correctly debited in Paypal, order does not contain discount, after checkout and final processing).
Django 1.8.14, django-oscar-paypal 0.9.7, django-oscar 1.2.1, python 3.4

Note that behaviour of OFFERS is ok (order contains correct discount, after checkout and final processing :-)

Cheers.


Maarten Idema

unread,
Jul 28, 2016, 10:35:52 PM7/28/16
to django-oscar
So after a lot of working I found a fix. The issue is a bug in the django-oscar-paypal code.


Instead of:
Applicator().apply(request=self.request, basket=basket)

You need to had the user so that it reads:
Applicator().apply(request=self.request, user=self.request.user, basket=basket)

Then it works.

Maarten Idema

unread,
Jul 28, 2016, 11:32:58 PM7/28/16
to django-oscar
I have submitted this as a pull request in the repo.

06us...@gmail.com

unread,
Jul 29, 2016, 3:29:30 AM7/29/16
to django-oscar
Maarten,
Thanks for this. Indeed, fix you proposed is correcting bug on my test and production servers. Well done !
Cheers.
Reply all
Reply to author
Forward
0 new messages