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
8414ff8a
Commit
8414ff8a
authored
May 29, 2024
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slightly chang fix & add fix elsewhere
parent
d12c269d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
15 deletions
+5
-15
PaymentController.php
src/Controller/PaymentController.php
+3
-5
PaymentStatusExtension.php
src/EventListener/PaymentStatusExtension.php
+2
-10
No files found.
src/Controller/PaymentController.php
View file @
8414ff8a
...
@@ -243,9 +243,9 @@ class PaymentController extends AbstractController
...
@@ -243,9 +243,9 @@ class PaymentController extends AbstractController
&&
array_key_exists
(
'vads_identifier'
,
$payment
->
getDetails
())
&&
array_key_exists
(
'vads_identifier'
,
$payment
->
getDetails
())
&&
$payment
->
getDetails
()[
'vads_identifier'
]
==
$vads_identifier
&&
$payment
->
getDetails
()[
'vads_identifier'
]
==
$vads_identifier
)
{
)
{
//
Do not use GetHumanStatus Payum constants as they do not match Payzen vads_trans_status
//
Payum GetHumanStatus constants don't match Payzen vads_trans_status here
// e.g. GetHumanStatus::STATUS_AUTHORIZED does not match 'authorised' value sent by Payzen
// e.g. GetHumanStatus::STATUS_AUTHORIZED does not match 'authorised' value sent by Payzen
if
(
'captured'
==
$new_status
||
'authorised'
==
$new_status
)
{
if
(
in_array
(
$new_status
,
[
'captured'
,
'authorised'
,
GetHumanStatus
::
STATUS_CAPTURED
,
GetHumanStatus
::
STATUS_AUTHORIZED
])
)
{
$this
->
paymentUtils
->
handlePayzenNotificationCore
(
$payment
);
$this
->
paymentUtils
->
handlePayzenNotificationCore
(
$payment
);
$this
->
em
->
flush
();
$this
->
em
->
flush
();
}
}
...
@@ -289,12 +289,10 @@ class PaymentController extends AbstractController
...
@@ -289,12 +289,10 @@ class PaymentController extends AbstractController
* current_payment_status will never match STATUS_AUTHORIZED
* current_payment_status will never match STATUS_AUTHORIZED
* on the opposite, we have no chance to detect 'authorised' value here
* on the opposite, we have no chance to detect 'authorised' value here
* because Payzen vads_trans_status is written 'authorised' and not 'authorized'
* because Payzen vads_trans_status is written 'authorised' and not 'authorized'
* However this code seems to work and I don't want to break it as this is Payum dependent
* and uses mechanisms I don't understand.
*
*
* @see comment above notifyRecurringPaymentAction for more Payum weird stuff
* @see comment above notifyRecurringPaymentAction for more Payum weird stuff
*/
*/
if
(
GetHumanStatus
::
STATUS_CAPTURED
==
$payment
->
getStatus
()
||
GetHumanStatus
::
STATUS_AUTHORIZED
==
$payment
->
getStatus
(
))
{
if
(
in_array
(
$payment
->
getStatus
(),
[
'captured'
,
'authorised'
,
GetHumanStatus
::
STATUS_CAPTURED
,
GetHumanStatus
::
STATUS_AUTHORIZED
]
))
{
$type
=
$payment
->
getDescription
();
$type
=
$payment
->
getDescription
();
if
(
Payment
::
TYPE_ACHAT_MONNAIE_ADHERENT
==
$type
||
Payment
::
TYPE_ACHAT_MONNAIE_PRESTA
==
$type
)
{
if
(
Payment
::
TYPE_ACHAT_MONNAIE_ADHERENT
==
$type
||
Payment
::
TYPE_ACHAT_MONNAIE_PRESTA
==
$type
)
{
...
...
src/EventListener/PaymentStatusExtension.php
View file @
8414ff8a
...
@@ -90,19 +90,11 @@ class PaymentStatusExtension implements ExtensionInterface
...
@@ -90,19 +90,11 @@ class PaymentStatusExtension implements ExtensionInterface
* current_payment_status will never match STATUS_AUTHORIZED
* current_payment_status will never match STATUS_AUTHORIZED
* on the opposite, we have no chance to detect 'authorised' value here
* on the opposite, we have no chance to detect 'authorised' value here
* because Payzen vads_trans_status is written 'authorised' and not 'authorized'
* because Payzen vads_trans_status is written 'authorised' and not 'authorized'
* However this code seems to work and I don't want to break it as this is Payum dependent
* and uses mechanisms I don't understand.
*
*
* @see comment above notifyRecurringPaymentAction for more Payum weird stuff
* @see comment above notifyRecurringPaymentAction for more Payum weird stuff
*/
*/
if
(
if
(
!
in_array
(
$current_payment_status
,
[
'captured'
,
'authorised'
,
GetHumanStatus
::
STATUS_CAPTURED
,
GetHumanStatus
::
STATUS_AUTHORIZED
]))
{
GetHumanStatus
::
STATUS_CAPTURED
!==
$current_payment_status
if
(
in_array
(
$new_status
,
[
'captured'
,
'authorised'
,
GetHumanStatus
::
STATUS_CAPTURED
,
GetHumanStatus
::
STATUS_AUTHORIZED
])
)
{
&&
GetHumanStatus
::
STATUS_AUTHORIZED
!=
$current_payment_status
)
{
if
(
GetHumanStatus
::
STATUS_CAPTURED
==
$new_status
||
GetHumanStatus
::
STATUS_AUTHORIZED
==
$new_status
)
{
$this
->
paymentUtils
->
handlePayzenNotificationCore
(
$payment
);
$this
->
paymentUtils
->
handlePayzenNotificationCore
(
$payment
);
// Invalidate (delete) notify token after payment is captured
// Invalidate (delete) notify token after payment is captured
$this
->
em
->
remove
(
$token
);
$this
->
em
->
remove
(
$token
);
...
...
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