#salimgt

1 messages · Page 1 of 1 (latest)

unborn coyoteBOT
worthy phoenix
#

i have a button named button. Here after gpay check passed and user sign up, i add event listener to this button via this code:
button.addEventListener('click', paymentRequest.show);

so in this case paymentRequest.show will be fired, only when you click on button

it is first method of opening gpay popup

but, instead of adding event listener to button, i can run paymentRequest.show manually in code, to not click button

and this not works

works only 1st method

you need click button to run paymentRequest.show method

is there a way, how to run paymentRequest.show method without clicking on button

got it?

regal sail
#

Nope

#

This method must be called as the result of a user interaction (for example, in a click handler).

#

From the above link

worthy phoenix
#

what do you suggest?

#

i have 3 steps.

i want when user click gpay button, i want to register him first and then the gpay popup will opened

#

how i can achieve that?

regal sail
#

You can have multiple actions in a click handler

#

So first register the user then call show()

worthy phoenix
#

user will click one time?

#

can you provide more details please

regal sail
#

button.addEventListener('click', paymentRequest.show);
Instead of passing paymentRequest.show, pass a function. Within that function, you should be able to both register the user and call paymentRequest.show()

unborn coyoteBOT