ContactImportPaypal

Created by: Lester Caine, Last modification: 15 Oct 2010 (16:56 BST)

Notes on import of CVS dump from paypal account.

The processing of a CSV dump from paypal is complicated a little since what is exported can be edited by the user. This makes a generic import difficult, but this is at least a good base from which to work.  The MEDW account has been set up to return the following fields

Date
Time
Time Zone
Name
Type
Status
Currency
Gross
Fee
Net
From Email Address
To Email Address
Transaction ID
Payment Type
Counterparty Status
Address Status
Item Title
Item ID
Postage and Packing
Insurance Amount
VAT
Option 1 Name
Option 1 Value
Option 2 Name
Option 2 Value
Reference Txn ID
Invoice Number
Custom Number
Quantity
Receipt ID
Address Line 1
Address Line 2/District/Neighbourhood
Town/City
State/Province/Region/County/Territory/Prefecture/Republic
Postcode
Country
Contact Phone Number

This is found on the history pages of the paypal account. Top bar, History->Download History ...
Paypal-DownloadHistory
the important thing on this page is to include the shopping cart details by selecting the check box at the bottom, so as to include all the line items for a shopping basket order. The selection options for the fields is accessed using the 'Customize Download Fields' link on the fight of the page.
Paypal-HistoryFields
Is the configuration that is being used for MEDW, and the CSV import code expects these fields in order to run.

The data is imported into a pair of temporary tables, one for the main data, and a second which just has the line items that go with a main table record. Currently, a new contact entry is created for each transaction, since on the whole there are very few repeat customers, but at some point it is hoped that existing contact records can be identified. The address fields from the record are directed to the contact_address table for further processing, but an external script is currently used to transfer some of the paypal table data into contact_xref. Currently only the PHONE, VAT, _EMAIL_ADDRESS ( To or from depending on type of transaction ) and CUST_NO are transferred.