Quick comment describing need for IPN TZ adjustment
authorJason Gillman Jr <jgillman@miopencarry.org>
Mon, 14 Jan 2019 15:57:34 +0000 (10:57 -0500)
committerJason Gillman Jr <jgillman@miopencarry.org>
Mon, 14 Jan 2019 19:56:30 +0000 (14:56 -0500)
CRM/Core/Payment/PayPalIPN.php

index 4248d1c848654f5225d9adbe0b5d62899284bdc8..6af63aaeeec3d814faf6e42253717e85b5606456 100644 (file)
@@ -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');