I created a custom credit card payment method and I want to trigger the validation of billing address fields when "Place order" button is clicked.
3 Answers
You need to do the following things.
Insert validation classes into each fields of form.
Insert the validation bind on the form tag.
After spending a lot of time digging Magento 2's core code, I found a way to trigger the billing address form fields validation programatically.
let billingAddressComponent = require('uiRegistry').get('checkout.steps.billing-step.payment.payments-list.'+this.getCode()+'-form');
billingAddressComponent.updateAddress();
Perfect answer(last one). But, provided component doesn`t work for me. So I find the proper component (with billing address) with
require('uiRegistry').get(function(component){console.log(component.name)});