How to Embed Instamojo Donate Payment Button Using Javascript SDK | Instamojo API Payment Gateway in Javascript

How to Embed Instamojo Donate Payment Button Using Javascript SDK | Instamojo API Payment Gateway in Javascript

 

 

 

 

 

 

 

 

 

 

 

 

<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>

 

 

 

See also  Javascript Project to Show & Hide Columns,Rows of HTML5 Table Dynamically on Mouse Right Click in Browser Full Project For Beginners

 

Leave a Reply