php - Stripe curl 命令行 POST

标签 php curl stripe-payments payment

我正在尝试使用 stripe curl 向测试客户收取 10 美元,但它返回金额不正确的错误。

    curl https://api.stripe.com/v1/charges      \

   -u sk_test_qtxx1EuLIMqMwOmEw3NKxxxx:     \

   -d amount=10.00                          \

   -d currency=usd                          \

   -d card[number]=4242424242424242         \

   -d card[exp_month]=12                    \

   -d card[exp_year]=2019                   \

   -d card[cvc]=123

返回的错误是:

{
  "error": {
    "type": "invalid_request_error",
    "message": "Invalid integer: 10.00",
    "param": "amount"
  }
}

我试了 10 个,它说:“金额必须至少为 50 美分”。

我想知道我是否遗漏了任何后置变量,例如某种 token 或 key 。

最佳答案

根据 the documentation , amount参数需要为

A positive integer in the smallest currency unit

所以十 block 钱,你需要通过1000

关于php - Stripe curl 命令行 POST,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38226644/

相关文章:

php - 通过电子邮件通知用户有新评论

php - PHP 中的访问者模式

php - 如何使用 PHP 重新映射数组键(基于值)?

javascript - strip 验证失败时提交按钮不会重新启用

javascript - Stripe 3dSecure createSource 在重定向网址中设置自定义参数

javascript - 如何在不弹出的情况下将 strip 与 react-native expo sdk36 集成?

php - 有没有办法从 Laravel 5 的包中排除 CSRF 保护的路由?

php - curl_close() : is not a valid cURL handle resource . .. 但为什么呢?

asp.net-core - PayPal交易搜索API : PERMISSION_DENIED,所请求的操作无权限

PHP cURL : Get target of redirect, 没有遵循它