User Tools

Site Tools


integration-api:detailed

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
integration-api:detailed [2018/06/26 09:43]
tjotov
integration-api:detailed [2019/08/01 09:54]
tjotov removed
Line 1: Line 1:
 ====== ADUCID Integration API Description ====== ====== ADUCID Integration API Description ======
  
-//advanced method to pass more parameters like transaction amount, description, etc.+advanced method to pass more parameters like transaction amount, description, etc.
     aducid.setInitParams = function(param) {     aducid.setInitParams = function(param) {
         initParams = param;         initParams = param;
     }     }
  
-//tell server to generate QR / or not to reduce payload+tell server to generate QR / or not to reduce payload
     aducid.setGenerateQr = function(param) {     aducid.setGenerateQr = function(param) {
         generateQr = param;         generateQr = param;
     }     }
  
-//QR code and animation location jQuery+QR code and animation location jQuery
     aducid.setQrCode = function(param) {     aducid.setQrCode = function(param) {
         qrCode = param;         qrCode = param;
     }     }
          
-//QR code hint jQuery+QR code hint jQuery
     aducid.setQrHint = function(param) {     aducid.setQrHint = function(param) {
         qrHint = param;         qrHint = param;
     }     }
  
-//Embedded timer location+Embedded timer location
     aducid.setQrTimer = function(param) {     aducid.setQrTimer = function(param) {
         qrTimer = param;         qrTimer = param;
Line 36: Line 36:
     }     }
  
-    //check method provided by server side - what API call when PEIG finishes+check method location provided by server side controller
     aducid.setResultOperationUrl = function(param) {     aducid.setResultOperationUrl = function(param) {
         resultOperationUrl = param;         resultOperationUrl = param;
Line 47: Line 47:
     }     }
  
-    //GET or POST +Tell AJAX to use GET or POST 
-    //POST is used to deliver more data like transaction parameters+POST is used to deliver more data like transaction parameters
     aducid.setAjaxMethod = function(param) {     aducid.setAjaxMethod = function(param) {
         ajaxMethod = param;         ajaxMethod = param;
     }     }
  
 +Redirect URL for iOS typically provided by server side controler
     aducid.setRedirectUrl = function(param) {     aducid.setRedirectUrl = function(param) {
         redirectUrl = param;         redirectUrl = param;
     }     }
  
-    //button with bound operation+Button with bound operation
     aducid.setButton = function(param) {     aducid.setButton = function(param) {
         aducidButton = param;         aducidButton = param;
Line 66: Line 67:
     }     }
  
 +Internal logic to evaluate API binding mode
     aducid.setSessionBinding = function(param) {     aducid.setSessionBinding = function(param) {
         if (param == "QR" || param == "URI") {         if (param == "QR" || param == "URI") {
Line 73: Line 75:
     }     }
  
 +Get last binding mode
     aducid.getSessionBinding = function() {     aducid.getSessionBinding = function() {
         return localStorage['session-binding'];         return localStorage['session-binding'];
     }     }
  
 +Is binding URI?
     aducid.isURI = function() {     aducid.isURI = function() {
         return instance.getSessionBinding() == "URI";         return instance.getSessionBinding() == "URI";
     }     }
 +    
 +Is binding QR?
     aducid.isQR = function() {     aducid.isQR = function() {
         return instance.getSessionBinding() == "QR";         return instance.getSessionBinding() == "QR";
     }     }
  
 +Is this operation going to be authentication (i.e. first operation in chain)?
     aducid.setAuthentication = function() {     aducid.setAuthentication = function() {
         instance.setSessionBinding(null);         instance.setSessionBinding(null);
     }     }
  
 +Text hint shown before operation started
     aducid.showQRHint = function(param) {     aducid.showQRHint = function(param) {
         if (qrHint != null) qrHint.html(localize("aducid_common_authenticateComment"));         if (qrHint != null) qrHint.html(localize("aducid_common_authenticateComment"));
     }     }
  
 +How API can hide text hint
     aducid.hideQRHint = function(param) {     aducid.hideQRHint = function(param) {
         if (qrHint != null) qrHint.html("");         if (qrHint != null) qrHint.html("");
     }     }
  
 +Text hint shown after operation started
     aducid.showRunningHint = function(param) {     aducid.showRunningHint = function(param) {
         if (qrHint != null) qrHint.html(localize("aducid_common_authenticationProgress"));         if (qrHint != null) qrHint.html(localize("aducid_common_authenticationProgress"));
     }     }
  
 +How API can hide text hint
     aducid.hideRunningHint = function(param) {     aducid.hideRunningHint = function(param) {
         if (qrHint != null) qrHint.html("");         if (qrHint != null) qrHint.html("");
     }     }
  
-    //Params +The most important method - what API should do when operation finishes (not processed on iOS as we use returnUrl directly there) 
-    var proxyParams = { +    aducid.processResult function(result) 
-        "publicMethod"GET_STATUS", +        alert(result); 
-        "id: null +    } 
-    };+ 
 +How PEIG not installed is treated, marketplace redirect can be used here 
 +    aducid.showPeigError = function() { 
 +        alert("peig error - override this function"
 +    } 
 + 
 + 
 +Auxiliary method to animate operation in progress 
 +    aducid.startAnimation = function() { 
 +        if (qrCode != null) { 
 +            qrCode.show(); 
 +            qrCode.attr("src", "/aducid-resources/img/running.gif"); 
 +        
 +    } 
 +     
 +Stop animation 
 +    aducid.stopRunningAnimation = function() { 
 +        if (qrCode == null) return; 
 +        qrCode.hide(); 
 +    } 
 + 
 + 
 +This method controll progress bar animation. See aducid-api.js 
 +   this.startProgressBar = function(animationTime) { 
 +   } 
 + 
 + 
 +Hide QR timer progress bar 
 +    aducid.hideProgressBar = function() { 
 +        if (qrTimer == null) return; 
 +        qrTimer.hide(); 
 +        qrTimer.html(""); 
 +    } 
 + 
 +How errors are treated - use nice dialogues here 
 +    aducid.handleError = function(e) { 
 +        alert(e); 
 +    } 
 + 
 +