#tsahnar-paymentElement
1 messages ยท Page 1 of 1 (latest)
It is hapenning when we are working locally
on the dev enviormant
Nothing is loading in the input fields and we cannot type in them
Hi! Can you share your code?
yes
just a second
We have this wrapper that wraps places where we use the form:
export const StripeElementsWrapper: FC = ({ children }) => {
const stripePromise = loadStripe(config.stripePublicKey);
return <Elements stripe={stripePromise}>{children}</Elements>;
};
Where are you passing the clientSecret to the Element?
You can see an example here: https://stripe.com/docs/stripe-js/react#elements-provider
No client secret
As mentioned in the doc I just shared: " If you want to use Payment Element, it is required to pass in the clientSecret."
It worked without it
up until now
As you see I cannot even pass a saecret key in options
Are you using React Stripe.js? https://stripe.com/docs/stripe-js/react
yes import { Elements } from "@stripe/react-stripe-js";
import { loadStripe } from "@stripe/stripe-js";
I should say that this is somwthing that worked - we have not changed anything
and in our starging/prod enviorments its working. In our deve enviorment we get the error I send you
Strange. And this is the error:
Uncaught (in promise) URIError: URI malformed
at decodeURIComponent (<anonymous>)
And you are sure it comes from the Payment Element?
I think so
The fields are not loaded propely and you can see the error is from V3
stripe.esm.js
error in initStripe method
Sorry Discord is busy right now. Could you send your code and the error message to Stripe Support directly? They will be able to better help you. https://support.stripe.com/?contact=true
Hey there, taking over from @fair flume
Which version of @stripe/react-stripe-js do you have installed?
This thread has been archived. If you need help with anything else please ask in #dev-help or contact Stripe Support: https://support.stripe.com/contact
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Hi! se we use version 1.4.1
Hey. Give me a bit to catch up here
Ok let me know if you got questions for me
I see. Has someone responded to your support request yet over email?
Ok. If they are already investigating there, I will let them continue to assist you in that channel
They'll give you a concrete response
Will be a difficult thing to investigate over Discord
As there are many threads
@worn crow Sorry, which version of @stripe/stripe-js?
Looks like your types are just out-of-date. So you could silence with // @ts-ignore
1.16.0
yup, they were added in 1.18.0 I think: https://github.com/stripe/stripe-js/releases/tag/v1.18.0
Try updating
where do I get the client secret? How did it work without it up until now?
From the Payment Intent
Are you just now transitioning to use <PaymentElement />?
No
we have this for the last couple on months
it worked without it. We use the client secret when trying to confrim setup intent in the client
I don't know then. But the <Elements> provider requires the clientSecret prop if you're using the <PaymentElement>
We didnt need it - and in fact this is working on other enviorments (like our prod)
Stripe.js will error without it and the Element won't render
But anyway, that error you shared is just your types being out-of-date. So update your packages and it'll have new type defs
Both if you can
I think react-stripe-js in this instance as it has a stripe-js dependency for the types anyway: https://github.com/stripe/react-stripe-js/blob/master/package.json#L65
Ok I will try it
This thread has been archived. If you need help with anything else please ask in #dev-help or contact Stripe Support: https://support.stripe.com/contact
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Hi again
i tried updating but I still get the same result
updated both stripe react js and stripe js to latest
Catching up here @worn crow, give me a moment!
I want to add that this is something that worked, we even rolled back to a very old branch but still the same behvior
in local env, the stripe credit card fields are not loading properly
I know you are saying it worked before, but Payment Element has always required a client secret in order to render.
I can send you a link now to a form which does not have the client secret
and it works
locally it stopped working
we use the generated secret when calling confirmCardSetup
That would be great
go to the drop down and click add new card
This will open our form that uses your elements
As you can see everything is working as expected.. in our dev env its not loading properly
Thanks for providing that and sorry for the delay! Still looking, give me a moment.
thanks
Can you provide your account ID?
where do I get it?
It will be in the top right of your Dashboard here: https://dashboard.stripe.com/settings/account
acct_1I2w7nH9XIA4kPmA
For the link I send you the account is different
because for local dev we got a different account. What I sent you (where it working) its the sandbox
Alright so from testing it doesn't look like you are using Payment Element in that sandbox
Ah actually, I'm not sure that is the correct account for that form. I'm not seeing my test in the account at all.
I ran a test payment on that link that had a working form to take a look at how the payment was created, but it isn't showing in the above account.
Yep sure, that would still be helpful as you are stating the two forms should behave the same way.
Okay thank you. So it looks like you are using Card Element here with a SetupIntent. This is a different integration than Payment Element. Card Element does not require a client secret in order to render like Payment Element does.
๐ Hello! I'm hopping in since @slate portal has to step out
You're referring to the URI Malformed error from earlier?
?
I'm trying to reproduce the same error, but I'm not seeing the same issue - what version of react-stripe-js and stripe-js are you using?
As I wrote above we used 1.4.1 and 1.16
but I updated both to latest and it still happening
and what version of react are you using?
17.0.1
I'm still not able to reproduce for some reason - is there anything unique about your dev setup that I may be missing in my reproduction?
I dont think so...
its just stopped working suddenly
The error is not clear - do you have any idea where this can come up? The url deformed error
I'm not sure why this could be happening at all, and it's tough because I don't see the same thing in my own local integration
Is this something you see happen consistently across chrome, firefox, and safari?
yes
Also there was another use case that it happned on our sandbox enviormnt - we cleared the stripe cookies, did restart and it worked
So it happned one time not in our local env
Just to triple check - when you log/print config.stripePublicKey right before calling loadStripe you get a pk_xxx value, correct?
yes
Thank you for confirming. We are still looking in to what may be causing this error.
Thanks!
hey @worn crow -- how are you accessing this local env? Can you share the URL here (I'm aware it won't work, but would like to see the full URL)
Have you been able to narrow this down to a minimal reproduction you can share the complete runnable code for we can inspect?
I think w found the issue - on our end
Thank you for you support
took a lot of time to investigate and pin point the exact issue
What was the problem?
Can you share what that was, exactly?
If other people run into something similar it would be helpful for us to know what the fix was. ๐
It was something in our local enviorment
we didnt pass some enviorment variables and its messed up our URL
explains why it happened only in our local env
I'm guessing there was some placeholder or missing component leading to an invalid URL structure?
Similar error to the one seen here, but not exactly the same: https://example.com/test%s
in dev console you get The attempt to bind "/test%s" in the workspace failed as this URI is malformed.