Unverified Commit 1ce4df21 authored by Seamus Lee's avatar Seamus Lee Committed by GitHub

Merge pull request #13439 from jgillmanjr/paypal-standard-ipn-tz-fix

Convert Paypal Standard IPN payment_date to system's time zone
parents 2b491b35 6800eef1
......@@ -394,6 +394,12 @@ 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');
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment