execute() public méthode

{@inheritDoc}
public execute ( $request )
Exemple #1
0
 /**
  * @test
  */
 public function shouldNotAddNotifyUrlIfCaptureTokenNotSet()
 {
     $details = new \ArrayObject();
     $tokenFactoryMock = $this->getMock(GenericTokenFactoryInterface::class);
     $tokenFactoryMock->expects($this->never())->method('createNotifyToken');
     $action = new CaptureAction();
     $action->setGateway($this->createGatewayMock());
     $action->setGenericTokenFactory($tokenFactoryMock);
     $action->execute(new Capture($details));
     $this->assertNotEmpty($details);
     $this->assertArrayNotHasKey('PAYMENTREQUEST_0_NOTIFYURL', $details);
 }
 /**
  * @test
  */
 public function shouldNotRequestDoExpressCheckoutPaymentActionIfAmountZero()
 {
     $paymentMock = $this->createPaymentMock();
     $paymentMock->expects($this->at(0))->method('execute')->with($this->isInstanceOf('Payum\\Core\\Request\\Sync'));
     $paymentMock->expects($this->at(1))->method('execute')->with($this->isInstanceOf('Payum\\Core\\Request\\Sync'));
     $action = new CaptureAction();
     $action->setPayment($paymentMock);
     $action->execute(new Capture(array('TOKEN' => 'aToken', 'CHECKOUTSTATUS' => Api::CHECKOUTSTATUS_PAYMENT_ACTION_NOT_INITIATED, 'PAYERID' => 'aPayerId', 'PAYMENTREQUEST_0_AMT' => 0)));
 }