xieruidong 2 年之前
父节点
当前提交
127e591baa

+ 1 - 1
application/common/library/upacp_demo_b2b/demo/api_02_b2b/Form_6_2_FrontConsume.php

@@ -78,4 +78,4 @@ $params = array(
 com\unionpay\acp\sdk\AcpService::sign ( $params );
 $uri = com\unionpay\acp\sdk\SDKConfig::getSDKConfig()->frontTransUrl;
 $html_form = com\unionpay\acp\sdk\AcpService::createAutoFormHtml( $params, $uri );
-//echo $html_form;
+echo $html_form;

+ 19 - 19
application/common/library/upacp_demo_b2b/index_02_b2b.php

@@ -1,38 +1,38 @@
 <!doctype html>
 <html lang="en">
 
-<!-- 
+<!--
 
   借地写说明:
   jquery-ui的说明参考:http://www.runoob.com/jqueryui/jqueryui-tutorial.html
   jquery的说明参考:http://www.w3school.com.cn/jquery/index.asp
-  
+
   tabs-api为横向的标签,下面定义的div比如tabs-purchase是竖向的标签,按已有的往下添加,名字别重复就行。
-  
+
   新增横向标签:
   1. <div id="tabs-api"><ul><li>下面新加个a标签,指向一个锚点。
   2. 上一条的<ul>同级别下新加一个<div>,id使用上一条锚点指定的id。
-  
+
   新增纵向标签:
   1. js加一行,设置纵向标签的参数。
   2. 总之参考已有的样例吧。
-  
+
 -->
 
 <head>
   <meta charset="utf-8">
   <title>b2b产品示例</title>
-  <link rel="stylesheet" href="static/jquery-ui.min.css">
-  <script src="static/jquery-1.11.2.min.js"></script>
-  <script src="static/jquery-ui.min.js"></script>
-  <script src="static/demo.js"></script>
+  <link rel="stylesheet" href="/static/jquery-ui.min.css">
+  <script src="/static/jquery-1.11.2.min.js"></script>
+  <script src="/static/jquery-ui.min.js"></script>
+  <script src="/static/demo.js"></script>
   <script>
   	$(function() {
 	    setApiDemoTabs("#tabs-purchase");
 	    setApiDemoTabs("#tabs-preauth");
 	  });
   </script>
-  <link rel="stylesheet" href="static/demo.css">
+  <link rel="stylesheet" href="/static/demo.css">
 
 </head>
 <body style="background-color:#e5eecc;">
@@ -49,15 +49,15 @@
     <li><a href="#tabs-api-2">消费样例</a></li>
     <li><a href="#tabs-api-4">常见开发问题</a></li>
   </ul>
-  
+
   <div id="tabs-api-1">
-    <?php include 'pages/api_02_b2b/introduction.php';?>
+    <?php include __DIR__.'/pages/api_02_b2b/introduction.php';?>
   </div>
-  
+
   <div id="tabs-api-4">
-    <?php include 'pages/dev_faq.php';?>
+    <?php include __DIR__.'/pages/dev_faq.php';?>
   </div>
-  
+
   <div id="tabs-api-2">
 	<div id="tabs-purchase">
 	  <ul>
@@ -68,13 +68,13 @@
 		<li><a href="pages/api_02_b2b/file_transfer.php">对账文件下载</a></li>
 	  </ul>
 	  <div id="tabs-purchase-1">
-	     <?php include 'pages/api_02_b2b/consume_intro.php';?>
+	     <?php include __DIR__.'/pages/api_02_b2b/consume_intro.php';?>
 	  </div>
 	</div>
   </div>
   </div> <!-- end of tabs-api-->
 </div><!-- end of wrapper-->
- 
- 
+
+
 </body>
-</html>
+</html>

+ 1 - 1
application/common/library/upacp_demo_b2b/pages/dev_faq.php

@@ -13,5 +13,5 @@
 </p>
 
 <hr />
-<?php include $_SERVER ['DOCUMENT_ROOT'] . '/upacp_demo_b2b/pages/more_faq.php';?>
+<?php include __DIR__. '/../pages/more_faq.php';?>
 

+ 15 - 15
application/common/library/upacp_demo_b2b/sdk/common.php

@@ -96,7 +96,7 @@ function putKeyValueToDictionary($temp, $isKey, $key, &$result, $needUrlDecode)
 
 /**
  * 取得备份文件名
- * 
+ *
  * Enter description here ...
  * @param $path
  */
@@ -121,7 +121,7 @@ function convertStringToArray($str) {
 /**
  * 压缩文件 对应java deflate
  *
- * @param unknown_type $params        	
+ * @param unknown_type $params
  */
 function deflate_file(&$params) {
 	$logger = LogUtil::getLogger();
@@ -129,10 +129,10 @@ function deflate_file(&$params) {
 		$logger->LogInfo ( "---------处理文件---------" );
 		if (file_exists ( $file ['tmp_name'] )) {
 			$params ['fileName'] = $file ['name'];
-			
+
 			$file_content = file_get_contents ( $file ['tmp_name'] );
 			$file_content_deflate = gzcompress ( $file_content );
-			
+
 			$params ['fileContent'] = base64_encode ( $file_content_deflate );
 			$logger->LogInfo ( "压缩后文件内容为>" . base64_encode ( $file_content_deflate ) );
 		} else {
@@ -145,28 +145,28 @@ function deflate_file(&$params) {
 /**
  * 讲数组转换为string
  *
- * @param $para 数组        	
- * @param $sort 是否需要排序        	
- * @param $encode 是否需要URL编码        	
+ * @param $para 数组
+ * @param $sort 是否需要排序
+ * @param $encode 是否需要URL编码
  * @return string
  */
 function createLinkString($para, $sort, $encode) {
 	if($para == NULL || !is_array($para))
 		return "";
-	
+
 	$linkString = "";
 	if ($sort) {
 		$para = argSort ( $para );
 	}
-	while ( list ( $key, $value ) = each ( $para ) ) {
-		if ($encode) {
-			$value = urlencode ( $value );
-		}
-		$linkString .= $key . "=" . $value . "&";
-	}
+    foreach ($para as $key=>$value){
+        if ($encode) {
+            $value = urlencode ( $value );
+        }
+        $linkString .= $key . "=" . $value . "&";
+    }
 	// 去掉最后一个&字符
 	$linkString = substr ( $linkString, 0, -1 );
-	
+
 	return $linkString;
 }
 

+ 3 - 0
application/index/controller/Index.php

@@ -38,4 +38,7 @@ class Index extends Frontend
         //dd(MobileComputer::setMobile(input('no'))->filter());
         dd($this->request->root(true));
     }
+    public function uni(){
+        require ROOT_PATH.'application/common/library/upacp_demo_b2b/index_02_b2b.php';
+    }
 }