I see currently in Global Payment document, if we want to launch the light box, we need to pass the id of the button, then global payment will handle itself the 'onClick' function to open the lightBox :
$(document).ready(function() {
$.getJSON("sdkRequestEndpoint", function(jsonFromRequestEndpoint) {
RealexHpp.setHppUrl("https://pay.sandbox.realexpayments.com/pay");
RealexHpp.lightbox.init("payButtonId", "responseEndpoint", jsonFromRequestEndpoint);
});
});
I wonder can I handle the onClick function by myself, because I am trying to call another api to check a condition, if that api return true, it will automatically open the lightBox .
Thanks