예제 #1
0
 /**
  * @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)));
 }
예제 #2
0
    /**
     * @test
     */
    public function shouldNotAddNotifyUrlIfCaptureTokenNotSet()
    {
        $details = new \ArrayObject();

        $tokenFactoryMock = $this->getMock('Payum\Core\Security\GenericTokenFactoryInterface');
        $tokenFactoryMock
            ->expects($this->never())
            ->method('createNotifyToken')
        ;

        $action = new CaptureAction();
        $action->setPayment($this->createPaymentMock());
        $action->setGenericTokenFactory($tokenFactoryMock);

        $action->execute(new Capture($details));

        $this->assertNotEmpty($details);

        $this->assertArrayNotHasKey('PAYMENTREQUEST_0_NOTIFYURL', $details);
    }