How to update a field value from customer module to a custom field in customer payment

How to update a field value from customer module to a custom field in customer payment

Requirement

1. when a new customer was created in books. we will add the sales person name in the customer's custom field.
2. when the customer make the payment, we will use the sales person for the customer to pay the commission and update the commission amount in customer payment's custom field for generating report on it.

need to achieve the above in books using any flow or function.

can someone help how to write a function to get value from another module, here when is write a function for customer payment, how to get value from customer module?