Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
commerce_datatrans
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_datatrans
Commits
3fa47446
Commit
3fa47446
authored
8 years ago
by
András Czövek
Committed by
András Czövek
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2822569
by czigor: Do not invoke hook_commerce_cart_order_refresh() after payment
parent
a551221b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
commerce_datatrans.pages.inc
+17
-0
17 additions, 0 deletions
commerce_datatrans.pages.inc
with
17 additions
and
0 deletions
commerce_datatrans.pages.inc
+
17
−
0
View file @
3fa47446
...
...
@@ -13,6 +13,23 @@
* @param $payment_key URL key used to validate request.
*/
function
commerce_datatrans_payment_processing
(
$order_id
,
$payment_method_id
,
$payment_key
,
$error_redirect_url
=
''
)
{
// We are right after (a successful or failed) credit card payment. However,
// since datatrans payment is not a proper checkout form submission, the
// order is still in checkout_review status and not in checkout_payment.
// Since checkout_review is a cart status, hook_commerce_cart_order_refresh()
// gets invoked when loading the order below. This is definitely not the
// intended behavior and breaks giftcard coupons by trying to apply them
// again. So let's trick commerce into thinking that we already have invoked
// hook_commerce_cart_order_refresh().
// @see commerce_cart_commerce_order_load()
// @see commerce_gc_commerce_coupon_final_checkout_validate()
$refreshed
=
&
drupal_static
(
'commerce_cart_commerce_order_load'
,
array
());
// If for whatever reason the refreshed value is explicitly set to FALSE,
// let's keep it that way.
if
(
!
isset
(
$refreshed
[
$order_id
]))
{
$refreshed
[
$order_id
]
=
TRUE
;
}
$order
=
commerce_order_load
(
$order_id
);
$datatrans
=
$_POST
;
...
...
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