cancel
Showing results for 
Search instead for 
Did you mean: 

CIM Hosted Form Popup

I am using CIM hosted form as a popup. After a customer authorizes a payment and closes popup how do I get confirmation that payment was authorized by customer? I want to know if customer authorized or did nothing before closing popup.

 

Thanks

webDev1
Member
4 REPLIES 4

The popup don't authorize payment. it allow the customer to save a payment profile.

RaynorC1emen7
Expert

Yes I meant payment profile. How do I know if payment profile was added?

Anyone know?

 

Thanks

 

 

webDev1
Member

What I've done so far is to change the AuthorizeNetPopup.closePopup() function in popup.js to have a "didCancel" parameter of either "1" if cancel was selected or "0" if save was selected.   AuthorizeNetPopup.onReceiveCommunication() knows if it was save or cancel, but doesn't pass that on to the user-supplied function.

 

contentx/popup.js contentx/popup.js 
contentx/popup.js	2011-04-22 14:28:22.000000000 -0400
+++ contentx/popup.js	2015-11-16 13:23:45.601852262 -0500
@@ -34,11 +34,11 @@
 		,skipZIndexCheck: false
 		,useTestEnvironment: false
 	};
-	AuthorizeNetPopup.closePopup = function() {
+	AuthorizeNetPopup.closePopup = function(didCancel) {
 		document.getElementById("divAuthorizeNetPopupScreen").style.display = "none";
 		document.getElementById("divAuthorizeNetPopup").style.display = "none";
 		document.getElementById("iframeAuthorizeNet").src="contentx/empty.html";
-		if (AuthorizeNetPopup.options.onPopupClosed) AuthorizeNetPopup.options.onPopupClosed();
+		if (AuthorizeNetPopup.options.onPopupClosed) AuthorizeNetPopup.options.onPopupClosed(didCancel);
 	};
 	AuthorizeNetPopup.openManagePopup = function() {
 		openSpecificPopup({action:"manage"});
@@ -59,10 +59,10 @@
 		var params = parseQueryString(querystr);
 		switch(params["action"]) {
 			case "successfulSave":
-				AuthorizeNetPopup.closePopup();
+				AuthorizeNetPopup.closePopup(0);
 				break;
 			case "cancel":
-				AuthorizeNetPopup.closePopup();
+				AuthorizeNetPopup.closePopup(1);
 				break;
 			case "resizeWindow":
 				var w = parseInt(params["width"]);

 

mkienenb
Contributor