Thank you for your response! However, I don't think it answers my question. I know how to create the invoice with the fee, what I'd like to know is if the processing fee, that I'm going to be charged, is going to apply to the total invoice amount of $5,145? So now the fee will be $149.21 ($5,145 x 2.9%), instead of the original $145 ($5,000 x 2.9%). If so, I wouldn't receive the full $5,000, I'd only receive $4,995.79. I know it's a small difference but in time it adds up.
The calculation is A / (100 - fee) * 100, where A is the amount you want to receive
So 5000 / 97.1 * 100