Skip to content

Commit

Permalink
Issue #6 make cardReference availsble to notification response.
Browse files Browse the repository at this point in the history
  • Loading branch information
judgej committed Mar 12, 2018
1 parent a741066 commit bc274ab
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,14 @@ $notifyRequest = $gateway->acceptNotification();
$notifyResponse = $notifyRequest->send();
```

If `createCard` is set in the `$gateway` or `acceptNotification()`,
then the reusable card token will be available in the notify response,
along with the usual Omnipay methods:

```php
$notifyResponse->getCardReference()
```

Once the authorisation is complete, the amount still needs to be captured.

#### Credit Card Authorize Notify
Expand Down
9 changes: 9 additions & 0 deletions src/Message/CompleteRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ public function sendData($data)
}
}

return $this->createResponse($data);
}

/**
* @param array $data
* @return CompleteResponse
*/
public function createResponse(array $data)
{
return $this->response = new CompleteResponse($this, $data);
}

Expand Down
7 changes: 2 additions & 5 deletions src/Message/NotificationRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,11 @@
class NotificationRequest extends CompleteRequest
{
/**
* @throws InvalidRequestException
* @param array $data
* @return CompleteAuthotizeResponse
* @return NotificationResponse
*/
public function sendData($data)
public function createResponse(array $data)
{
$this->validateNotificationData($data);

return $this->response = new NotificationResponse($this, $data);
}
}

0 comments on commit bc274ab

Please sign in to comment.