Comments (11)
I know it's a completely unrelated context, but maybe it's useful to know the problem applies to more than just React. I'm also having this problem while using lit-element. Is this still an issue? I'm barely starting to do some research, but my first guess is that it's not taking into account the shadow root. It tries to find the component by calling window.querySelector() instead of shadowRoot.querySelector().
from react-stripe-elements.
Hi @ljbade—in your second example it sounds like the CardElement
and underlying Elements DOM element is getting removed from the document's DOM tree and so Stripe.js is unable to read the field contents. Make sure to call createToken
before removing the CardElement
from visibility, as React is free to garbage collect the DOM nodes for a removed component .
As for your first example, I'm wondering if the same thing is happening—can you share some more of your code and/or a JSFiddle that demonstrates the issue? If you'd prefer to do so in private feel free to contact Stripe Support via https://support.stripe.com/email/login
from react-stripe-elements.
I have the same issue for your first example.
from react-stripe-elements.
@fred-stripe Thanks for the reply, the submission event does call createToken
first, followed by a Promise .then
to change the React state to hide the CardElement
so it shouldn't cause problems, and I can recreate the issue when I make it so that I click the submit button, followed by separately clicking the button to toggle the editable state.
I will see if I can make a simple JSFiddle for the second issue, the first one relies on an async loading call to our backend API so is not as easy to recreate.
from react-stripe-elements.
@fred-stripe tried to make a JSFiddle but couldn't get the issue in a basic example, perhaps there is some strange interaction with redux-form
which we are using.
https://jsfiddle.net/qkffzr3k/1/
from react-stripe-elements.
Hey, I believe this may indeed be an issue with redux-react
's higher-order components + and our injectStripe
HOC; closing this issue to consolidate my research on #55; please follow along there!
from react-stripe-elements.
Ran into a similar issue: I am creating a card element on did-mount, but when I call createToken
, it does not seem to be appearing in the this.context.registeredElements
for the injectStripe
-wrapped parent component.
Debugging this, I noticed that handleRegisterElement
is called in Elements
as expected, and that there is a corresponding re-render of the Elements
component. However, the render method of the wrapped injectStripe
HOC does not seem to be called. Perhaps React does not refresh the context
for the latter even though the Elements
component state changes/re-renders?
Thanks!
from react-stripe-elements.
I'm getting a similar error We could not retrieve data from the specified Element. Please make sure the Element you are attempting to use is still mounted.
Using snabbdom though. Seems like stripe doesn't play nice with vdom libraries
from react-stripe-elements.
It is very well possible to reproduce this issue assuming the following happens:
- You're online, you pull down the https://js.stripe.com/v3/ and instantiate a stripe instasnce
- You go offline
- Render the checkout button and then hit Submit
Here's the supporting gist for the recording above: https://gist.github.com/davidpatters0n/af1548f6bc9bd7bf5ea2a0eb668ad8f4
from react-stripe-elements.
I'm trying to use Stripe.js with Polymer 3 elements and getting a similar error. Did anyone find a solution for this?
from react-stripe-elements.
Has anyone found a solution for this? Im having the same issue
from react-stripe-elements.
Related Issues (20)
- CardNumberElement Placeholder Not Working HOT 1
- CardCvcElement onComplete fires after three digits for AMEX card HOT 2
- docs: confirmCardPayment with split card elements needs a docs update HOT 1
- Payment Fields are not clickable in Samsung device HOT 2
- My Stripe promise with React never resolves even after trying a timeout HOT 1
- 3D Secure Test Payment Screen iFrame - Any way to preview or control width/height? HOT 1
- Not able to customize CSS of CardElement HOT 1
- Split Card Number Not Inserted with 1Password Autofill HOT 1
- Elements locale option not localizing HOT 5
- When click on stripe element its getting blur HOT 1
- About scan card feature in mobile device HOT 1
- PaymentRequestButton Does Not Load On Safari PWA HOT 1
- Stripe console message : parameter: betas is not a recognized parameter. HOT 2
- Connection Failure text in CardNumberElement HOT 3
- loadStripe does not seem to work
- styling CardElement HOT 1
- Add support for extra types of buttons for Apple Pay HOT 1
- Elements tag doesn't accept locale HOT 2
- Add a full stripe elements integration example HOT 1
- PaymentRequestButtonElement Integration Error with saved browser card HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-stripe-elements.