Skip to content

Commit 9338069

Browse files
#17 unset gateway before storing session
1 parent 91bd74d commit 9338069

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

CRM/Core/Payment/OmnipayMultiProcessor.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,12 @@ public function doDirectPayment(&$params, $component = 'contribute') {
154154
return $params;
155155
}
156156
elseif ($response->isRedirect()) {
157+
$isTransparentRedirect = ($response->isTransparentRedirect() || !empty($this->gateway->transparentRedirect));
158+
// Unset $this->gateway before storing session to cache due to risk of
159+
// Serialization of 'Closure' is not allowed error - issue #17
160+
$this->gateway = NULL;
157161
CRM_Core_Session::storeSessionObjects(FALSE);
158-
if ($response->isTransparentRedirect() || !empty($this->gateway->transparentRedirect)) {
162+
if ($$isTransparentRedirect) {
159163
$this->storeTransparentRedirectFormData($params['qfKey'], $response->getRedirectData() + array(
160164
'payment_processor_id' => $this->_paymentProcessor['id'],
161165
'post_submit_url' => $response->getRedirectURL(),

0 commit comments

Comments
 (0)