Yeah check which terminals in / out they are. i had a transfer AMM - CAI on Royal Jordanian and then CAI - CDG on Air France. Two different terminals - had to get another visa b/c i left the terminal (eg, security) and had to therefore go through immigration to exit the terminal and immigration to enter the next terminal.
You can actually prepay and go ahead and get two visas if you want - they'll just only stamp one the first time in and out and then the second one the next time. Well, this was about four years ago; so times may have changed. But either way you can pay in USD so keep those handy for payment.