Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kohinos-tav
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
agplv3
kohinos-tav
Commits
85a9eecd
Commit
85a9eecd
authored
Apr 24, 2024
by
Yvon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
indent
parent
b87e8ca2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
Payment.php
src/Entity/Payment.php
+10
-8
No files found.
src/Entity/Payment.php
View file @
85a9eecd
...
...
@@ -192,18 +192,20 @@ class Payment extends BasePayment
*/
public
function
isRecurringPaymentEndedOrExpired
(
&
$reason
)
{
if
(
!
$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
)
if
(
!
$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."
;
return
null
;
}
$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'
];
return
null
;
}
...
...
@@ -220,10 +222,10 @@ class Payment extends BasePayment
//Now check expiry date
$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
();
if
(
$paymentEndDate
&&
$paymentEndDate
<
$paymentEndDateDueToExpiry
)
{
if
(
$paymentEndDate
&&
$paymentEndDate
<
$paymentEndDateDueToExpiry
)
{
//Compare now with payment end date
$reason
=
"Paiement récurrent en cours jusqu'à dernière échéance le "
.
$paymentEndDate
->
format
(
'd/m/Y'
)
.
"."
;
return
$now
>=
$paymentEndDate
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment