I am using the DCramer fork of django-paypal: https://github.com/dcramer/django-paypal
I am using IPN standard
What I would like to do is get the payer (customer) address from the IPN. I can see from the paypal docs this info is sent with an IPN and from looking through django-paypal there are fields in the database to store this data. However this data is not being stored in the paypal_ipn model provided by django-paypal. I have also inspected the ipn_obj in the signals and all the fields for this data are blank there too.
Can anyone shed any light on how I might be able to get the payer address?
If it helps I'm using the signals from the example:
#Paypal signals
from paypal.standard.ipn.signals import payment_was_successful
import datetime
#Signal for paypal confirmation
def show_me_the_money(sender, **kwargs):
ipn_obj = sender
# Undertake some action depending upon `ipn_obj`.
payment_was_successful.connect(show_me_the_money)
EDIT:
The dump of the ipn_obj suggested by scytale below produces this for the relevant fields:
address_city\t(<type 'unicode'>)\t:
address_country\t(<type 'unicode'>)\t:
address_country_code\t(<type 'unicode'>)\t:
address_name\t(<type 'unicode'>)\t:
address_state\t(<type 'unicode'>)\t:
address_status\t(<type 'unicode'>)\t:
address_street\t(<type 'unicode'>)\t:
address_zip\t(<type 'unicode'>)\t:
There are loads of other fields too, if you need the data from those let me know and I'll paste them here.
It sounds like you're not getting the address information in the first place. You can ask paypal to send the customer's address from their paypal account or you can get the address from the customer on your site and include the data in the paypal button HTML - paypal then sends this information back to you in the IPN data. See the Forms Basics guide for more details.
Since you're using django-paypal (right?) you can include this data in the paypal button simply by adding fields to the dict of initial values you pass to
PayPalPaymentsForm
as described in the django-paypal docs.