Skip to content

Commit 1251ab0

Browse files
committed
Refund action.
1 parent 6183565 commit 1251ab0

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Diff for: src/Action/RefundAction.php

-4
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ public function execute($request)
3030

3131
$model = ArrayObject::ensureArrayObject($request->getModel());
3232

33-
// TODO
34-
35-
return;
36-
3733
$this->gateway->execute($status = new GetHumanStatus($model));
3834
if ($status->isCaptured()) {
3935
$model['state_override'] = 'refunded';

Diff for: src/Action/StatusAction.php

+6
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ public function execute($request)
4242
default :
4343
$request->markUnknown();
4444
}
45+
46+
if ($request->isCaptured() && false != $code = $model['state_override']) {
47+
if ($code == 'refunded') {
48+
$request->markRefunded();
49+
}
50+
}
4551
}
4652

4753
/**

0 commit comments

Comments
 (0)