Reputation: 19
I'm trying to edit the Paypal tax computation on my website. Right now, it's charging $5 on every order. I want to change it to 3% instead. So that 3% of the amount deposit will be charged on total. But I'm having trouble doing the code. Can someone please help me?
global $apiContext,$app_url;
$payer = new PayPal\Api\Payer();
$payer->setPaymentMethod("paypal");
if(isset($_POST['random_amt'])){
$price = $_POST['random_amt'] + 5;
}elseif(isset($_POST['sub_services'])){
$price = get_service_price($_POST['sub_services']);
}else{
$price = get_service_price($_POST['service_box']);
}
if($_FILES){
$pics = count($_FILES['image']['name']);
$price = $price*$pics;
Upvotes: 0
Views: 69
Reputation: 784
Change
$price = $_POST['random_amt'] + 5;
to
$int = $_POST['random_amt'] * .03;
$price = $_POST['random_amt'] + $int;
Upvotes: 1