Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
commerce_2c2p
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
commerce_2c2p
Commits
208efeb1
Commit
208efeb1
authored
6 months ago
by
jose
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3418378
by Redwan Jamous: Use loadForUpdate when creating payments inside onNotify
parent
e0319921
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Plugin/Commerce/PaymentGateway/OffsiteRedirect2C2P.php
+6
-1
6 additions, 1 deletion
src/Plugin/Commerce/PaymentGateway/OffsiteRedirect2C2P.php
with
6 additions
and
1 deletion
src/Plugin/Commerce/PaymentGateway/OffsiteRedirect2C2P.php
+
6
−
1
View file @
208efeb1
...
...
@@ -222,7 +222,7 @@ class OffsiteRedirect2C2P extends OffsitePaymentGatewayBase {
$this
->
getLogger
(
'commerce_2c2p'
)
->
debug
(
'2C2P Payload Response notify '
.
serialize
(
$pt_res_payload
));
/** @var \Drupal\commerce_order\entity\OrderInterface $order */
list
(,
$order_id
)
=
explode
(
'-'
,
$pt_res_payload
->
invoiceNo
);
$order
=
$this
->
entityTypeManager
->
getStorage
(
'commerce_order'
)
->
load
Unchanged
(
$order_id
);
$order
=
$this
->
entityTypeManager
->
getStorage
(
'commerce_order'
)
->
load
ForUpdate
(
$order_id
);
if
(
!
$order
)
{
$this
->
getLogger
(
'commerce_2c2p'
)
->
error
(
'Invalid order ID from gateway: @reference'
,
[
'@reference'
=>
$pt_res_payload
->
invoiceNo
]);
throw
new
PaymentGatewayException
(
'Invalid order ID from gateway.'
);
...
...
@@ -249,6 +249,11 @@ class OffsiteRedirect2C2P extends OffsitePaymentGatewayBase {
catch
(
\UnexpectedValueException
|
PaymentGatewayException
)
{
return
new
Response
(
''
,
200
);
}
finally
{
if
(
$order
??
NULL
)
{
$order
->
save
();
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment