#sweetpotato8776
1 messages · Page 1 of 1 (latest)
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)?
i want to validate the input upon clicking the Google Pay button !
and only display the payment interface if input is valid
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
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?
it'll likely timeout and you won't be able to open the interface i think, but you can try it out
Could you please show me some example code?
what example code?
Example of calling resolve function
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.
can you share the URL to your test site so that we can take a look?
There is only a test server yet,,
We'd need the test website to look into why Google Pay isn't showing
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.
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.
There are cases where the billing address can be modified internally, so Google Pay payments must be disabled before the billing address is entered.