android - Citrus 付款重定向网址不起作用

原文 标签 android payment-gateway citrus-pay

我正在将柑橘支付集成到 android 应用程序中,在我的交易成功之前,一切都在沙盒中运行良好,但是一旦我的交易成功,我会得到以下日志:

enter image description here

MOTO SUCCESSFUL***{"txMsg":"交易成功","pgRespCode":"0","re​​directUrl":"https://sandbox.citruspay.com/mpiServlet/715259413249776a736d6a62546c5a413247745871773d3d"}

这表示交易成功,我可以在我的沙盒消费者帐户中看到交易成功,但是当它重定向到日志中的上述 url 时,它显示如下屏幕:

enter image description here

当我尝试按下后退按钮时:

没有办法达到我在应用程序中的最后一个 Activity 我试图将返回 url 放在应用程序中:private static final String RETURN_URL = "http://my.app";

这应该返回到我的 Activity 但没有帮助,任何帮助或提示将不胜感激。

enter image description here

最佳答案

我通过发送托管在我的服务器本身上的返回页面 url 解决了问题,如下所示:

 <?php    
 $access_key = "xxxx"; //put your own access_key - found in admin panel     
 $secret_key = "xxxxx"; //put your own secret_key - found in admin panel     
 $return_url = "http://xxxxx/Citrus/return_page.php"; //put your own return_url.php here.    
 $txn_id = time() . rand(10000,99999);    
 $value = $_GET["amount"]; //Charge amount is in INR by default    
 $data_string = "merchantAccessKey=" . $access_key
               . "&transactionId="  . $txn_id          
              . "&amount="         . $value;    
 $signature = hash_hmac('sha1', $data_string, $secret_key);    
 $amount = array('value' => $value, 'currency' => 'INR');    
 $bill = array('merchantTxnId' => $txn_id,      
               'amount' => $amount,        
               'requestSignature' => $signature,         
               'merchantAccessKey' => $access_key,        
               'returnUrl' => $return_url);     echo json_encode($bill);   ?>   

并返回 url 显示消息成功交易并返回 Activity ! .
<html>    
<head>    
<script type="text/javascript">     
var globaldata;      
function setdata(data) {          
globaldata = data;      
}      
function postResponseiOS() {          
return globaldata;      
}      
function postResponse(data) {          
CitrusResponse.pgResponse(data);      }    
</script>     
</head>     
<body>     
</body>     
</html>                
<?php                    
$secret_key = "xxxxx";     
$data =array();     
foreach ($_POST as $name => $value) {                   
 $data[$name] = $value;                   
}     
   $verification_data =  $data['TxId']                        
                        . $data['TxStatus']                        
                        . $data['amount']                        
                        . $data['pgTxnNo']                        
                        . $data['issuerRefNo']                        
                        . $data['authIdCode']                        
                        . $data['firstName']                        
                        . $data['lastName']                        
                        . $data['pgRespCode']                        
                        . $data['addressZip'];     
$signature = hash_hmac('sha1', $verification_data, $secret_key);     
  if ($signature == $data['signature'])  
    {                                                 
      $json_object = json_encode($data);                                                
      echo "<script> 
      postResponse('$json_object'); 
      </script>";                                               
      echo"<script> setdata ('$json_object');
      </script>";                                             
    }                                           
  else {                                               
     $response_data = array("Error" => "Transaction Failed",
     "Reason" => "Signature Verification Failed");                                              
 $json_object = json_encode($response_data);                                                
 echo "
 <script> 
 postResponse('$json_object'); 
 </script>";            
 echo"
 <script> 
 setdata ('$json_object'); 
 </script>";                                          
 }      
?>      

关于android - Citrus 付款重定向网址不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33797376/

相关文章:

android - 如何在 Android 应用程序中集成 TEST PayU 支付网关?

ios - dyld:库未加载:@ rpath/JSONModel.framework/JSONModel

encoding - www.paypal.com/jp/cgi-bin/webscr? item_name 编码

android - 为视差滚动添加粘性标题 - android

android - Eclipse/Android SDK的XML问题

android - 不同屏幕上的Android字体大小

paypal - 我使用哪个URL在SagePay模拟器上“完成” PayPal交易?

ios - 在 IOS 中查找柑橘支付集成中的问题

Android:检查多个项目ListView