function createPaymentObject($processID, $orderID) { //__DEBUG__ $this->logger->writeTimedString("createPaymentObject"); //___end____ return eZPaymentObject::createNew($processID, $orderID, 'Paypal'); }
function continueWorkflow() { if ($this->paymentObject) { $workflowID = $this->paymentObject->attribute('workflowprocess_id'); if ($workflowID) { return eZPaymentObject::continueWorkflow($workflowID); } $this->logger->writeTimedString("workflowID is not set", 'continueWorkflow failed'); return null; } $this->logger->writeTimedString("payment object is not set", 'continueWorkflow failed'); return null; }
static function fetchByProcessID( $workflowprocessID ) { return eZPersistentObject::fetchObject( eZPaymentObject::definition(), null, array( 'workflowprocess_id' => $workflowprocessID ) ); }
function cleanup($process, $event) { //__DEBUG__ $this->logger->writeTimedString("cleanup"); //___end____ $paymentObj = eZPaymentObject::fetchByProcessID($process->attribute('id')); if (is_object($paymentObj)) { $paymentObj->remove(); } }
<?php /** * @copyright Copyright (C) eZ Systems AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. * @version 2014.11.1 * @package kernel */ $http = eZHTTPTool::instance(); $module = $Params['Module']; $orderID = $http->sessionVariable('MyTemporaryOrderID'); $order = eZOrder::fetch($orderID); if ($order instanceof eZOrder) { if ($order->attribute('is_temporary')) { $paymentObj = eZPaymentObject::fetchByOrderID($orderID); if ($paymentObj != null) { $startTime = time(); while (time() - $startTime < 25) { eZDebug::writeDebug("next iteration", "checkout"); $order = eZOrder::fetch($orderID); if ($order->attribute('is_temporary') == 0) { break; } else { sleep(2); } } } $order = eZOrder::fetch($orderID); if ($order->attribute('is_temporary') == 1 && $paymentObj == null) { $email = $order->accountEmail(); $order->setAttribute('email', $email);