如何在php代码中设置条带数量

如何在php代码中设置条带数量,php,Php,我正在编写php代码来使用stripe向信用卡收费 下面是一个示例代码: <? require_once('lib/Stripe.php'); Stripe::setApiKey("sk_test_your_key_here"); if(isset($_POST)) { $payment = Stripe_Charge::create(array( 'amount' => '100', 'currency' => 'usd', 'card'

我正在编写php代码来使用stripe向信用卡收费

下面是一个示例代码:

<?
require_once('lib/Stripe.php');

Stripe::setApiKey("sk_test_your_key_here");
if(isset($_POST)) {
$payment = Stripe_Charge::create(array(
'amount'        => '100',

'currency'      => 'usd',

'card'          => array(
'number'=> '4242424242424242',,
'exp_month' => '12',//,
'exp_year'=> '14',//,
'cvc'=> ''),//$_POST['cvc']),
'description'   => 'Test payment'
)); }

print_r($payment);
?>
条带API声明只接受美分的金额

10.99
是浮点值,而不是整数。要获得金额,请将美元数字乘以100,将其转换为美分


10.99*100=1099=amount

我想很清楚,
10.99
是整数吗?不,不是的,你只需要使用美分。谢谢你的回答,对不起,我不是英国人,我不知道“整数”是什么意思。我已经阅读了文档,我知道正确的数字是1099,只是我必须删除整数表示整数<代码>1,2,3,…10,11都是整数。但是小数点后的数字,如:
10.99
被称为浮动。如果我的订单金额为10.995美元,我该如何将其发送到stripe?谢谢brendan,对不起,我以前没有读过该文档,我曾经与2co和其他商家使用该点,现在我知道我必须删除该点,10.99=1099解决并节省了我的时间。非常感谢。有什么合理的解释来解释为什么!
'Stripe_InvalidRequestError' with message 'Invalid integer: 10.99' in