2

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

Ashish
  • 6,791
  • 3
  • 26
  • 48
  • Looks like you can close the modal with `Instamojo.close()` but the modal does not have any "close" button so... I don't know how it is supposed to works. You can still go through the form and make a failed payment and only at the end you'll see the "close" button. That's pretty bad. – Quentin Grisel Sep 19 '20 at 10:06
  • @QuentinGrisel It's too long process for user. If user decide to make payment later it's problamatic – Ashish Sep 19 '20 at 10:07
  • 1
    Yeah I understand that, but I couldn't find a proper way to do that. A close button is a must-have in every modal, it's a no-go for me if you can't even add it youself. – Quentin Grisel Sep 19 '20 at 10:10

0 Answers0