Skip to content

Commit

Permalink
Mark reversed payments failed
Browse files Browse the repository at this point in the history
  • Loading branch information
Great-Antique committed Dec 29, 2016
1 parent 9f53df6 commit 10e56fc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions Action/PaymentDetailsStatusAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ public function execute($request)
Api::PAYMENTSTATUS_FAILED,
Api::PAYMENTSTATUS_EXPIRED,
Api::PAYMENTSTATUS_DENIED,
Api::PAYMENTSTATUS_REVERSED,
Api::PAYMENTSTATUS_CANCELED_REVERSAL,
);
if (in_array($paymentStatus, $failedStatuses)) {
Expand Down
19 changes: 19 additions & 0 deletions Tests/Action/PaymentDetailsStatusActionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,25 @@ public function shouldMarkFailedIfAtLeastOnePaymentStatusFailed()
$this->assertTrue($request->isFailed());
}

/**
* @test
*/
public function shouldMarkFailedIfAtLeastOnePaymentStatusReversed()
{
$action = new PaymentDetailsStatusAction();

$request = new GetHumanStatus(array(
'PAYMENTREQUEST_0_AMT' => 12,
'CHECKOUTSTATUS' => Api::CHECKOUTSTATUS_PAYMENT_COMPLETED,
'PAYMENTREQUEST_0_PAYMENTSTATUS' => Api::PAYMENTSTATUS_COMPLETED,
'PAYMENTREQUEST_9_PAYMENTSTATUS' => Api::PAYMENTSTATUS_REVERSED,
));

$action->execute($request);

$this->assertTrue($request->isFailed());
}

/**
* @test
*/
Expand Down

0 comments on commit 10e56fc

Please sign in to comment.