2016-07-20 39 views

回答

0

Iframe解決方案不適用於https鏈接。

需要使用ccavenue mobile integration KIT提供的RSA密鑰加密方法。

使用php的非無縫移動套件集成。

在應用程序中添加inappbrowser以可視化ccavenue響應。

$ cordova plugin add cordova-plugin-inappbrowser 

安裝成功後寫在控制器下面的代碼 -

$scope.data = { 
    orderId: 1, 
    amount: 1, 
}; 

$scope.ref = null; 
$scope.getStateSecondWindow = function() 
{ 
    $scope.ref.executeScript(
     {code: "localStorage.getItem('isCloseSelf')"}, 
     function(data) 
     { 
      if (data == 'yes') 
      { 
       $scope.ref.close(); 
      } 
     } 
    ); 
} 
$scope.onSubmit = function(){ 
    $scope.ref = window.open(CONFIG.BASE_URL + 'getRSA.php?orderId=' +  $scope.data.orderId + '&amount=' + $scope.data.amount,'_blank','location=no'); 
    $scope.ref.addEventListener('loadstart', function(event) { }); 
    $scope.ref.addEventListener('loadstop', function(event) { 
    setInterval($scope.getStateSecondWindow, 5000); 
    }); 
    $scope.ref.addEventListener('exit', function(event) { }); 
} 

請參考鏈接PHP代碼:https://github.com/manjitlatthe/ionic-php-ccavenue-integration