It can be implemented through directories, but it will be necessary to duplicate the payment methods in the directory, in the BP it will be possible to configure the connection in such a way that when you select a legal entity, you will see only the payment methods that are added for legal entities. faces.
I don't think that you will have legal entities and payment methods added every day, so this option should work.
I write here only URL prefixes to links, so as not to publish links.
For this you need:
1) Here /admin/shop/custom/object/
Create 2 directories:
- reference book of legal persons /admin/shop/custom/object/12/
We add 1 field to it
- directory of communication of legal entities and payment methods /admin/shop/custom/object/11/
Add 2 fields to it (payment method and legal entity) /admin/shop/custom/object/11/field/
+ link the field "legal entity" with the directory of legal entities
https://prnt.sc/ud89q32) Create additional fields and link them to the directory
/admin/shop/orderfield/150/ - we associate this with the first directory
https://prnt.sc/ud8b3f/admin/shop/orderfield/149/ - and this field is associated with directory 2 (where payment methods are)
https://prnt.sc/ud87qq3) Fill in the reference book with values
Here is the legal entity
https://prnt.sc/ud8de8Here are the payment methods
https://prnt.sc/ud8dw74) Next, display these fields in the business process interface
https://prnt.sc/ud8cqtAs a result, we get
https://prnt.sc/ud8e68Here is an example process /admin/customorder/issue/2828203/edit/
5) But we get values in additional fields, and these are not standard fields, so we need to copy the data into the fields:
- hide the standard fields Payment Method and Legal. face
- at the stage of the business process or better at the procedure
https://prnt.sc/ud8fl5 add actions
https://prnt.sc/ud8krq https://prnt.sc/ud8kxaBut there is a caveat - a legal entity can only be filled in using its id, so we return to the 1st directory and add the
https://prnt.sc/ud8il3 field to it, which also needs to be filled in the directory, here is its ID https:/ /prnt.sc/ud8jjp write to the directory
https://prnt.sc/ud8js6Create an additional field
https://prnt.sc/ud8kgnAdd action
https://prnt.sc/ud8lol to our procedure + make changes
https://prnt.sc/ud8m4rDONE
https://prnt.sc/ud8nd0It remains only to fill out reference books and connect them for the necessary business processes