Exemplo n.º 1
0
 /**
  * @test
  */
 public function shouldMarkPendingIfModelHasNotStatusButHasCard()
 {
     $action = new StatusAction();
     $model = array('card' => 'aCard');
     $action->execute($status = new GetHumanStatus($model));
     $this->assertTrue($status->isPending());
 }
Exemplo n.º 2
0
    /**
     * @test
     */
    public function shouldMarkPendingIfModelHasNotUsedTokenSet()
    {
        $action = new StatusAction();

        $model = array(
            'card' => 'not-used-token',
        );

        $action->execute($status = new GetHumanStatus($model));

        $this->assertTrue($status->isPending());
    }
Exemplo n.º 3
0
 /**
  * @test
  */
 public function shouldMarkPendingIfStatusIsPreauth()
 {
     $action = new StatusAction();
     $action->execute($status = new GetHumanStatus(['http_status_code' => 200, 'transaction' => ['response_code' => 20000, 'status' => 'preauth']]));
     $this->assertTrue($status->isPending());
 }
Exemplo n.º 4
0
 /**
  * @test
  */
 public function shouldNotMatchOthersThenSuspendedStatus()
 {
     $statusRequest = new GetHumanStatus(new \stdClass());
     $statusRequest->markSuspended();
     $this->assertTrue($statusRequest->isSuspended());
     $this->assertFalse($statusRequest->isCaptured());
     $this->assertFalse($statusRequest->isExpired());
     $this->assertFalse($statusRequest->isCanceled());
     $this->assertFalse($statusRequest->isPending());
     $this->assertFalse($statusRequest->isFailed());
     $this->assertFalse($statusRequest->isNew());
     $this->assertFalse($statusRequest->isUnknown());
 }
Exemplo n.º 5
0
 /**
  * @test
  */
 public function shouldMarkPendingIfStatusPending()
 {
     $action = new StatusAction();
     $action->execute($getStatus = new GetHumanStatus(array('status' => \KlarnaFlags::PENDING)));
     $this->assertTrue($getStatus->isPending());
 }
Exemplo n.º 6
0
 /**
  * @test
  */
 public function shouldMarkPendindIfAuthResultIsPending()
 {
     $action = new StatusAction();
     $action->execute($status = new GetHumanStatus(['authResult' => 'PENDING']));
     $this->assertTrue($status->isPending());
 }
Exemplo n.º 7
0
 /**
  * @test
  */
 public function shouldNotMatchOthersThenPayedoutStatus()
 {
     $getStatus = new GetHumanStatus(new \stdClass());
     $getStatus->markPayedout();
     $this->assertTrue($getStatus->isPayedout());
     $this->assertFalse($getStatus->isCaptured());
     $this->assertFalse($getStatus->isAuthorized());
     $this->assertFalse($getStatus->isExpired());
     $this->assertFalse($getStatus->isCanceled());
     $this->assertFalse($getStatus->isPending());
     $this->assertFalse($getStatus->isFailed());
     $this->assertFalse($getStatus->isNew());
     $this->assertFalse($getStatus->isUnknown());
 }