Integrating CoinGate Payment Gateway in PHP Project: Including Payment Fees in Total Amount

19 Views Asked by At

I'm integrating CoinGate into my PHP project for payment processing. Currently, the payment fee is deducted from the paid amount, but I want to adjust the setup so that the payment fee is included in the total amount that the customer pays. How can I achieve this configuration within my PHP project using CoinGate? Any guidance, code examples, or relevant documentation would be highly appreciated. Thank you.

$amount = $_GET['amount']; $feePercentage = 0.01; // 1% $fee = $amount * $feePercentage; $totalAmount = $amount + $fee;

I implemented the above code snippet in my PHP project to calculate the total amount including a 1% fee. However, upon testing the setup, I found that the fee is also being charged for the 1% of the fee itself, resulting in an incorrect total amount.

0

There are 0 best solutions below