public function updateCustomerEmailAddress(Customweb_Payment_ExternalCheckout_IContext $context, $emailAddress) { if (!$context instanceof Customweb_Payment_ExternalCheckout_AbstractContext) { throw new Customweb_Core_Exception_CastException('Customweb_Payment_ExternalCheckout_AbstractContext'); } if ($context->getState() != Customweb_Payment_ExternalCheckout_IContext::STATE_PENDING) { throw new Exception("The external checkout context cannot updated, while the context is already in state COMPLETED or FAILED."); } $context->setCustomerEmailAddress($emailAddress); $this->refreshContext($context); $this->updateUserSessionWithCurrentUser($context); $this->entityManager->persist($context); }
public function updateCustomerEmailAddress(Customweb_Payment_ExternalCheckout_IContext $context, $emailAddress) { if (!$context instanceof Customweb_SaferpayCw_Model_ExternalCheckoutContext) { throw new Customweb_Core_Exception_CastException('Customweb_SaferpayCw_Model_ExternalCheckoutContext'); } $context->setState(Customweb_Payment_ExternalCheckout_IContext::STATE_PENDING); $context->setCustomerEmailAddress($emailAddress); $this->refreshContext($context); $this->updateUserSessionWithCurrentUser($context); $context->save(); }