I'm sure I'm missing something simple, but not sure what it is.
This error is applicable both for a custom checkout pane, and a custom payment type. All of these panes are on one checkout "page."
When I go through checkout and leave a required field empty on the billing address, it stops checkout and reports the error, reloading the checkout page. But a payment transaction is entered, and the submit handler for my custom pane is executed and a record is put in the database. So when they submit the checkout again, correcting the error, everything is duplicated.
Strange, since I pretty much copied the example module verbatim when setting this up, and ditto for the checkout pane. If it is a bug, and I'm not missing something obvious, its pretty serious.
Any insight is appreciated. Thanks!
Comments
Comment #1
rszrama commentedWe'll need to think this through some more, but the gist of it is we validate and submit checkout panes individually each step of the way so we don't lose data from the page if one pane includes invalid data. Naturally, this sucks for the payment pane, so maybe we need to update the payment pane to check for errors in the $form_state before processing payment. I can't remember the other issues that discuss our checkout form validation process, but I know there are some in here.
Comment #2
jpontani commentedI believe this is related to #1380310: Optionally require all panes on a checkout page to validate before processing them, except the redirect portion.
Comment #3
hctomHi @all,
this is a big problem on our site We have a required checkbox for confirming the terms and conditions on the review page. So right now when choosing PayPal as payment method, the following scenario takes place:
1. You are able to submit your order without accepting the terms and conditions (as the form validation does not prevent the form from submitting)
2. You get redirected to PayPal
3. You pay your order
4. You continue to get back to the store
... and now the worst thing ever happens:
Because of the form error you are stuck in an infinite loop and always get redirected to PayPal again... but your order is never saved, because the last checkout step is never reached. This means: Your customer pays for an order, but you will never see this order in your store!!!
EDIT: The checkbox field is added to the review page via Commerce Fieldgroup Panes module.
So am I doing something wrong or is this really a huge bug in the checkout system?
Thanx in advance & cheers
hctom
Comment #4
hctomA quick follow up:
I found out that the Commerce Fieldgroup Panes module does not implement a 'checkout_form_validate' callback. So altering the pane info and adding a custom callback can help solving this issue... Callback example:
Comment #5
rszrama commentedIt's probably best for you to post that as an issue in that module's queue if that's the solution.
Comment #6
rszrama commentedMarking this a duplicate of the issue linked earlier, with a link to my most recent comment #1380310-16: Optionally require all panes on a checkout page to validate before processing them. Note that the issue I link there did go ahead and prevent the payment pane from attempting payment if there are errors somewhere on the page, but it depends on the payment pane being the last on the checkout page.