From 369dc4fa109f46a0ccf51c827a94affb5522b832 Mon Sep 17 00:00:00 2001 From: Andy Pieters Date: Thu, 31 Mar 2016 12:28:40 +0200 Subject: [PATCH] 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'])) {