Paypal Tax Computation

空扰寡人 提交于 2020-01-25 07:09:47

问题


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;

回答1:


Change

$price = $_POST['random_amt'] + 5;

to

$int = $_POST['random_amt'] * .03;
$price = $_POST['random_amt'] + $int;



来源:https://stackoverflow.com/questions/58960810/paypal-tax-computation

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!