// Create paymentRequestButton & mount to <div> container const paymentRequestButton = elements.create('PAYMENT_REQUEST_BUTTON', { paymentReqData }); paymentRequestButton.mount('#payment-request-button'); // Handle validation errors after tokenization paymentRequestButton.addEventListener('paymentMethod', function(tokenData) { console.log(tokenData); });
I am following the documentation for the iFrame and using the Google Pay button like this. The Button renders fine and I can select a card. When I submit payment the event listener fires and there is no token data at all it's just an empty object.
Is this just the behavior when using sandbox keys? Will it provide a card token similar the tokenized card if you enter your details that way?