From bbbf7047211c40ac438f5cf4b984141edcb9301a Mon Sep 17 00:00:00 2001 From: Mati Kochen Date: Wed, 18 Oct 2017 10:43:19 +0200 Subject: [PATCH 1/2] add support for push notifications --- src/Message/AbstractRequest.php | 47 +++++++++++++++++++++++++++ tests/Message/AbstractRequestTest.php | 4 +++ 2 files changed, 51 insertions(+) diff --git a/src/Message/AbstractRequest.php b/src/Message/AbstractRequest.php index 29ca0ba..0b88a34 100644 --- a/src/Message/AbstractRequest.php +++ b/src/Message/AbstractRequest.php @@ -84,6 +84,51 @@ public function setErrorUrl($value) return $this->setParameter('errorUrl', $value); } + /** + * returns the push URL + * + * @return string pushUrl + */ + public function getPushUrl() + { + return $this->getParameter('pushUrl'); + } + + /** + * sets the push URL which is used by buckaroo when + * the payment results is sent via push + * + * @param $value + * + * @return \Omnipay\Common\Message\AbstractRequest + */ + public function setPushUrl($value) + { + return $this->setParameter('pushUrl', $value); + } + + /** + * returns the push failure URL + * + * @return string pushfailureUrl + */ + public function getPushFailureUrl() + { + return $this->getParameter('pushfailureUrl'); + } + + /** + * sets the push failure URL which is used by buckaroo when + * the payment error results is sent via push + * + * @param $value + * + * @return \Omnipay\Common\Message\AbstractRequest + */ + public function setPushFailureUrl($value) + { + return $this->setParameter('pushfailureUrl', $value); + } public function getData() { @@ -100,6 +145,8 @@ public function getData() $data['Brq_returnreject'] = $this->getRejectUrl(); $data['Brq_returnerror'] = $this->getErrorUrl(); $data['Brq_culture'] = $this->getCulture(); + $data['Brq_push'] = $this->getPushUrl(); + $data['Brq_pushfailure'] = $this->getPushFailureUrl(); return $data; } diff --git a/tests/Message/AbstractRequestTest.php b/tests/Message/AbstractRequestTest.php index 190a3a8..8d32a43 100644 --- a/tests/Message/AbstractRequestTest.php +++ b/tests/Message/AbstractRequestTest.php @@ -34,6 +34,8 @@ public function testGetData() 'errorUrl' => 'https://www.example.com/error', 'rejectUrl' => 'https://www.example.com/reject', 'culture' => 'nl-NL', + 'pushUrl' => 'https://www.example.com/push', + 'pushfailureUrl' => 'https://www.example.com/pushfailure', )); $data = $this->request->getData(); @@ -47,6 +49,8 @@ public function testGetData() $this->assertSame('https://www.example.com/error', $data['Brq_returnerror']); $this->assertSame('https://www.example.com/reject', $data['Brq_returnreject']); $this->assertSame('nl-NL', $data['Brq_culture']); + $this->assertSame('https://www.example.com/push', $data['Brq_push']); + $this->assertSame('https://www.example.com/pushfailure', $data['Brq_pushfailure']); } public function testGenerateSignature() From 9a08cb145acc20f91533e3d50cc57fb03e30f9ec Mon Sep 17 00:00:00 2001 From: MtK Date: Wed, 18 Oct 2017 14:52:20 +0200 Subject: [PATCH 2/2] Make Travis work with PHP 5.3 specifying a dist See: https://github.com/travis-ci/travis-ci/issues/8219 --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index b0b3ada..43e6f66 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,7 @@ language: php +dist: precise + php: - 5.3 - 5.4