Skip to content

Commit

Permalink
Updated Transaction start.
Browse files Browse the repository at this point in the history
When DateTimes are a string, they will be converted to a DateTime Object
  • Loading branch information
Andy Pieters committed Mar 31, 2016
1 parent 89ab00e commit 369dc4f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
}

Expand Down Expand Up @@ -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']);
}

Expand All @@ -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'])) {
Expand Down

0 comments on commit 369dc4f

Please sign in to comment.