payu-intrepos / payumoney-new-sample-app

New Sample App For PayUmoney and PnP SKD integration
40 stars 37 forks source link

Handling Callback in responseHandler: Bolt #40

Closed ashok23489 closed 4 years ago

ashok23489 commented 5 years ago

I could not able to call my Update method from the bolt responseHandler:, please help me on this issue.

Angular 6:

Error: core.js:1673 ERROR TypeError: this.updatePaymentInfo is not a function at Object.responseHandler

Please find the below code:

launchBOLT(paymentRequest) { bolt.launch( { key: paymentRequest.key, txnid: paymentRequest.txnId, hash: paymentRequest.hash, amount: paymentRequest.amount, firstname: paymentRequest.firstName, email: paymentRequest.email, phone: paymentRequest.phone, productinfo: paymentRequest.productInfo, udf1: paymentRequest.udf1, surl: paymentRequest.sUrl, furl: paymentRequest.fUrl }, { responseHandler: function(BOLT) { if (BOLT.response.txnStatus != "CANCEL") { this.paymentGatewayResponse = BOLT.response; this.updatePaymentInfo(this.paymentGatewayResponse); } else { alert(BOLT.response); } return BOLT.response; }, catchException: function(BOLT) { alert(BOLT.message); } } );

}

Rahul-Hooda commented 4 years ago

Closing this due to no activity. However, if issue still persists, kindly write a mail to techsupport@payumoney.com

sreeraj-ms commented 4 years ago

I could not able to call my Update method from the bolt responseHandler:, please help me on this issue.

Angular 6:

Error: core.js:1673 ERROR TypeError: this.updatePaymentInfo is not a function at Object.responseHandler

Please find the below code:

launchBOLT(paymentRequest) { bolt.launch( { key: paymentRequest.key, txnid: paymentRequest.txnId, hash: paymentRequest.hash, amount: paymentRequest.amount, firstname: paymentRequest.firstName, email: paymentRequest.email, phone: paymentRequest.phone, productinfo: paymentRequest.productInfo, udf1: paymentRequest.udf1, surl: paymentRequest.sUrl, furl: paymentRequest.fUrl }, { responseHandler: function(BOLT) { if (BOLT.response.txnStatus != "CANCEL") { this.paymentGatewayResponse = BOLT.response; this.updatePaymentInfo(this.paymentGatewayResponse); } else { alert(BOLT.response); } return BOLT.response; }, catchException: function(BOLT) { alert(BOLT.message); } } );

}

chrisstone07 commented 4 years ago

@ashok23489 @sreeraj-ms Convert your responseHandlers to arrow functions, its the easiest solution to this problem.