Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/403.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript angular payments返回带有测试数据的无效卡_Javascript_Angularjs_Node.js_Stripe Payments - Fatal编程技术网

Javascript angular payments返回带有测试数据的无效卡

Javascript angular payments返回带有测试数据的无效卡,javascript,angularjs,node.js,stripe-payments,Javascript,Angularjs,Node.js,Stripe Payments,我正在尝试使用angular payments应用程序在angular js中创建条带 问题是,它似乎返回了无效的_卡错误,即使测试数据也是如此 以下是错误: POST https://api.stripe.com/v1/tokens 402 (Payment Required) Stripe.isDoubleLoaded.c(index):3 Stripe.isDoubleLoaded.e(index):3 Stripe.isDoubleLoaded.a(index):3 Stripe.is

我正在尝试使用angular payments应用程序在angular js中创建条带

问题是,它似乎返回了无效的_卡错误,即使测试数据也是如此

以下是错误:

POST https://api.stripe.com/v1/tokens 402 (Payment Required)
Stripe.isDoubleLoaded.c(index):3 Stripe.isDoubleLoaded.e(index):3 Stripe.isDoubleLoaded.a(index):3 Stripe.isDoubleLoaded.Stripe.xhr(index):2 Stripe.a._rawRequest(index):2 Stripe.a.request(index):2 Stripe.token.a.create(index):2 Stripe.card.b.createToken(index):2 Stripe.a._channelListener(index):2 Stripe.isDoubleLoaded.H.Socket.t.concat.incoming(index):2
我正在设置我的可发布密钥,包括Stripe.js,没有问题,我知道调用已经完成,因为我在响应处理程序中发现了错误

有没有想过是什么原因造成的

代码如下:

形式

我的index.html标题包括

<script type="text/javascript" src="https://js.stripe.com/v2/"></script>

 <script type="text/javascript">
  // This identifies your website in the createToken call below
  Stripe.setPublishableKey('my-key-here');
  // ...
</script>

//这将在下面的createToken调用中标识您的网站
Stripe.setPublishableKey('my-key-here');
// ...

wierd的问题是,它正在与stripe angluar合作,这是另一个处理stripe的回购协议-知道我做错了什么吗?

您可能创建的令牌不正确。我也有同样的问题。对我有效的是将卡片设置为这样:

Stripe.card.createToken({
“编号”:“4242”,
“经验月”:12,
“经验年”:2016年,
“cvc”:“123”
},功能(状态、响应){
stripeResponseHandler(状态、响应);
});
// function to process the form
$scope.saveCustomer = function(status, response) {

        if (response.error) {
            // Show the errors on the form
           console.log(response);
           console.log(response.error);
          } else {
            // response contains id and card, which contains additional card details
            var token = response.id;
            console.log(token);
            formData.token = token;   
          }
    }
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>

 <script type="text/javascript">
  // This identifies your website in the createToken call below
  Stripe.setPublishableKey('my-key-here');
  // ...
</script>