I have a phone number mandatory for guest and registered purchases however when a customer pays with their PayPal account the delivery details seem to be overwritten by the PayPal details when the order is placed. (and the number the customer entered in checkout is ignored, replaced with blank data)
This is from PayPal API docs:
PayPal returns a contact phone number only if your Merchant Account Profile settings require that the buyer enter one.
As I use the PayPal account for other things I don’t want to make that mandatory in PayPal if I can avoid it.
What I want to do is just before the order (or invoice?) is generated in Magento I want to see if a phone number is passed from PayPal, and if that data is blank I want to use the logging in customer phone, or the guest checkout session array data for the phone number instead.
I know how to do the PHP logic, and can probably work out how to grab the customer or checkout guest data, my problem is I have no idea where to start looking for the code that makes that final save.
Can anyone point me to the right file(s) to start with?