Stripe Checkout我创建了post / v1 / token但没有post / v1 / paymentintent

问题描述

我正在使用角度9和条纹签出。我拼命尝试在条带上创建测试付款,但是我只能将令牌发送到平台。我应该添加什么?

  this.handler = StripeCheckout.configure({
    key: 'pk_test_xxxxxxxxxxxxxxxxxxx',locale: 'auto',image:'./assets/images/favicon.png',description: 'Boutique créative',currency :'eur',amount:this.amount * 100,token: token => { 
       this.onSave(token.id,token.card.last4,token.client_ip); }});

  this.handler.open({
    name: 'xxxxxx',email: this.userTodisplay.email,amount: this.amount * 100,});

解决方法

您使用的是所谓的旧版Checkout,它只会创建令牌。

您应该集成新的Checkout:https://stripe.com/docs/payments/accept-a-payment?integration=checkout

请记住,所有Stripe集成都需要网页和服务器端代码。您在服务器上创建一个CheckoutSession,然后从您的网页重定向。