/** * @test */ public function shouldNotMarkRefundedIfStatusNotSetAndRefundedTrue() { $action = new StatusAction(); $model = array('refunded' => true); $action->execute($status = new GetHumanStatus($model)); $this->assertFalse($status->isRefunded()); $this->assertTrue($status->isNew()); }
/** * @test */ public function shouldNotMatchOthersThenCapturedStatus() { $statusRequest = new GetHumanStatus(new \stdClass()); $statusRequest->markCaptured(); $this->assertTrue($statusRequest->isCaptured()); $this->assertFalse($statusRequest->isCanceled()); $this->assertFalse($statusRequest->isSuspended()); $this->assertFalse($statusRequest->isAuthorized()); $this->assertFalse($statusRequest->isRefunded()); $this->assertFalse($statusRequest->isExpired()); $this->assertFalse($statusRequest->isPending()); $this->assertFalse($statusRequest->isFailed()); $this->assertFalse($statusRequest->isNew()); $this->assertFalse($statusRequest->isUnknown()); }
/** * @test */ public function shouldMarkRefundedIfStatusIsPartaillyRefunded() { $action = new StatusAction(); $action->execute($status = new GetHumanStatus(['http_status_code' => 200, 'transaction' => ['response_code' => 20000, 'status' => 'partially_refunded']])); $this->assertTrue($status->isRefunded()); }
/** * @test */ public function shouldMarkRefundedIfAuthResultIsRefund() { $action = new StatusAction(); $action->execute($status = new GetHumanStatus(['authResult' => 'REFUND'])); $this->assertTrue($status->isRefunded()); }
/** * @test */ public function shouldMarkRefundedIfRefundInvoiceNumberSet() { $action = new StatusAction(); $action->execute($getStatus = new GetHumanStatus(array('refund_invoice_number' => 'aNum'))); $this->assertTrue($getStatus->isRefunded()); }