How to close popup which opened by Checkout Script

214 Views Asked by At

I am trying to integrate Instamojo in the angular but somehow i can't find way to close the popup i opened in it.

Instamojo does not have support library or something like that so i tried something different but i don't find way to close that functionality.

I followed this docs to open the popup.

Code i have tried :

import { Component } from '@angular/core';
declare var Instamojo: any; 
Instamojo.configure({
  handlers: {
    onOpen: onOpenHandler,
    onClose: onCloseHandler,
    onSuccess: onPaymentSuccessHandler,
    onFailure: onPaymentFailureHandler
  }
});
@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'angular-test';
  constructor(){
    
  }
  testFunction(){
    Instamojo.open('https://www.instamojo.com/@syntagsprofessionalservices/310c0309f6e344a08447ab7167dcf7c8')
  }

}

function onPaymentFailureHandler() {
  console.log('a');
}
function onPaymentSuccessHandler() {
  console.log('b');
}
function onCloseHandler() {
  console.log('c');
}
function onOpenHandler() {
  console.log('d');
}

enter image description here

0

There are 0 best solutions below