1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
<html> <head> <script src="https://js.instamojo.com/v1/checkout.js"></script> <script> /* Start client-defined Callback Handler Functions */ function onOpenHandler () { alert('Payments Modal is Opened'); } function onCloseHandler () { alert('Payments Modal is Closed'); } function onPaymentSuccessHandler (response) { alert('Payment Success'); console.log('Payment Success Response', response); } function onPaymentFailureHandler (response) { alert('Payment Failure'); console.log('Payment Failure Response', response); } /* End client-defined Callback Handler Functions */ /* Configuring Handlers */ Instamojo.configure({ handlers: { onOpen: onOpenHandler, onClose: onCloseHandler, onSuccess: onPaymentSuccessHandler, onFailure: onPaymentFailureHandler } }); function onButtonClick() { Instamojo.open('http://www.instamojo.com/@geekygautam1997'); } </script> </head> <body> <button onclick="onButtonClick()"> Donate Here </button> </body> </html> |