From 89ab00e980b3c0c5d10e145e1c5f0674c612db11 Mon Sep 17 00:00:00 2001 From: Andy Pieters Date: Thu, 31 Mar 2016 12:27:46 +0200 Subject: [PATCH 1/2] Added portnumber to getBaseUrl --- src/Helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Helper.php b/src/Helper.php index ed184cfc..3d0405a8 100644 --- a/src/Helper.php +++ b/src/Helper.php @@ -197,8 +197,8 @@ public static function splitAddress($strAddress) public static function getBaseUrl() { $protocol = isset($_SERVER["HTTPS"]) ? 'https' : 'http'; + $url = $protocol . '://' . $_SERVER['SERVER_NAME'] .':'.$_SERVER['SERVER_PORT']. $_SERVER['REQUEST_URI']; - $url = $protocol . '://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; // op de laatste / afknippen (index.php willen we niet zien) $baseUrl = substr($url, 0, strrpos($url, '/')); From 369dc4fa109f46a0ccf51c827a94affb5522b832 Mon Sep 17 00:00:00 2001 From: Andy Pieters Date: Thu, 31 Mar 2016 12:28:40 +0200 Subject: [PATCH 2/2] Updated Transaction start. When DateTimes are a string, they will be converted to a DateTime Object --- src/Transaction.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Transaction.php b/src/Transaction.php index 92d4fc53..a8c37bab 100644 --- a/src/Transaction.php +++ b/src/Transaction.php @@ -48,6 +48,9 @@ public static function start($options = array()) $api->setCurrency($options['currency']); } if(isset($options['expireDate'])){ + if(is_string($options['expireDate'])){ + $options['expireDate'] = new \DateTime($options['expireDate']); + } $api->setExpireDate($options['expireDate']); } @@ -89,10 +92,16 @@ public static function start($options = array()) } if(isset($options['invoiceDate'])){ + if(is_string($options['invoiceDate'])){ + $options['invoiceDate'] = new \DateTime($options['invoiceDate']); + } $api->setInvoiceDate($options['invoiceDate']); } if(isset($options['deliveryDate'])){ + if(is_string($options['deliveryDate'])){ + $options['deliveryDate'] = new \DateTime($options['deliveryDate']); + } $api->setDeliveryDate($options['deliveryDate']); } @@ -106,6 +115,9 @@ public static function start($options = array()) } $enduser = array(); if (isset($options['enduser'])) { + if(isset($options['enduser']['birthDate'])){ + $options['enduser']['birthDate'] = new \DateTime($options['enduser']['birthDate']); + } $enduser = $options['enduser']; } if (isset($options['language'])) {