Commits

Josh VanderLinden  committed 65496aa

Reverting PayPal changes again--bad merge

  • Participants
  • Parent commits e326ee2

Comments (0)

Files changed (1)

 +    return views.confirm_info(request, config, 'moneybookers',
 +            extra_notes='Please send the payment to DailyVarianceBook@gmail.com.')
 +
-diff --git a/satchmo/apps/payment/modules/paypal/views.py b/satchmo/apps/payment/modules/paypal/views.py
---- a/satchmo/apps/payment/modules/paypal/views.py
-+++ b/satchmo/apps/payment/modules/paypal/views.py
-@@ -69,6 +69,7 @@
-     processor_module = payment_module.MODULE.load_module('processor')
-     processor = processor_module.PaymentProcessor(payment_module)
-     processor.create_pending_payment(order=order)
-+    order.add_status(status='New', notes=_("Billed through PayPal."))
-     default_view_tax = config_value('TAX', 'DEFAULT_VIEW_TAX')
- 
-     recurring = None
-@@ -114,6 +115,8 @@
-     """PayPal IPN (Instant Payment Notification)
-     Cornfirms that payment has been completed and marks invoice as paid.
-     Adapted from IPN cgi script provided at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/456361"""
-+
-+    response = HttpResponse()
-     payment_module = config_get_group('PAYMENT_PAYPAL')
-     if payment_module.LIVE.value:
-         log.debug("Live IPN on %s", payment_module.KEY.value)
-@@ -129,17 +132,21 @@
-         data = request.POST
-         log.debug("PayPal IPN data: " + repr(data))
-         if not confirm_ipn_data(data, PP_URL):
--            return HttpResponse()
-+            return response
- 
-         if not 'payment_status' in data or not data['payment_status'] == "Completed":
-             # We want to respond to anything that isn't a payment - but we won't insert into our database.
-              log.info("Ignoring IPN data for non-completed payment.")
--             return HttpResponse()
-+             return response
- 
-         try:
-             invoice = data['invoice']
-         except:
--            invoice = data['item_number']
-+            invoice = data.get('item_number', None)
-+
-+        if not invoice:
-+            log.error('>>> I have no invoice number to work with... bailing out.  This is probably a "send money" transaction.')
-+            return response
- 
-         gross = data['mc_gross']
-         txn_id = data['txn_id']
-@@ -148,9 +155,9 @@
-             # If the payment hasn't already been processed:
-             order = Order.objects.get(pk=invoice)
- 
--            order.add_status(status='New', notes=_("Paid through PayPal."))
-+            order.add_status(status='Billed', notes=_("Paid through PayPal."))
-             processor = get_processor_by_key('PAYMENT_PAYPAL')
--            payment = processor.record_payment(order=order, amount=gross, transaction_id=txn_id)
-+            processor.record_payment(order=order, amount=gross, transaction_id=txn_id)
- 
-             if 'memo' in data:
-                 if order.notes:
-@@ -174,7 +181,7 @@
-     except:
-         log.exception(''.join(format_exception(*exc_info())))
- 
--    return HttpResponse()
-+    return response
- 
- def confirm_ipn_data(data, PP_URL):
-     # data is the form data that was submitted to the IPN URL.
 diff --git a/satchmo/apps/payment/modules/site_transfer/__init__.py b/satchmo/apps/payment/modules/site_transfer/__init__.py
 new file mode 100644
 diff --git a/satchmo/apps/payment/modules/site_transfer/config.py b/satchmo/apps/payment/modules/site_transfer/config.py