We are using the hosted form solution for integration, and at first I had good luck with the iframe communication when a transaction was submitted, the example javascript code supplied on the authorize.net github account worked well, allowing us to respond to a completed transaction with our own code and update our database. Now, we never see a finished transaction and I don't know why. Here is our code.
(function () { window.CommunicationHandler = {}; window.CommunicationHandler.onReceiveCommunication = function (querystr) { console.log('receive'); var params = parseQueryString(querystr.qstr); console.log(params); switch (params["action"]) { case "successfulSave": break; case "cancel": break; case "resizeWindow": var w = parseInt(params["width"]); var h = parseInt(params["height"]); var ifrm = document.getElementById("add_payment"); ifrm.style.width = w.toString() + "px"; //ifrm.style.height = h.toString() + "px"; break; case "transactResponse": var data = params['response']; $.post('receive.php?donation_id=<?php print $donation_id; ?>', data, function(response) { }); var ifrm = document.getElementById("add_payment"); } };
We never see the transactResponse action any more, only the resizeWindow action, and I have no idea why. Anyone have any idea how to troubleshoot this?
01-27-2021 02:54 PM