#sweetpotato8776

1 messages · Page 1 of 1 (latest)

sharp flaxBOT
night pagoda
#

hello! so do you want to display the button when all fields are valid? or do you want to validate the input upon clicking the Google Pay button (and only display the payment interface if input is valid)?

robust raft
#

i want to validate the input upon clicking the Google Pay button !

#

and only display the payment interface if input is valid

night pagoda
#

i don't think you should be validating the input with the onClick event of the Express Checkout Element since you need to call the resolve function within 1 second.

#

i don't think there's any good way to do this and you should really look into building a different flow instead e.g. have a submit button, then validate on submit, and display the confirmed info with the Express Checkout Element on a different page

robust raft
#

i can't have two buttons. I don't think there's any point in having a separate express checkout google pay button.

#

Does it always open after 1 second?

night pagoda
#

it'll likely timeout and you won't be able to open the interface i think, but you can try it out

robust raft
#

Could you please show me some example code?

night pagoda
#

what example code?

robust raft
#

Example of calling resolve function

robust raft
#

i already saw it..

#

expreeCheckoutElements.on('click', (event) => {

    const isValid = checkValid();
    if(isValid){
        setBillingAddr();
        return event.resolve();
    }else{
        return event.reject();
    }


});
#

But I don't know how the Google pay interface doesn't appear.

night pagoda
#

can you share the URL to your test site so that we can take a look?

sharp flaxBOT
robust raft
#

There is only a test server yet,,

eager saddle
#

We'd need the test website to look into why Google Pay isn't showing

robust raft
#

Google Pay is visible.

#

The problem I'm facing is that when I click on it, I want the Google Pay payment window to appear based on the conditions.

eager saddle
#

What kind of information are you validating? The user experience can be poor if you offer Google Pay option, but doesn't allow Google Pay interface to be shown.

robust raft
#

There are cases where the billing address can be modified internally, so Google Pay payments must be disabled before the billing address is entered.