/**
  * @param \Payum\Core\Action\ActionInterface $action
  * @param mixed                              $request
  *
  * @return RequestNotSupportedException
  */
 public static function createActionNotSupported(ActionInterface $action, $request)
 {
     $exception = new self(sprintf("Action %s is not supported the request %s. %s", Humanify::value($action), Humanify::request($request), implode(" ", static::suggestions($request))));
     $exception->request = $request;
     $exception->action = $action;
     return $exception;
 }
예제 #2
0
 /**
  * {@inheritDoc}
  */
 public function onPostExecute(Context $context)
 {
     if ($context->getReply()) {
         $this->logger->debug(sprintf('[Payum] %d# %s::execute(%s) throws reply %s', count($context->getPrevious()) + 1, Humanify::value($context->getAction()), Humanify::request($context->getRequest()), Humanify::request($context->getReply())));
     } elseif ($context->getException()) {
         $this->logger->debug(sprintf('[Payum] %d# %s::execute(%s) throws exception %s', count($context->getPrevious()) + 1, $context->getAction() ? Humanify::value($context->getAction()) : 'Gateway', Humanify::request($context->getRequest()), Humanify::value($context->getException())));
     }
 }
 /**
  * {@inheritDoc}
  */
 public function onException(\Exception $exception, $request, ActionInterface $action = null)
 {
     $this->logger->debug(sprintf('[Payum] %d# %s::execute(%s) throws exception %s', $this->stackLevel, $action ? Humanify::value($action) : 'Payment', Humanify::request($request), Humanify::value($exception)));
     $this->stackLevel--;
 }
예제 #4
0
 /**
  * @test
  */
 public function shouldReturnReplyShortClassAndUrlIfHttpRedirectReplyOnRequest()
 {
     $request = new HttpRedirect('http://example.com/foo');
     $this->assertEquals('HttpRedirect{url: http://example.com/foo}', Humanify::request($request));
 }
 /**
  * @param \Payum\Core\Action\ActionInterface $action
  * @param mixed $request
  *
  * @return RequestNotSupportedException
  */
 public static function createActionNotSupported(ActionInterface $action, $request)
 {
     return new self(sprintf('Action %s is not supported the request %s.', Humanify::value($action), Humanify::request($request)));
 }
예제 #6
0
 /**
  * @test
  */
 public function shouldReturnRequestShortClassAndUrlIfRedirectUrlInteractiveRequestOnRequest()
 {
     $request = new RedirectUrlInteractiveRequest('http://example.com/foo');
     $this->assertEquals('RedirectUrlInteractiveRequest{url: http://example.com/foo}', Humanify::request($request));
 }