Hi Team,
I have implemented accept hosted payment form with iframe with light box container, this implementation working finr with Chrom,FF.
But now the problem is Cancel button is not currectly working in IE. I am not getting any response message in my communicator page also.
When i click on Cancel button it reload my page inside iFrame without closing iframe.
Here is my return parameter detials that i am passing during token generation :
SettingType setting7 = new SettingType(); setting7.setSettingName("hostedPaymentReturnOptions"); setting7.setSettingValue("{\"showReceipt\": false, \"url\": \"https://localhost:8443/AuthorizeDemo/home.jsp\",\"cancelUrl\": \"https://localhost:8443/AuthorizeDemo/\"}");
Please note: it is working fine with chrom,FF.
08-24-2017 12:39 AM
Hi @raviparmarce88,
It might be more helpful to post whatever JavaScript code you're using to listen for the cancel message. Can you add some code to log every message coming in to the console before your script takes action so that you could verify whether or not the cancel message is being passed?
08-25-2017 03:54 PM
I'm using the modal approach and desire the cancel button to simply close the modal. I found that unless I provided a cancelUrl in the hostedPaymentReturnOptions when requesting the token that the cancelContinueBtnHandler message would not be communicated via the IFrameCommunicator.
With the cancelUrl set to a non empty string it works as expected.
Without the cancelUrl set it does NOT work.
JavaScript code to listen for the cancel message:
window.CommunicationHandler = {};
function parseQueryString(str) {
var vars = [];
var arr = str.split('&');
var pair;
for (var i = 0; i < arr.length; i++) {
pair = arr[i].split('=');
vars[pair[0]] = unescape(pair[1]);
}
return vars;
}
CommunicationHandler.onReceiveCommunication = function (argument) {
params = parseQueryString(argument.qstr)
switch (params['action']) {
case "resizeWindow":
if (parseInt(params['height']) < 1000) {
params['height'] = 1000;
}
$("#load_payment").outerHeight(parseInt(params['height']));
break;
case "cancel":
$('#paymentModal').modal('toggle');
break;
case "transactResponse":
var transResponse = JSON.parse(params['response']);
$('#paymentModal').modal('toggle');
$.post("/pay/CompletePayment", {
transcationIdentifier: transResponse.orderInvoiceNumber,
transId: transResponse.transId
}, function (data) {
window.location.href = "Success?id=" + transResponse.orderInvoiceNumber;
});
break;
}
}
10-10-2017 04:10 AM