Hello:

We have the CECA module installed in an commerce site, with the following settings:

-Payment method: online.
-Show credit card form in Drupal site: no.

Our client has been complaining for months about orders where the customer paid successfully, and yet the order was never generated. Today we managed to do a test, and we discovered that, despite paying successfully, the order never gets generated until we click the "OK" in CECA's website to return to our website.

This, of course, is NOT the correct behaviour when the "Payment method" is set to "Online".

Looking at the source code, I see that the constants COMMERCE_CECA_OFFLINE and COMMERCE_CECA_ONLINE are only used to display the settings form; later, the COMMERCE_CECA_OFFLINE constant is used in the function "commerce_ceca_redirect_form_submit", but this function doesn't get called from anywhere else in the code. Is this normal?

CommentFileSizeAuthor
#2 bug2.png109.32 KBPaulJBis
#2 bug1.png61.01 KBPaulJBis
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

PaulJBis created an issue. See original summary.

PaulJBis’s picture

FileSize
61.01 KB
109.32 KB

Here are 2 screenshots of our setup. As you can see, we have everything set up to use the "online" payment method... and yet, if the user doesn't click the "OK" button in CECA to go back to our website, the order gets stuck in the "Shopping carts" list, with the order status as "Checkout: pago", as seen in the screenshot.

When the user clicks the "OK" button and goes back to our website, to the "/checkout/[order number]/complete" URL, the order gets generated and gets listed in the "Orders" section.

PaulJBis’s picture

Another piece of info:

I debugged the CECA module, specifically the lines in commerce_ceca_callback() that receive the callback and supposedly save the order if the information is correct (lines 496-497):

    commerce_order_save($order);
    commerce_ceca_generate_payment($order, $payment_method, $_POST['Referencia']);

I captured the return status of the "commerce_ceca_order" call, and it turned out to be "2" (which I think means SAVED_UPDATED). Then, in the "commerce_ceca_generate_payment" function, I captured the return status of this call (line 323):

commerce_payment_transaction_save($transaction);

And it turns out to be "1" (which I think means "SAVED_NEW").

So it seems to be saving the order correctly... and yet it doesn't do so.