DateTime Difference Bug Makes PayPal_Framework Impractical for Real-Time Transactions

schultkl - November 29, 2005 - 11:00
Project:
Component:
Category:
Priority:
Assigned:Unassigned
Status:
Description

Thank you very much for creating this software.

It seems likely that the everything is working successfully, except when the datetime-stamps differ between the web server and the Drupal software.

I encountered this problem while using paypal_subscription, which relies on paypal_framework.

1) Recording the Transaction
Using PayPal Developer server, I completed a payment for a one-year subscription. paypal_framework recorded paypal_log.payment_date as "01:38:50 Nov 29, 2005 PST" but it used the database "CURRENT DATETIME" functionality ("NOW") to record the paypal_log.transaction_date, which recorded "2005-11-29 04:44:49". The former is my local time on the west coast, and the latter is the local web server time on the east coast.

2) Updating the user role
The paypal_subscription code then looks for entries in paypal_log with transaction_date values prior to the current west coast time, and of course does not find any, because all of the transaction dates were recorded as east coast time, and will not be identified for another three hours. At that time, the cron job will identify the transaction_date as a valid datetime and update the user role.

Short-term Manual Solution
Well, in MySQL, I edited each record, setting the "Function" field from "NOW" to blank, and setting the transaction_date back a few hours. I then re-ran cron, and voila, the code updates the user role.

Long-term Automated Solution
Well, really, the recorded date in paypal_log.transaction_date should be the local server time set by the admin of the Drupal software, not the local time of the remote web server, which is controlled by the web server sysadmins and usually unchangable.

Thank you very much for your help.

Sincerely,

Kevin Schultz
Citrus Heights, CA

#1

schultkl - November 29, 2005 - 11:00

Updated title to better reflect problem

#2

schultkl - November 29, 2005 - 11:48

I tried fixing the code on this one, but it's beyond my willingness to change .... I will come back to this when the project is fixed.

I did generate a patch of whath I think the mysql file should look like. Hopefully that saves some time.

Your favorite bug-finder,

Kevin

AttachmentSize
paypal_framework.mysql.patch 440 bytes
 
 

Drupal is a registered trademark of Dries Buytaert.