小编c a*_*ews的帖子

条纹:parameter_invalid_integer,PHP 新手

我正在调试我的代码。我在 PHP 方面不是天才,如果它不是整数,需要一些帮助来破译我声明为参数的内容......

任何人都可以帮忙吗?

{

  "error": {

    "code": "parameter_invalid_integer",

    "doc_url": "https://stripe.com/docs/error-codes/parameter-invalid-integer",

    "message": "Invalid integer: 1.13",

    "param": "amount",

    "type": "invalid_request_error"

  }
Run Code Online (Sandbox Code Playgroud)

$app->post('/createCharges', function() use ($app) { $response = array();

    $json = $app->request->getBody();
    $data = array(json_decode($json,true));

    $amount = $data[0]['amount'];
    $source = $data[0]['source'];
    $appointmentid = $data[0]['appointmentid'];


    \Stripe\Stripe::setVerifySslCerts(false);
    \Stripe\Stripe::setApiKey(STRIPE_API_KEY);

    $charge = \Stripe\Charge::create(array(
        "amount" => $amount,
        "currency" => "usd",
        "source" => $source,
        "description" => "test order from ios"
    ));
Run Code Online (Sandbox Code Playgroud)

php debugging integer stripe-payments

3
推荐指数
1
解决办法
2964
查看次数

标签 统计

debugging ×1

integer ×1

php ×1

stripe-payments ×1