I'll guide you with your vendor transaction, Unclek.
Since you've wired the money, you also want to record it in QuickBooks. Simply write a check for Company A against your business account. When they refund it, you can record a deposit to your business account.
Please be sure to use the same category in your check and deposit transactions, so the cost will only offset. Sample below.
On the other hand, you can create a separate payment record for Company B if you also wired money for them.
If you have more questions about the transactions or the recording process, please let me know. If you want to see more references for QuickBooks Desktop, just press the F1 key on your keyboard to launch the Help window.