PayPal passes this back as part of the IPN post, and being able to query on this (instead of relying on the serialized value in the details column) is very valuable. This relatively simple patch adds this column to the table, and also pulls the value out of PayPal's IPN post. I'm not familiar with the other gateway this module supports, but since the field isn't required, this shouldn't break anything.

Comments

BenK’s picture

Subscribing...

osopolar’s picture

What importance does the payer_email have? It's not necessarily the same as the users account email address. I think more important is to have direct access to the transaction id (txn_id). This is also more general because somehow all gateways are using something like a transaction id. For paypal its important to be able to query for a transaction ID (@see i.e. #875910: Duplicates in the simple_payment table for PayPal payments - more validation required).

jbrown’s picture

Version: 6.x-1.0 » 6.x-1.x-dev
Status: Needs review » Needs work

@jhedstrom does the uid field not do what you require?

Maybe there should be db fields for gateway-specific payer reference, payee reference and transaction reference.

jhedstrom’s picture

For the particular use case we're using this module, all of the payments come from anonymous users, so the uid is of little value there. The e-mail is already passed back and stored in a serialized array, but unfortunately, this can't easily be queried on.

jbrown’s picture

I'm happy for there to be db fields for payer reference, payee reference and transaction reference.

jhedstrom’s picture

jbrown, would the idea then be that instead of being specific to the email, payer_reference could contain arbitrary data? That solution would work for the use case I'm working if, in the case of paypal, it populated that field with the payer's e-mail address. I can reroll the patch if that's what you were thinking.

jhedstrom’s picture

Status: Needs work » Needs review
StatusFileSize
new2 KB

Here is a patch that adds payer_reference, payee_reference, and transaction_reference. It also adds the proper mappings from the PayPal IPN response so these fields are populated. An update hook is provided to add the fields to existing sites.

seanberto’s picture

.

jbrown’s picture

Title: Add payer_email address to simple_payment table » Add payer_reference and payee_reference to simple_payment table
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.