#fredrick245_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1485976558027145307
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Intergreting with stripejs elements
ok, would you mind sharing the confirmPayment code?
@mild gazelle are you still here?
do you have your website running on an accessible server where I could test?
yes
can create an account using a dummy email
or lemme create the account for you
yes please do
you can delete them now if you like
Invalid client account id
and the billing page is not loading
actually no page is loading ๐
Can you try upgrading the plan, and then select ach on the last step
That is where I have a problem
can you to the /dashboard
I have started using stripe on this project, and I noticed that you guys dont have very good docs
Or beginer friendly docs
Is there maybe a github repo with an example with an example on how to intergrate ach and also some of the webhooks
we'll get to that in a minute
So the first options work, but when you use the Bank Oath , and you are redirected to login into you bank
can we just keep on track with the ACH issue for now, just bear with me
You are not redirected back to my app
It just says Something went wrong with a 400 error
yes, I'm taking a look
I'm working with my colleague @uneven spoke that will take over the chat to figure out what's happening here
Ok
we'll get back to you shortly
hey there, have been poking at this with tarzan and looking at the code you shared
1/ Are you hitting the error block after elements.submit() here?
const { error: submitError } = await elements.submit();
if (submitError) {
onError(submitError.message ?? 'Please complete the form');
setSubmitting(false);
return;
}
The issue is am not being redirected back, after logging into the bank
2/ I noticed some potentially problematic patterns in your initialization, where you pass the clientSecret both to <Elements> options and in confirmSetup
<Elements
key={clientSecret}
stripe={stripePromise}
options={{ clientSecret, appearance: ACH_ELEMENTS_APPEARANCE }}
>
const result = (await stripe.confirmSetup({
elements,
clientSecret,
confirmParams: {
return_url:
typeof window !== 'undefined'
? `${window.location.origin}/organization/billing`
: 'https://example.com',
payment_method_data: {
billing_details: billingDetails
}
}
}))
So am not getting the bank details like the last 4 digits and routing number that I can use then to submit the form
Additionally, this confirmSetup call with both of elements and clientSecret is not expected and may be invalid
Is this ever working for any bank choice, or never worked?
yes
I suspect this elements configuration might be failing in unexpected ways due to the pattern
What does yes mean?
ok
Lemme look at this from that point and then I will reach out it does'nt work
Other options work perfectly fine,
The one that does not work is the one where a new tab is opened for the user to login
Do you guys have a repo or an example repo where this has been worked out so that I can draw insipiration from there
This example implementation is confirm a Payment Intent rather than setup intent, but should be analogous
https://github.com/stripe-samples/accept-a-payment/tree/main/payment-element/client/react-cra/src
Note that with the clientSecret passed in the ELements provider, you dont need to pass it again on confirm:
Provider: https://github.com/stripe-samples/accept-a-payment/blob/main/payment-element/client/react-cra/src/Payment.jsx#L22
Confirm: https://github.com/stripe-samples/accept-a-payment/blob/main/payment-element/client/react-cra/src/CheckoutForm.jsx#L25
Your app logic seems to wait for 1clientSecret` to be set before rendering elements, so you have that with a value up front
i would suggest removing this from the confirm call
But it would also be helpful to know where in your client code this gets to / where is it failing
Ah, and with the client secret up front, the elements.submit() call isnt needed at all
so you cna try removing that and just going directly to confirmSetup