#beardage_code

1 messages ยท Page 1 of 1 (latest)

tough torrentBOT
#

๐Ÿ‘‹ 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/1410028358628282429

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

candid charm
#

Hi there. Threads can't be reopened but feel free to share what you're working on

tropic girder
#

ah dang. Okay, I was able to achieve a disabled state for the express payment buttons by wrapping a div with a _before sudoselector on it to visually obscure the buttons, similar to how a deactivated button would work. Combined that with an onClick handler on the ExpressCheckoutElement itself that overrides the onClick behavior if someone was able to open devtools and remove the psuedo element.

Here's a code snippet of the wrapper component:

#

I'm also using the redirect: if_required property on the checkout.confirm function to submit our additional form data after confirming payment went through, and redirecting after that's successful.

candid charm
#

Nice!

tropic girder
#

ah actually looks like the onClick parameter isn't valid, so the logic for preventing the checkout if someone removes the pseudo selector probably needs to be a bit more clever

candid charm
#

there is an element.blur() method but I'm not sure if it'll work with the ECE and as you're intending. Might be worth looking at though

tropic girder
#

are my types out of date or something? it looks like I should be able to do onClick, but then I get IntegrationError: Invalid value for eventType of expressCheckoutElement.on(): value should be one of the following strings: ready, focus, blur, escape, loaderror, confirm, cancel. You specified: click.

candid charm
#

are you using other elements on the page?

#

like is there another component that is using Checkout Sessions on the Payment Element or something like that?

tropic girder
#

yup these buttons are rendering in addition to the Payment Element

candid charm
#

Yeah, that's the reason why you can't use onClick

#

Its to prevent you from getting different data than the Checkout Session, essentially

tropic girder
#

hmm alright ๐Ÿค” fair enough