File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4242 < form style ="margin: 20px 0 ">
4343 < div >
4444 < input type ="text " placeholder ="Transaction ID " name ="transactionId " autocomplete ="off " style ="width: 250px "/>
45- < button type ="button " onClick ="initWalletButtons(document.querySelector('input[name=transactionId]').value ) "> Render buttons</ button >
45+ < button type ="button " onClick ="initWalletButtons() "> Render buttons</ button >
4646 </ div >
4747 </ form >
4848 < div id ="results-container " class ="hidden ">
4949 < div style ="display: flex; flex-flow: row wrap; justify-content: space-between; margin: 20px 0 ">
5050 < div class ="button-container "> < span class ="hint "> < strong > Google Pay</ strong > works in all browsers</ span > < div id ="googlepay-container "> </ div > </ div >
5151 < div class ="button-container "> < span class ="hint "> < strong > Apple Pay</ strong > requires Safari 17</ span > < div id ="applepay-container "> </ div > </ div >
5252 </ div >
53- < pre id ="events "> </ pre >
5453 </ div >
54+ < pre id ="events "> </ pre >
5555 </ div >
5656 < footer >
5757 < a href ="https://github.com/datatrans/secure-fields-sample/blob/master/pciproxy-examples/wallets.html "> View this page on GitHub</ a >
5858 </ footer >
5959 < script >
60+ var eventContainer = document . getElementById ( 'events' ) ;
61+ var transactionIdInput = document . querySelector ( 'input[name=transactionId]' ) ;
62+
6063 var secureFields ;
6164
62- var eventContainer = document . getElementById ( 'events' ) ;
65+ function initWalletButtons ( ) {
66+ var transactionId = transactionIdInput . value ;
6367
64- function initWalletButtons ( transactionId ) {
6568 if ( secureFields ) {
6669 secureFields . destroy ( ) ;
6770 } else {
9194 if ( data ) {
9295 eventContainer . innerText += 'Success: ' + data + '\n' ;
9396 }
97+
98+ document . getElementById ( 'results-container' ) . classList . add ( 'hidden' ) ;
99+ transactionIdInput . value = '' ;
100+ secureFields . destroy ( ) ;
94101 } ) ;
95102
96103 secureFields . on ( 'ready' , function ( ) {
You can’t perform that action at this time.
0 commit comments