我正在做出反应中的条形承诺,他们的医生说要像这样在组件的外部加载这个承诺:
import {Elements} from '@stripe/react-stripe-js';
import {loadStripe} from '@stripe/stripe-js';
// Make sure to call `loadStripe` outside of a component’s render to avoid
// recreating the `Stripe` object on every render.
const stripePromise = l
我遵循基本的react文档:
下面是我的有问题的代码:
index.js
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import {Elements} from '@stripe/react-stripe-js';
import {loadStripe} from '@stripe/stripe-js';
// Make sure to call `loadStripe` outsid
我正在尝试显示我的条带组件,但是我得到了以下错误:
IntegrationError:只能创建一个cardNumber类型的元素。
我不知道为什么,因为我只在我的整个应用程序中使用过一次
有什么想法吗?
这是我的索引
import ReactDOM from 'react-dom';
import App from './App';
import * as serviceWorker from './serviceWorker';
import { loadStripe } from "@stripe/stripe-js";
在这里尝试遵循步骤2,在一个React应用程序中:
// Initialize Stripe.js with the same connected account ID used when creating
// the Checkout Session.
const stripe = Stripe('pk_test_s3JwCARtUtLnQGm4xlDx70Wt002kwkyJ8P', {
stripeAccount: '{{CONNECTED_STRIPE_ACCOUNT_ID}}'
});
我已经运行了npm install @stripe/stri
我太沮丧了。从字面上讲,我是直接从条纹文档中实现的,但我一直收到错误 Error: Invalid prop 'stripe' supplied to 'Elements'. We recommend using the 'loadStripe' utility from '@stripe/stripe-js' ..。但我是!这个脚本有什么问题?我找遍了所有地方,也找不到任何原因来解释为什么会出现这个错误。 import React from "react"
import PropTypes from "
我有一个错误,我在react中的条纹结账时遇到了一个错误...我有一个按钮,当它被点击时,它应该重定向到条纹结帐页面。但是,我得到了这个错误
Uncaught (in promise) IntegrationError: Invalid stripe.redirectToCheckout parameter: price is not an accepted parameter.
当我运行这段代码时就会发生这种情况--这是我的整个checkout.js页面
import { loadStripe } from '@stripe/stripe-js';
import fireb
对于不同的国家,我有不同的条纹帐户,因此在下拉选择中,我想根据国家间的选择(如图所示)更改条带签出/元素格式。
// public_key is coming from backend API according to countries dropdown selection
stripePromise = loadStripe(public_key)
因此,当我将stripePromise传递给条带元素时,根据我从下拉列表中的第一个选择,它只加载一次。
假设我从下拉列表中选择了United never ,它显示的是英国的结帐表单,如果我将国家从 Uk 更改为United States tha
我在我的NextJs项目中使用了Stripe,并试图在我的应用程序中获得客户列表,但没有成功。如果有人知道怎么弄,请教我怎么做。
这是我的代码:
import { loadStripe } from "@stripe/stripe-js";
async function getStripeCustomers(){
const stripe = await loadStripe(
process.env.key
);
if (stripe) {
// there was a toturail for node.js like this.
c
我有多个国家的条形码帐户,我想把条形负载承诺称为对不同API公钥的国家的变化。
因此,如果我从下拉列表中选择UK,那么条纹元素应该是UK,如果我将其更改为US,则条带元素应该用于US。但就我而言,当我呼吁英国国家( UK country ),而不是它起作用的时候,如果我用UK来称呼US,那么它永远不会更新US的条形元素。在网络控制台中,它总是显示英国元素,甚至我也选择了美国国家。
我的公钥是根据国家级别的变化加载的,而加载条的承诺也是根据coutnry明码变化的公钥生成的,但是条形码元素的iframe是不会改变的。
if(nextProps.payment_methods){
我试图集成条带API密钥,但我无法在新的react路由器-dom版本中找到解决方案。
这是完整的错误
以上错误发生在组件中:
at Routes (http://localhost:3000/static/js/bundle.js:81119:5)
at Router (http://localhost:3000/static/js/bundle.js:81052:15)
at BrowserRouter (http://localhost:3000/static/js/bundle.js:79861:5)
at App (http://localhost:3000/main.79cc3231
更新:不确定发生了什么,但现在起作用了!(没有改变任何事情)
我正在使用,我试图用Stripe的<CardElement />创建一种支付方法,但是我得到了一个错误,上面写着:"Invalid value for createPaymentMethod: card should be object or element. You specified: null."
SelectPlan.js (哪里有错误):
import React, { useState, useEffect } from "react";
import { Button }
我在我的网站上集成条带支付,但卡元素没有渲染这里是一个代码
Checkout and Elements组件
import React, { useState } from 'react';
import { loadStripe } from '@stripe/stripe-js/pure';
import { Elements, CardElement, ElementsConsumer,useStripe, useElements } from '@stripe/react-stripe-js';
let stripePromise = l
我正试图从stripe中使用nextJs库创建一种支付方法,如下所示:
import React, { FunctionComponent } from 'react';
import type { DisplaySettingsProps } from '@company/frontoffice/types';
import { Row, Col, Input } from '@company/ui';
import { useIntl } from '@company/frontoffice/providers';
im
您好,我是新手在React中使用条纹和条纹元素。我使用的是react-stripe-js和stripe-js包,如中所述。我有两个组件,一个叫做StripeWrapper:
import React from 'react';
// stripe
import { loadStripe } from '@stripe/stripe-js';
import { Elements } from '@stripe/react-stripe-js';
// components
import CheckoutForm from './Chec
我使用的是Meteor框架和React。 添加了@stripe包。付款表单正常工作,但它在日志中不断显示以下内容: UnhandledPromiseRejectionWarning: TypeError: document.querySelectorAll is not a function
at findScript (/project/node_modules/@stripe/stripe-js/dist/stripe.js:9:26)
at /project/node_modules/@stripe/stripe-js/dist/stripe.js:75:20
at new Promi
所以这是我第一次使用条纹,我想要做的事情是这样的。我已经为它创建了一个用于测试的后端。但是我遇到了一个问题,当我点击pay按钮时,我在控制台Uncaught (in promise) IntegrationError: You must provide a Stripe Element or a valid token type to create a Token.中得到了这个错误。是什么导致了这个错误? Server.js require("dotenv").config({ path: "./config.env" });
const express =
我正在使用这个条带扩展,并且我试图传递给我错误firebase__WEBPACK_IMPORTED_MODULE_3___default.a.auth.onAuthStateChanged is not a function的uid,但我以前从未见过这个错误。请看下面的代码 import {loadStripe} from '@stripe/stripe-js';
import firebase from 'firebase';
const firestore = firebase.firestore();
firebase.auth().onAuthS
我遵循教程一步一步的,一切都做了一步一步,但当点击支付与条纹,窗口重定向将弹出,但这是.在检查控制台时,我得到了以下错误
http://localhost:3000/api/stripe 400 (Bad Request)
在控制台我有
Uncaught (in promise) IntegrationError: stripe.redirectToCheckout: You must provide one of lineItems, items, or sessionId.
我的代码到目前为止
getStripe.js
import { loadStripe } from '@st