public function updateShippingAddress(Customweb_Payment_ExternalCheckout_IContext $context, Customweb_Payment_Authorization_OrderContext_IAddress $address)
 {
     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.");
     }
     $this->checkAddress($address);
     $context->setShippingAddress($address);
     $this->refreshContext($context);
     $this->entityManager->persist($context, false);
 }
 public function updateShippingAddress(Customweb_Payment_ExternalCheckout_IContext $context, Customweb_Payment_Authorization_OrderContext_IAddress $address)
 {
     if (!$context instanceof Customweb_SaferpayCw_Model_ExternalCheckoutContext) {
         throw new Customweb_Core_Exception_CastException('Customweb_SaferpayCw_Model_ExternalCheckoutContext');
     }
     $this->checkAddress($address);
     $context->setState(Customweb_Payment_ExternalCheckout_IContext::STATE_PENDING);
     $context->setShippingAddress($address);
     $this->refreshContext($context);
     $context->save();
 }