本文整理匯總了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;
}
示例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;
}
示例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;
}
示例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());
}
示例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());
}