I have tested this with braintree and my own commerce_promisepay.

1) checkout a product so that there is a reusable payment method
2) on the next checkout select the reusable CC (ajax hides the billing profile form), submit the form with shipping info
3) Rather than continuing to review, the order info page reloads with validation errors for the billing profile.

Comments

ransomweaver created an issue. See original summary.

ransomweaver’s picture

I tried to track this down; here is some more info.

When you submit the PaymentInformation form with an existing payment method, validation happens for the Shipping profile in
commerceguys/addressing/src/Validator/Constraints/AddressFormatConstraintValidator::validateFields, which is ok.

However the payment information part is processed by Drupal\Core\Form\FormValidator->doValidateForm, and its called by CheckoutConroller->formPage. StackTrace:

→'21: Drupal\Core\Form\FormValidator->doValidateForm()' => array(2)
→'20: Drupal\Core\Form\FormValidator->validateForm()' => array(2)
→'19: Drupal\Core\Form\FormBuilder->processForm()' => array(2)
→'18: Drupal\Core\Form\FormBuilder->buildForm()' => array(2)
→'17: Drupal\commerce_checkout\Controller\CheckoutController->formPage()' => array(2)

CheckoutController->formPage() is called four times:
1) page load
2) ajax change to existing payment method
3) ajax shipping recalculate
4) the reload after validation failure, so maybe this is just #1 again.

I can't see any difference in what is passed to the form builder each time, and I don't have a clue where in buildForm or processForm its going wrong.

bojanz’s picture

Status: Active » Closed (duplicate)