diff --git a/README.md b/README.md index ddc5943..c6bd81f 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/Message/CompleteRequest.php b/src/Message/CompleteRequest.php index 3e2cd9e..dde2b71 100644 --- a/src/Message/CompleteRequest.php +++ b/src/Message/CompleteRequest.php @@ -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); } diff --git a/src/Message/NotificationRequest.php b/src/Message/NotificationRequest.php index e0b3051..aa71b6e 100644 --- a/src/Message/NotificationRequest.php +++ b/src/Message/NotificationRequest.php @@ -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); } }