Commit 85a9eecd by Yvon

indent

parent b87e8ca2
...@@ -192,18 +192,20 @@ class Payment extends BasePayment ...@@ -192,18 +192,20 @@ class Payment extends BasePayment
*/ */
public function isRecurringPaymentEndedOrExpired(&$reason) public function isRecurringPaymentEndedOrExpired(&$reason)
{ {
if(!$this->details if (
|| !array_key_exists('vads_effective_creation_date',$this->details) !$this->details
|| !array_key_exists('vads_expiry_year',$this->details) || !array_key_exists('vads_effective_creation_date', $this->details)
|| !array_key_exists('vads_effective_creation_date',$this->details) || !array_key_exists('vads_expiry_year', $this->details)
|| !array_key_exists('vads_effective_creation_date', $this->details)
) { ) {
$reason = "Attribut détails vide ou clés absentes."; $reason = "Attribut détails vide ou clés absentes.";
return null; return null;
} }
$firstDayOfCreationMonth = DateTime::createFromFormat( $firstDayOfCreationMonth = DateTime::createFromFormat(
'Ymd',substr($this->details['vads_effective_creation_date'],0,6) . "01" 'Ymd',
substr($this->details['vads_effective_creation_date'], 0, 6) . "01"
); );
if(!$firstDayOfCreationMonth) { if (!$firstDayOfCreationMonth) {
$reason = "Error parsing vads_effective_creation_date : " . $this->details['vads_effective_creation_date']; $reason = "Error parsing vads_effective_creation_date : " . $this->details['vads_effective_creation_date'];
return null; return null;
} }
...@@ -220,10 +222,10 @@ class Payment extends BasePayment ...@@ -220,10 +222,10 @@ class Payment extends BasePayment
//Now check expiry date //Now check expiry date
$paymentEndDateDueToExpiry = new DateTime(); $paymentEndDateDueToExpiry = new DateTime();
$paymentEndDateDueToExpiry->setDate($this->details['vads_expiry_year'],$this->details['vads_expiry_month'],$day+1); $paymentEndDateDueToExpiry->setDate($this->details['vads_expiry_year'], $this->details['vads_expiry_month'], $day + 1);
$now = new DateTime(); $now = new DateTime();
if($paymentEndDate && $paymentEndDate < $paymentEndDateDueToExpiry) { if ($paymentEndDate && $paymentEndDate < $paymentEndDateDueToExpiry) {
//Compare now with payment end date //Compare now with payment end date
$reason = "Paiement récurrent en cours jusqu'à dernière échéance le " . $paymentEndDate->format('d/m/Y') . "."; $reason = "Paiement récurrent en cours jusqu'à dernière échéance le " . $paymentEndDate->format('d/m/Y') . ".";
return $now >= $paymentEndDate; return $now >= $paymentEndDate;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment