angelleye / paypal-ipn-template

This is basic PHP template solution for PayPal Instant Payment Notification (IPN)
14 stars 11 forks source link

$payer_email missing in paypal-ipn-template/recurring-payment.php #1

Closed wethecom closed 8 years ago

wethecom commented 8 years ago

in "paypal-ipn-template/recurring-payment.php"

this seems to be missing "$recurring_payment_data['payer_email'] = $payer_email;"

i may not be understanding this correctly but this seems like it should be there. my current project requires the payers email in this location but i do not see it. testing this is going to take some time in a live environment because the ipn simulator does not allow recurring payment testing.

if you could be so kind as to advise on this situation

angelleye commented 8 years ago

Yes, it looks like I missed it, although it is being parsed out in /parse-ipn-data.php and is available in $payer_email. I just don't have it specifically getting setup in that recurring array and getting added to that db table.

I did go ahead and get that added, so you can pull the changes to the PHP files, and then you'll need to add that new field (payer_email, varchar) to the recurring_payments table.

wethecom commented 8 years ago

(payer_email, varchar[150]) what should the index be? unique or indexed? im not 100% on your code

angelleye commented 8 years ago

It wouldn't be unique because you'll have multiple recurring payments coming from the same people.

The database with this solution isn't in any true normalized form, so you would typically have some sort of a customers table with an ID and that's where their payer_email would go, and then the recurring payments table would just contain only that payment data with the related customer ID.

This IPN template, though, is based off an old copy that PayPal provided where it wasn't normalized. I decided to just stick with it and let the data fall into the tables as-is.

It's a nice solution to get up and running very quickly with IPN, but if you're wanting a perfectly normalized database you'll need to customize it accordingly.

wethecom commented 8 years ago

i just left index blank...im not the greatest at mysql..spent last year and a half during downtime trying to get a listener working with no luck the code i added adjusted the date in the other database (already live)

this is a amazing piece of code and easy to follow and what i would expect and more no more checking my subscription payments everyday ...thanks alot

angelleye commented 8 years ago

Glad it helped you out!