Hi,
i discover that the hook: hook_commerce_checkout_complete is invoked twice in some cases when i use commerce_sermepa. I attach an screenshoot and what i discovered.
Not sure if it is a general problem or not, but for me it is. In that hook is where we do some custom logic and stock decrease. It seems that sermepa/callback hook menu that is called asyncroniusly by TPV is firing it.
In the callback it is calling: commerce_sermepa_process_transaction and at the end of this function there is this code:
if ($redirect) {
if ($transaction_status['code'] == COMMERCE_PAYMENT_STATUS_FAILURE) {
commerce_payment_redirect_pane_previous_page($order);
}
else {
commerce_payment_redirect_pane_next_page($order);
}
}
Not sure but i think that this callback must pass: FALSE to $redirect in:
function commerce_sermepa_process_transaction($order, $payment_method, $feedback_parameters, $redirect = TRUE) {
to avoid redirection. I think that depending of the order of the calls beetween this callback and the normal redirect of the TPV this function is calling this commerce_payment_redirect_pane_next_page that at the end calls hook_commerce_checkout_complete.
is this normal?
Best
David
Closed: outdated
1.4
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.