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
1
Merge Requests
1
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
de69d0fa
Commit
de69d0fa
authored
Mar 26, 2024
by
Yvon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prevent multiple flux creation on user redirection to payment/done after recurring payment creation
parent
ad6e0143
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
PaymentController.php
src/Controller/PaymentController.php
+9
-6
No files found.
src/Controller/PaymentController.php
View file @
de69d0fa
...
@@ -227,13 +227,16 @@ class PaymentController extends AbstractController
...
@@ -227,13 +227,16 @@ class PaymentController extends AbstractController
//so we should not be handling recurring payment after the initial payement.
//so we should not be handling recurring payment after the initial payement.
//We must indeed prevent a user from a browser reload e.g.
//We must indeed prevent a user from a browser reload e.g.
if
(
GetHumanStatus
::
STATUS_NEW
==
$payment
->
getStatus
())
{
if
(
$payment
->
getIsRecurrent
())
{
// No notification arrived at this point : execute Notify action
//Because we take into account all incoming notifications for recurring payments,
// Recurring payment should not trigger notify action here except on initial payment
//neither successive recurring payment occurences nor initial recurring payment should be
// as only Payzen agent is allowed to trigger occurences after the first one
//handled by this controler as it will lead to duplicates.
//so...
//- do not execute notify
//- do not invalidate token
}
elseif
(
GetHumanStatus
::
STATUS_NEW
==
$payment
->
getStatus
())
{
// First time we receive notification for this payment : execute Notify action and invalidate token
$gateway
->
execute
(
new
Notify
(
$token
));
$gateway
->
execute
(
new
Notify
(
$token
));
}
elseif
(
!
$payment
->
getIsRecurrent
())
{
// Invalidate token, except if payment is recurrent
$this
->
payum
->
getHttpRequestVerifier
()
->
invalidate
(
$token
);
$this
->
payum
->
getHttpRequestVerifier
()
->
invalidate
(
$token
);
}
else
{
}
else
{
//maybe user is trying to trigger another occurence of a recurring payment
//maybe user is trying to trigger another occurence of a recurring payment
...
...
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