I have a react application that wishes to implement an external script and html button from a platform which contains button that triggers a script that pops out an iframe for checkout. I added this external script in my React index.html file and rendered the button in a component. When that button gets clicked, it calls that script. It is working but I would like to know when user checks-out by listening to their button click. I dont know if this is possible. Or any way to know when user perform certain action such as clicking check out button;
Here is the script:
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script src="https://cdn.wetravel.com/widgets/embed_checkout.js"></script>
</body>
I added the button in a component:
<button class="wtrvl-checkout_button" id="wetravel_button_widget" data-
env="https://awebsite.com" data-version="v0.3" data-uid="62302" data-
uuid="54806750" href="https://website.com/checkout_embed?uuid=54806750"
style={{backgroundColor:'black', color:'#ffffff', border: '0px', borderRadius: '5px',
fontFamily: 'Poppins', cursor: 'pointer'}}