React native Tipsi条带从令牌创建源

React native Tipsi条带从令牌创建源,react-native,stripe-payments,React Native,Stripe Payments,我试图使用tipsi条带创建一个源,我将发送到我的服务器。我用下面的代码获得了令牌,但是从令牌创建了一个源代码 抛出错误 try { this.setState({ loading: true, token: null }) const token = await stripe.paymentRequestWithCardForm({ // Only iOS support this options smsAutofillDi

我试图使用tipsi条带创建一个源,我将发送到我的服务器。我用下面的代码获得了令牌,但是从令牌创建了一个源代码 抛出错误

 try {
      this.setState({ loading: true, token: null })
        const token = await stripe.paymentRequestWithCardForm({
          // Only iOS support this options
          smsAutofillDisabled: true,
          requiredBillingAddressFields: 'full',
          prefilledInformation: {
            billingAddress: billingAddress,
          },
        })
        this.setState({ 'token': token })

     var strToken=this.state.token;
     console.log(strToken);
     const params = {
       type:'card',
      token:strToken
    }

    const source = await stripe.createSourceWithParams(params)
错误如下

[Error: The payment method `card` requires the parameter: card[number].]

我做错了什么?

您很可能传递了一个
令牌
对象,而
对象是预期的对象。从令牌中,您可以获得并将其作为
卡传递到
参数中的
卡,我也已经尝试过了。发送card对象或仅发送card id,两者都会生成相同的错误。@RehanFazal您发现了吗?我得到了完全相同的问题。您可能传递了一个
令牌
对象,其中需要一个
对象。从令牌中,您可以获得并将其作为
卡传递到
参数中的
卡,我也已经尝试过了。发送card对象或仅发送card id,两者都会生成相同的错误。@RehanFazal您发现了吗?我得到了完全相同的问题。