I created session in php and navigate to the sample Mastercard payment gateway.I cansucessfully navigate to it but I cannot obtain the data from afterRedirect function passed by beforeRedirect function. It seems to be afterRedirect funtion doesn't work. Is it because security conditions in payment gateway. Can you offer some help to solve this problem. I want to bring back passed data like orderId, sessionId ....
Here are my functions,
Код: Выделить всё
function beforeRedirect() { return { successIndicator: successIndicator, orderId: orderId, sessionId: sessionId, sessionVersion: sessionVersion, merchantId: merchantId }; } function afterRedirect(data) { //return; //return false; // Compare with the resultIndicator saved in the completeCallback() method if (resultIndicator) { var result = (resultIndicator === data.successIndicator) ? "SUCCESS" : "ERROR"; window.location.href = "payment-complete.php/" + data.orderId + "/" + result; //break; } else { successIndicator = data.successIndicator; alert(successIndicator); orderId = data.orderId; sessionId = data.sessionId; sessionVersion = data.sessionVersion; merchantId = data.merchantId; window.location.href = "payment-complete.php/" + data.orderId + "/" + data.successIndicator + "/" + data.sessionId; } } function completeCallback(response) { console.log("completeCallback", sessionId); console.log("completeCallback", response); console.log("completeCallback", Checkout); console.log(successIndicator); alert(); //console.log("hello"); console.log("completeCallback", response); var sParam = "completeCallback " + orderId + " " + response; // Save the resultIndicator resultIndicator = response; var result = (resultIndicator === successIndicator) ? "SUCCESS" : "ERROR"; //window.location.href = "/hostedCheckout/" + orderId + "/" + result; window.location.href = "payment-complete.php"+ orderId + "/" + result;; } Checkout.configure({ session: { id: sessionId } }); Источник: https://stackoverflow.com/questions/781 ... not-woking
Мобильная версия