Skip to content

Commit

Permalink
Merge pull request dcramer#21 from codingjoe/patch-1
Browse files Browse the repository at this point in the history
fixes markup for signal documentation
  • Loading branch information
spookylukey committed Apr 8, 2014
2 parents afba951 + dc07cbd commit c3f1dc1
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,22 +122,22 @@ Using PayPal Payments Standard IPN:
Connect to these signals and update your data accordingly.
[Django Signals Documentation](http://docs.djangoproject.com/en/dev/topics/signals/).

# models.py
...
from paypal.standard.ipn.signals import payment_was_successful

def show_me_the_money(sender, **kwargs):
ipn_obj = sender
# You need to check 'payment_status' of the IPN

if ipn_obj.payment_status == "Completed":
# Undertake some action depending upon `ipn_obj`.
if ipn_obj.custom == "Upgrade all users!":
Users.objects.update(paid=True)
else
...

payment_was_successful.connect(show_me_the_money)
# models.py
...
from paypal.standard.ipn.signals import payment_was_successful
def show_me_the_money(sender, **kwargs):
ipn_obj = sender
# You need to check 'payment_status' of the IPN
if ipn_obj.payment_status == "Completed":
# Undertake some action depending upon `ipn_obj`.
if ipn_obj.custom == "Upgrade all users!":
Users.objects.update(paid=True)
else
...
payment_was_successful.connect(show_me_the_money)

The data variables that are return on the IPN object are documented here:

Expand Down

0 comments on commit c3f1dc1

Please sign in to comment.