Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added check for setting governing what email address to use as paymen…

…t receiver.
  • Loading branch information...
commit d6deaf9b9722d4ecd5fa57f6d5c28c67446c2f56 1 parent d9718bc
@chrisglass authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 shop_paypal/offsite_paypal.py
View
6 shop_paypal/offsite_paypal.py
@@ -1,5 +1,6 @@
#-*- coding: utf-8 -*-
from decimal import Decimal
+from django.conf import settings
from django.conf.urls.defaults import patterns, url, include
from django.shortcuts import render_to_response
from paypal.standard.forms import PayPalPaymentsForm
@@ -8,7 +9,7 @@
class OffsitePaypalBackend(object):
'''
- Glue code to let django-SHOP talk to merchant's paypal backend.
+ Glue code to let django-SHOP talk to django-paypal's.
The django-paypal package already defines an IPN view, that logs everything
to the database (desirable), and fires up a signal.
@@ -27,6 +28,7 @@ class OffsitePaypalBackend(object):
def __init__(self, shop):
self.shop = shop
success_signal.connect(self.payment_was_successful, weak=False)
+ assert settings.PAYPAL_RECEIVER_EMAIL, "You need to define a PAYPAL_RECEIVER_EMAIL in settings with the money recipient's email addresss"
def get_urls(self):
urlpatterns = patterns('',
@@ -60,7 +62,7 @@ def view_that_asks_for_money(self, request):
order = self.shop.get_order(request)
paypal_dict = {
- "business": "yourpaypalemail@example.com",
+ "business": settings.PAYPAL_RECEIVER_EMAIL,
"amount": self.shop.get_order_total(order),
"item_name": self.shop.get_order_short_name(order),
"invoice": self.shop.get_order_unique_id(order),
Please sign in to comment.
Something went wrong with that request. Please try again.