Вы хотите использовать метод bind
вашей функции или синтаксис жирной стрелки из машинописи. Это будет либо:
let options = {
"amount": 100,
"name": "ABC",
"currency": "USD",
"handler": function (response){
console.log(response);//this returns the expected value
this.handle_response(response); //does not work as cannot identify 'this'
}.bind(this)
};
let rzp1 = new this.winRef.nativeWindow.Razorpay(options);
rzp1.open();
handle_response(_response){....}
ИЛИ
let options = {
"amount": 100,
"name": "ABC",
"currency": "USD",
"handler": (response) => {
console.log(response);//this returns the expected value
this.handle_response(response); //does not work as cannot identify 'this'
}
};
let rzp1 = new this.winRef.nativeWindow.Razorpay(options);
rzp1.open();
handle_response(_response){....}