Skip to content

Commit

Permalink
payment date default today
Browse files Browse the repository at this point in the history
  • Loading branch information
chielsen committed Mar 27, 2015
1 parent 4f220b5 commit 7156761
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/NextTalent/AcumulusPhp/Providers/InvoicesProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,12 @@ public function getPaymentStatus($token)
return $this;
}

public function setPaymentStatus($token, $paymentstatus = 1, $paymentdate)
public function setPaymentStatus($token, $paymentstatus = 1, $paymentdate = null)
{
if($paymentdate === null) {
$paymentdate = date('Y-m-d');
}

// Validate paymentdate before sending it off
$datetime = \DateTime::createFromFormat("Y-m-d", $paymentdate);
if (!$datetime and $datetime->format('Y-m-d') !== $paymentdate) {
Expand Down

0 comments on commit 7156761

Please sign in to comment.