Skip to content

Commit 10e56fc

Browse files
committed
Mark reversed payments failed
1 parent 9f53df6 commit 10e56fc

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

Action/PaymentDetailsStatusAction.php

+1
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ public function execute($request)
136136
Api::PAYMENTSTATUS_FAILED,
137137
Api::PAYMENTSTATUS_EXPIRED,
138138
Api::PAYMENTSTATUS_DENIED,
139+
Api::PAYMENTSTATUS_REVERSED,
139140
Api::PAYMENTSTATUS_CANCELED_REVERSAL,
140141
);
141142
if (in_array($paymentStatus, $failedStatuses)) {

Tests/Action/PaymentDetailsStatusActionTest.php

+19
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,25 @@ public function shouldMarkFailedIfAtLeastOnePaymentStatusFailed()
294294
$this->assertTrue($request->isFailed());
295295
}
296296

297+
/**
298+
* @test
299+
*/
300+
public function shouldMarkFailedIfAtLeastOnePaymentStatusReversed()
301+
{
302+
$action = new PaymentDetailsStatusAction();
303+
304+
$request = new GetHumanStatus(array(
305+
'PAYMENTREQUEST_0_AMT' => 12,
306+
'CHECKOUTSTATUS' => Api::CHECKOUTSTATUS_PAYMENT_COMPLETED,
307+
'PAYMENTREQUEST_0_PAYMENTSTATUS' => Api::PAYMENTSTATUS_COMPLETED,
308+
'PAYMENTREQUEST_9_PAYMENTSTATUS' => Api::PAYMENTSTATUS_REVERSED,
309+
));
310+
311+
$action->execute($request);
312+
313+
$this->assertTrue($request->isFailed());
314+
}
315+
297316
/**
298317
* @test
299318
*/

0 commit comments

Comments
 (0)