Skip to content

Commit

Permalink
* Reference isn't needed, since it will already be known.
Browse files Browse the repository at this point in the history
* Add `fetchTransaction` requirement to supports.
  • Loading branch information
koemeet committed Oct 6, 2016
1 parent 203f64e commit 28b7d24
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/Action/NotifyAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,8 @@ public function execute($request)

$response = $this->omnipayGateway->fetchTransaction($details->toUnsafeArray())->send();

$data = $response->getData();
$details->replace((array)$response->getData());

if (is_array($data)) {
$details->replace($data);
}

$details['_reference'] = $response->getTransactionReference();
$details['_status'] = $response->isSuccessful() ? 'captured' : 'failed';
$details['_status_code'] = $response->getCode();
$details['_status_message'] = $response->isSuccessful() ? '' : $response->getMessage();
Expand All @@ -48,7 +43,8 @@ public function supports($request)
{
return
$request instanceof Notify &&
$request->getModel() instanceof \ArrayAccess
$request->getModel() instanceof \ArrayAccess &&
method_exists($this->omnipayGateway, 'fetchTransaction')
;
}
}

0 comments on commit 28b7d24

Please sign in to comment.