{@inheritDoc}
public execute ( Payum\Core\Request\Authorize $request ) | ||
$request | Payum\Core\Request\Authorize |
/** * @test */ public function shouldGeneratePushUriIfNotSet() { $config = new Config(); $config->termsUri = 'theTermsUri'; $token = new Token(); $token->setTargetUrl('theTargetUrl'); $token->setGatewayName('theGatewayName'); $token->setDetails($identity = new Identity('id', 'class')); $notifyToken = new Token(); $notifyToken->setTargetUrl('theNotifyUrl'); $tokenFactory = $this->getMock(GenericTokenFactoryInterface::class); $tokenFactory->expects($this->once())->method('createNotifyToken')->with('theGatewayName', $this->identicalTo($identity))->will($this->returnValue($notifyToken)); $action = new AuthorizeAction('aTemplate'); $action->setGateway($this->createGatewayMock()); $action->setApi($config); $action->setGenericTokenFactory($tokenFactory); $authorize = new Authorize($token); $authorize->setModel(['location' => 'aLocation', 'merchant' => ['confirmation_uri' => 'theConfirmationUri', 'checkout_uri' => 'theCheckoutUri', 'terms_uri' => 'theTermsUri']]); $action->execute($authorize); }
/** * @test */ public function shouldNotThrowReplyWhenStatusCreated() { $action = new AuthorizeAction('aTemplate'); $action->setPayment($this->createPaymentMock()); $action->execute(new Authorize(array( 'location' => 'aLocation', 'status' => Constants::STATUS_CREATED, 'gui' => array('snippet' => 'theSnippet'), ))); }