From: Guillaume Pellerin Date: Thu, 24 Sep 2015 15:53:06 +0000 (+0200) Subject: try to fix payment complete X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=891822e2faed03e19c4779dc822e4cea6386bd42;p=diggersdigest.git try to fix payment complete --- diff --git a/app/diggersdigest/settings.py b/app/diggersdigest/settings.py index a6a2f67..08335e9 100644 --- a/app/diggersdigest/settings.py +++ b/app/diggersdigest/settings.py @@ -214,12 +214,12 @@ PAYPAL_IPN_URL = lambda cart, uuid, order_form: ('paypal.standard.ipn.views.ipn' # URL the secondary-payment-form is submitted to # Dev example -PAYPAL_SUBMIT_URL = 'https://www.sandbox.paypal.com/cgi-bin/webscr' +# PAYPAL_SUBMIT_URL = 'https://www.sandbox.paypal.com/cgi-bin/webscr' # Prod example -# PAYPAL_SUBMIT_URL = 'https://www.paypal.com/cgi-bin/webscr' +PAYPAL_SUBMIT_URL = 'https://www.paypal.com/cgi-bin/webscr' # For real use set to False -PAYPAL_TEST = True +PAYPAL_TEST = False ######################## # MAIN DJANGO SETTINGS # diff --git a/app/records/models.py b/app/records/models.py index 277b13c..0acbd93 100644 --- a/app/records/models.py +++ b/app/records/models.py @@ -10,8 +10,8 @@ import datetime import os import fnmatch from importlib import import_module -from diggersdigest import settings # from mezzanine.conf import settings +from diggersdigest import settings from mezzanine.core.fields import FileField from mezzanine.core.models import CONTENT_STATUS_DRAFT, CONTENT_STATUS_PUBLISHED @@ -20,8 +20,6 @@ from mezzanine.utils.models import upload_to from cartridge.shop.models import Product, Category, Cart, Order, ProductVariation, DiscountCode from paypal.standard.ipn.signals import payment_was_successful -from paypal.standard.models import ST_PP_COMPLETED -from paypal.standard.ipn.signals import valid_ipn_received # Auto-generated Django models with manage.py inspectdb on the old database @@ -298,7 +296,7 @@ def payment_complete(sender, **kwargs): ipn_obj = sender - if ipn_obj.custom and ipn_obj.invoice and ipn_obj.payment_status == ST_PP_COMPLETED: + if ipn_obj.custom and ipn_obj.invoice: s_key, cart_pk = ipn_obj.custom.split(',') SessionStore = import_module(settings.SESSION_ENGINE) \ .SessionStore @@ -343,4 +341,3 @@ def payment_complete(sender, **kwargs): pass payment_was_successful.connect(payment_complete) -valid_ipn_received.connect(payment_complete)