Skip to content

Commit

Permalink
Quick comment describing need for IPN TZ adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
jgillmanjr committed Jan 14, 2019
1 parent e878028 commit 6800eef
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CRM/Core/Payment/PayPalIPN.php
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,10 @@ public function getInput(&$input, &$ids) {
$paymentDate = $this->retrieve('payment_date', 'String', FALSE);
if (!empty($paymentDate)) {
$receiveDateTime = new DateTime($paymentDate);
/**
* The `payment_date` that Paypal sends back is in their timezone. Example return: 08:23:05 Jan 11, 2019 PST
* Subsequently, we need to account for that, otherwise the recieve time will be incorrect for the local system
*/
$systemTimeZone = new DateTimeZone(CRM_Core_Config::singleton()->userSystem->getTimeZoneString());
$receiveDateTime->setTimezone($systemTimeZone);
$input['receive_date'] = $receiveDateTime->format('YmdHis');
Expand Down

0 comments on commit 6800eef

Please sign in to comment.