When paying with a saved card, many (though not all) orders are getting stuck in the checkout stage. The transaction is successful (and logged to the order as such), but the order status is never updated and a confirmation email never sent. It's not all orders, but I haven't been able to find an obvious difference between the good ones and the ones causing problems.

Files: 
CommentFileSizeAuthor
#5 1415670-prevent_payment_callback_when_form_errors_present.patch832 bytesandyg5000
PASSED: [[SimpleTest]]: [MySQL] 3,589 pass(es).
[ View ]

Comments

Are you sure the transaction is successful? Could it be reporting a false positive inside of Drupal Commerce?

Thanks for getting back on this. The transaction is successful and the card is charged. I believe the problem is that I have a one page checkout (no review) and clicking submit even if there are required fields missing or other form errors will still attempt a transaction. The form errors are reported to the user, but the transaction still goes through and the order balance is zeroed. Since the order balance is zero, subsequent transactions don't go through and the user can't complete checkout.

Sounds like that'd do it. The module doesn't do anything atm to accommodate such a scenario

Would it break anything to add something like:

<?php
if ($err = form_get_errors()) {
    return
FALSE;
  }
?>

Project:Commerce Authorize.Net» Drupal Commerce
Component:Code» Payment
StatusFileSize
new832 bytes
PASSED: [[SimpleTest]]: [MySQL] 3,589 pass(es).
[ View ]

Form errors on other elements (ie: billing information) do not prevent payment submission when payment form is on the same pane.

Status:Active» Reviewed & tested by the community

This looks great to me.

Status:Reviewed & tested by the community» Fixed

Yep, great patch. I added in a warning message so the customer knows that their payment will not be processed until all errors on the page have been addressed.

Commit: http://drupalcode.org/project/commerce.git/commitdiff/044ce3d

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.