From 6800eef17283b8065b9ab2bb51e90441bbba8301 Mon Sep 17 00:00:00 2001 From: Jason Gillman Jr Date: Mon, 14 Jan 2019 10:57:34 -0500 Subject: [PATCH] Quick comment describing need for IPN TZ adjustment --- CRM/Core/Payment/PayPalIPN.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CRM/Core/Payment/PayPalIPN.php b/CRM/Core/Payment/PayPalIPN.php index 4248d1c848..6af63aaeee 100644 --- a/CRM/Core/Payment/PayPalIPN.php +++ b/CRM/Core/Payment/PayPalIPN.php @@ -394,6 +394,10 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { $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'); -- 2.25.1