About a week ago the commerce_dibs-module suddenly stop working for a webshop I am part of building. After completing payment you are sent back to checkout_review, money authorized at dibs, but an order is NOT created. I tracked down the problem to what seems to be an assumption that "transaction_callback" is always run before "transaction_accept" in dibs-api.

When the transaction is first created in function commerce_dibs_redirect_form it's status is set to COMMERCE_PAYMENT_STATUS_PENDING.

In transaction_accept we have:

if ($commerce_transaction->status !== COMMERCE_CREDIT_AUTH_ONLY) {
  drupal_set_message(t('Unable to verify your payment, please try again.'), 'error'); 
  drupal_goto('checkout/' . $order->order_id . '/payment/back/' . $transaction['params']['payment_redirect_key']); 
}

Which causes the redirect to the review step.

The only place where I could find $commerce_transaction->status is set to COMMERCE_CREDIT_AUTH_ONLY is in transaction_callback:

foreach ($commerce_transactions as $commerce_transaction) {
  $delta = $commerce_transaction->payload['delta']; 
  $commerce_transaction->message = 'Payment completed at DIBS'; 
  $commerce_transaction->status = COMMERCE_CREDIT_AUTH_ONLY; 
  $commerce_transaction->payload['dibs_id'] = $transaction['dibs_split_payments'][$delta]; 
  commerce_payment_transaction_save($commerce_transaction); 
}

so it obviously needs to be run BEFORE transaction_accept, but I logged the order using watchdog and it does not!

What puzzles me is that every drupal-site using the dibs-module should have this problem, and if so why is there not more issues reported?

Comments

gnucifer’s picture

Issue summary: View changes

grammar

gnucifer’s picture

Issue summary: View changes

clarification

gnucifer’s picture

Issue summary: View changes

more clarification

gnucifer’s picture

Issue summary: View changes

more clarification

gnucifer’s picture

Version: 7.x-2.x-dev » 7.x-1.x-dev

Perhaps better to put this in 7.x-1.x-dev, problem applies to both branches.

gnucifer’s picture

One possible explanation could be that this issue will only surface when using the new version of the payment window. In that case it is specific to my patched version of the module. The strange thing is that it worked fine (also with new payment window) until quite recently.

marcofernandes’s picture

Hi.
Any development on this issue? It's happening on 7.x-1.0 using FlexWin.

Edit: Have debugged and after confirming the credit card info on FlexWin, it only calls transaction_accept callback.

Edit2: Oops.. sorry, local development. DIBS can't find my local URL for callback. Need to test on stage.

marcofernandes’s picture

Issue summary: View changes

grammar

erback123’s picture

I can confirm the exact same problem. The API module has been running smooth for 6 months and suddenly it just stops working. I am using versuib 7.x.2.0, shouldn't this be fixed by now, I can see that it has been 2 years since last update?

Update: I have talked to DIBS customer support and it seems like they are receiving a 403 , forbidden response when calling "transaction_callback" from their side and that it is why the callback is never fired in Drupal. "transaction_accept" on the other hand is a different callback which should come before "transaction_callback" if everything is in order. Thinking it could be permission issues, but currently I have no idea how to proceed. Any thoughts what it could be?

szeidler’s picture

Same issue here. Have you found a way to solve it?

#edit: Strange, it worked after a couple of failed times testing it on the staging server (of course, it's a must that your drupal installation is accessible from the outside, to let DIBS make their callbacks.