这是我的代码
从最后一页获取价格
$Voucher_value=mysqli_real_escape_string($con,$_POST['Voucher_value']);
$charge = \Stripe\Charge::create(array(
'customer' => $customer->id,
'amount' => $Voucher_value,
'currency' => 'usd',
'receipt_email' => $email
));
$chargeAmount=$charge['amount'];
$Custcurrency=$charge['currency'];
答案 0 :(得分:2)
如果您总是处理美元或其他带有2个小数点的货币,您可以简单地乘以100并将结果截断为整数:
$amount = intval($Voucher_value * 100);