当前位置: 首页>>代码示例>>PHP>>正文


PHP RequestNotSupportedException::create方法代码示例

本文整理汇总了PHP中Payum\Core\Exception\RequestNotSupportedException::create方法的典型用法代码示例。如果您正苦于以下问题:PHP RequestNotSupportedException::create方法的具体用法?PHP RequestNotSupportedException::create怎么用?PHP RequestNotSupportedException::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Payum\Core\Exception\RequestNotSupportedException的用法示例。


在下文中一共展示了RequestNotSupportedException::create方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 /**
  * {@inheritDoc}
  */
 public function execute($request, $catchReply = false)
 {
     $context = new Context($this, $request, $this->stack);
     array_push($this->stack, $context);
     try {
         $this->extensions->onPreExecute($context);
         if (false == $context->getAction()) {
             if (false == ($action = $this->findActionSupported($context->getRequest()))) {
                 throw RequestNotSupportedException::create($context->getRequest());
             }
             $context->setAction($action);
         }
         $this->extensions->onExecute($context);
         $context->getAction()->execute($request);
         $this->extensions->onPostExecute($context);
         array_pop($this->stack);
     } catch (ReplyInterface $reply) {
         $context->setReply($reply);
         $this->extensions->onPostExecute($context);
         array_pop($this->stack);
         if ($catchReply && $context->getReply()) {
             return $context->getReply();
         }
         if ($context->getReply()) {
             throw $context->getReply();
         }
     } catch (\Exception $e) {
         $context->setException($e);
         $this->onPostExecuteWithException($context);
     }
     return;
 }
开发者ID:payum,项目名称:core,代码行数:35,代码来源:Gateway.php

示例2: execute

 /**
  * {@inheritDoc}
  */
 public function execute($request, $catchReply = false)
 {
     $action = null;
     try {
         $this->extensions->onPreExecute($request);
         if (false == ($action = $this->findActionSupported($request))) {
             throw RequestNotSupportedException::create($request);
         }
         $this->extensions->onExecute($request, $action);
         $action->execute($request);
         $this->extensions->onPostExecute($request, $action);
     } catch (ReplyInterface $reply) {
         $reply = $this->extensions->onReply($reply, $request, $action) ?: $reply;
         if ($catchReply) {
             return $reply;
         }
         throw $reply;
     } catch (\Exception $e) {
         $this->extensions->onException($e, $request, $action ?: null);
         throw $e;
     }
     return null;
 }
开发者ID:Studio-40,项目名称:Payum,代码行数:26,代码来源:Payment.php

示例3: execute

 /**
  * {@inheritDoc}
  */
 public function execute($request, $catchInteractive = false)
 {
     $action = null;
     try {
         $this->extensions->onPreExecute($request);
         if (false == ($action = $this->findActionSupported($request))) {
             throw RequestNotSupportedException::create($request);
         }
         $this->extensions->onExecute($request, $action);
         $action->execute($request);
         $this->extensions->onPostExecute($request, $action);
     } catch (InteractiveRequestInterface $interactiveRequest) {
         $interactiveRequest = $this->extensions->onInteractiveRequest($interactiveRequest, $request, $action) ?: $interactiveRequest;
         if ($catchInteractive) {
             return $interactiveRequest;
         }
         throw $interactiveRequest;
     } catch (\Exception $e) {
         $this->extensions->onException($e, $request, $action ?: null);
         throw $e;
     }
     return null;
 }
开发者ID:sanchojaf,项目名称:oldmytriptocuba,代码行数:26,代码来源:Payment.php

示例4: shouldCreateWithSuggestionsOnIdentityAsModel

 /**
  * @test
  */
 public function shouldCreateWithSuggestionsOnIdentityAsModel()
 {
     $request = new Capture(new Identity('theId', \stdClass::class));
     $exception = RequestNotSupportedException::create($request);
     $this->assertInstanceOf(RequestNotSupportedException::class, $exception);
     $this->assertEquals('Request Capture{model: Identity} is not supported. Make sure the storage extension for "stdClass" is registered to the gateway. Make sure the storage find method returns an instance by id "theId". Make sure the gateway supports the requests and there is an action which supports this request (The method returns true). There may be a bug, so look for a related issue on the issue tracker.', $exception->getMessage());
 }
开发者ID:eamador,项目名称:Payum,代码行数:10,代码来源:RequestNotSupportedExceptionTest.php

示例5: shouldCreateWithObjectRequest

 /**
  * @test
  */
 public function shouldCreateWithObjectRequest()
 {
     $exception = RequestNotSupportedException::create(new \stdClass());
     $this->assertInstanceOf('Payum\\Core\\Exception\\RequestNotSupportedException', $exception);
     $this->assertEquals('Request stdClass is not supported.', $exception->getMessage());
 }
开发者ID:nksoo,项目名称:Payum,代码行数:9,代码来源:RequestNotSupportedExceptionTest.php


注:本文中的Payum\Core\Exception\RequestNotSupportedException::create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。