<?php function fee($amount) { $ourFeePct = .05; // %5 $stripeFeePct = .029; // 2.9% $stripeFeeFixed = 30; //30 cents $ourFee = (int) $amount * $ourFeePct; //5 cents on the dollar. $total = (int) ($amount + $ourFee + $stripeFeeFixed) /(1 - $stripeFeePct); $stripe = ($total - $amount) - $ourFee;//stripes cut return [$ourFee,$total,$stripe]; } $amt = 5000; // $50 in cents. list($fee,$total,$stripe) = fee($amt); printf('amount to be paid to user B %d'.PHP_EOL,$amt); printf('amount to be charged to user A %d'.PHP_EOL,$total); printf('our cut %d'.PHP_EOL,$fee); printf('stripes cut %d'.PHP_EOL,$stripe);
You have javascript disabled. You will not be able to edit any code.
Value for `_results` contains invalid data `array`