#moistcode-ACH-debit
1 messages · Page 1 of 1 (latest)
Also no rush on this answer so feel free to answer whenever you have the bandwidth.
Hmm so when you actually go to link the account you are getting a blank screen?
Yeah. The Payment Element example on https://stripe.com/docs/payments/payment-element shows the window very briefly and it disappears.
Hmm which part of the modal specifically?
Which button do you hit and then see a blank screen?
Can I record a short video of my testing and DM you it?
It may be easiest to just share your code here
Yes a video works too
But seeing your code also may do the trick
Friend requested you real quick to send the link to the video since I don't want to in public quite yet.
I'll dig into the code after my next meeting as well.
Thanks Bismarck
Sure thing. I'll take a look at the video in a moment
Alrighty, sorry about that. In terms of the code, I'm not entirely sure what to show since everything that happens within this form is from <PaymentElement>.
<PaymentElement
onChange={onCompleteChange}
onReady={() => setIsPaymentElementReady(true)}
options={{
fields: {
billingDetails: {
address: 'never',
name: 'never',
},
},
readOnly: disabled,
}}
/>
Can you share your confirmPayment code?
Yeah. This one instance is confirming a setup.
let {
setupIntent,
error: confirmStripeSetupError,
} = await stripeObj.confirmSetup({
elements: stripeElements,
redirect: 'if_required',
confirmParams: {
/* eslint-disable camelcase */
payment_method_data: {
billing_details: {
name: `${firstName} ${lastName}`,
address: {
line1,
line2,
city,
state: region,
postal_code: postalCode,
country,
},
},
},
/* eslint-enable camelcase */
},
});
Hmm
All that looks fine and I haven't been able to repro
Can you share your elements initialization and your appearance object?
Quite a bit of lines so I had to make a gist for it.
https://gist.github.com/MoistCode/54840c2bfc13a9c490eaad2629b5baeb
I apologize for having so many lines in there. Usually I'm good at narrowing things down to make it easier for others to parse but at this point I'm not really sure what I'm looking for.
No that's totally fine
I'm playing with my sample based on what you are doing
May take a few mins
Thanks again for your time.
When you are stuck on the white redirect page can you open your dev tools and look to see if anything is in the Console?
Also what does your onCompleteChange function do?
Lastly are you testing locally or can we visit your site to repro?
No rush, myself or a colleague will be around when you are back
👋
I'm testing locally on a box that's gated behind a VPN. I wonder if that's causing an issue. Also hey Karbi!
Gimme one second to get answers to your other questions.
Nothing shows up in the console for that redirect page. There is something odd I see in the network tab of the page containing the <PaymentElement> though. I see a request to /cancel.
Also all my onCompleteChange function does is it basically sets some React state that I use elsewhere to determine whether to enable/disable the submission button.
let onCompleteChange = useCallback((e) => {
// Ensure there's a valid address along with a completed and valid payment
// before flagging the form as completed.
if (e.complete && addressState.addressData?.addressKey) {
setPaymentMethodType(e.value.type);
setFormComplete(true);
return;
}
// If there's no address but the payment form is completed, set the payment
// method type.
if (e.complete) {
setPaymentMethodType(e.value.type);
return;
}
setFormComplete(false);
}, [addressState.addressData?.addressKey]);
Hmm.... Is it at all possible for you to test this out in a different environment (not gated behind the VPN) that'd be my first guess about something being wrong, but I'm not sure.
Let me also dig in a bit more to the /cancel request
This question isn't too important at the moment but at some point in the future I may be able to setup a public facing environment to test this on. If you don't find much don't worry about it. I have a feeling it might be due to the environment I'm testing it on which I'll test in the future.
Yeah, both @scarlet raptor and I tried to reproduce and we're not seeing the same behavior at all
A good thing to check would be to download one of our simple samples (https://github.com/stripe-samples/accept-a-payment/tree/main/payment-element), and if it's something you can reproduce with the sample then that's a stronger indicator that it's something to do with your environment