skyfffire hace 1 semana
padre
commit
04b25db8cc
Se han modificado 34 ficheros con 0 adiciones y 1906 borrados
  1. 0 22
      src/main/java/common/utils/tl/h5_demo/java/h5demo/WebContent/WEB-INF/web.xml
  2. 0 841
      src/main/java/common/utils/tl/h5_demo/java/h5demo/WebContent/js/fastclick.js
  3. 0 3
      src/main/java/common/utils/tl/h5_demo/java/h5demo/WebContent/js/jquery.min.js
  4. 0 28
      src/main/java/common/utils/tl/h5_demo/java/h5demo/WebContent/js/jquery.qrcode.min.js
  5. 0 64
      src/main/java/common/utils/tl/h5_demo/java/h5demo/WebContent/pay.html
  6. 0 49
      src/main/java/common/utils/tl/h5_demo/java/h5demo/WebContent/qrcodedemo.jsp
  7. 0 75
      src/main/java/common/utils/tl/h5_demo/java/h5demo/WebContent/sendpay.jsp
  8. BIN
      src/main/java/common/utils/tl/h5_demo/java/h5demo/bin/com/allinpay/syb/lib/HttpConnectionUtil$1.class
  9. BIN
      src/main/java/common/utils/tl/h5_demo/java/h5demo/bin/com/allinpay/syb/lib/HttpConnectionUtil.class
  10. BIN
      src/main/java/common/utils/tl/h5_demo/java/h5demo/bin/com/allinpay/syb/lib/SSLUtil.class
  11. BIN
      src/main/java/common/utils/tl/h5_demo/java/h5demo/bin/com/allinpay/syb/lib/SmUtil.class
  12. BIN
      src/main/java/common/utils/tl/h5_demo/java/h5demo/bin/com/allinpay/syb/lib/SybConstants.class
  13. BIN
      src/main/java/common/utils/tl/h5_demo/java/h5demo/bin/com/allinpay/syb/lib/SybPayService.class
  14. BIN
      src/main/java/common/utils/tl/h5_demo/java/h5demo/bin/com/allinpay/syb/lib/SybUtil.class
  15. BIN
      src/main/java/common/utils/tl/h5_demo/java/h5demo/bin/com/allinpay/syb/test/ApiTestV2.class
  16. BIN
      src/main/java/common/utils/tl/h5_demo/java/h5demo/bin/com/allinpay/syb/test/NotifyServlet.class
  17. 0 124
      src/main/java/common/utils/tl/h5_demo/java/h5demo/src/com/allinpay/syb/lib/HttpConnectionUtil.java
  18. 0 54
      src/main/java/common/utils/tl/h5_demo/java/h5demo/src/com/allinpay/syb/lib/SSLUtil.java
  19. 0 138
      src/main/java/common/utils/tl/h5_demo/java/h5demo/src/com/allinpay/syb/lib/SmUtil.java
  20. 0 39
      src/main/java/common/utils/tl/h5_demo/java/h5demo/src/com/allinpay/syb/lib/SybConstants.java
  21. 0 124
      src/main/java/common/utils/tl/h5_demo/java/h5demo/src/com/allinpay/syb/lib/SybPayService.java
  22. 0 230
      src/main/java/common/utils/tl/h5_demo/java/h5demo/src/com/allinpay/syb/lib/SybUtil.java
  23. 0 47
      src/main/java/common/utils/tl/h5_demo/java/h5demo/src/com/allinpay/syb/test/ApiTestV2.java
  24. 0 68
      src/main/java/common/utils/tl/h5_demo/java/h5demo/src/com/allinpay/syb/test/NotifyServlet.java
  25. BIN
      src/main/java/common/utils/tl/h5_demo/java_com_lib/bcpkix-jdk15on-1.59.jar
  26. BIN
      src/main/java/common/utils/tl/h5_demo/java_com_lib/bcprov-ext-jdk15on-1.59.jar
  27. BIN
      src/main/java/common/utils/tl/h5_demo/java_com_lib/bcprov-jdk15on-1.59.jar
  28. BIN
      src/main/java/common/utils/tl/h5_demo/java_com_lib/commons-beanutils-1.8.3.jar
  29. BIN
      src/main/java/common/utils/tl/h5_demo/java_com_lib/commons-codec-1.11.jar
  30. BIN
      src/main/java/common/utils/tl/h5_demo/java_com_lib/commons-collections-3.2.1.jar
  31. BIN
      src/main/java/common/utils/tl/h5_demo/java_com_lib/commons-lang-2.6.jar
  32. BIN
      src/main/java/common/utils/tl/h5_demo/java_com_lib/commons-logging-1.1.3.jar
  33. BIN
      src/main/java/common/utils/tl/h5_demo/java_com_lib/ezmorph-1.0.6.jar
  34. BIN
      src/main/java/common/utils/tl/h5_demo/java_com_lib/json-lib-2.4-jdk15.jar

+ 0 - 22
src/main/java/common/utils/tl/h5_demo/java/h5demo/WebContent/WEB-INF/web.xml

@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
-  <display-name>wxpaydemo</display-name>
-  <welcome-file-list>
-    <welcome-file>index.html</welcome-file>
-    <welcome-file>index.htm</welcome-file>
-    <welcome-file>index.jsp</welcome-file>
-    <welcome-file>default.html</welcome-file>
-    <welcome-file>default.htm</welcome-file>
-    <welcome-file>default.jsp</welcome-file>
-  </welcome-file-list>
-    <servlet>
-    <description></description>
-    <display-name>NotifyServlet</display-name>
-    <servlet-name>NotifyServlet</servlet-name>
-    <servlet-class>com.allinpay.syb.test.NotifyServlet</servlet-class>
-  </servlet>
-  <servlet-mapping>
-    <servlet-name>NotifyServlet</servlet-name>
-    <url-pattern>/NotifyServlet</url-pattern>
-  </servlet-mapping>
-</web-app>

+ 0 - 841
src/main/java/common/utils/tl/h5_demo/java/h5demo/WebContent/js/fastclick.js

@@ -1,841 +0,0 @@
-;(function () {
-	'use strict';
-
-	/**
-	 * @preserve FastClick: polyfill to remove click delays on browsers with touch UIs.
-	 *
-	 * @codingstandard ftlabs-jsv2
-	 * @copyright The Financial Times Limited [All Rights Reserved]
-	 * @license MIT License (see LICENSE.txt)
-	 */
-
-	/*jslint browser:true, node:true*/
-	/*global define, Event, Node*/
-
-
-	/**
-	 * Instantiate fast-clicking listeners on the specified layer.
-	 *
-	 * @constructor
-	 * @param {Element} layer The layer to listen on
-	 * @param {Object} [options={}] The options to override the defaults
-	 */
-	function FastClick(layer, options) {
-		var oldOnClick;
-
-		options = options || {};
-
-		/**
-		 * Whether a click is currently being tracked.
-		 *
-		 * @type boolean
-		 */
-		this.trackingClick = false;
-
-
-		/**
-		 * Timestamp for when click tracking started.
-		 *
-		 * @type number
-		 */
-		this.trackingClickStart = 0;
-
-
-		/**
-		 * The element being tracked for a click.
-		 *
-		 * @type EventTarget
-		 */
-		this.targetElement = null;
-
-
-		/**
-		 * X-coordinate of touch start event.
-		 *
-		 * @type number
-		 */
-		this.touchStartX = 0;
-
-
-		/**
-		 * Y-coordinate of touch start event.
-		 *
-		 * @type number
-		 */
-		this.touchStartY = 0;
-
-
-		/**
-		 * ID of the last touch, retrieved from Touch.identifier.
-		 *
-		 * @type number
-		 */
-		this.lastTouchIdentifier = 0;
-
-
-		/**
-		 * Touchmove boundary, beyond which a click will be cancelled.
-		 *
-		 * @type number
-		 */
-		this.touchBoundary = options.touchBoundary || 10;
-
-
-		/**
-		 * The FastClick layer.
-		 *
-		 * @type Element
-		 */
-		this.layer = layer;
-
-		/**
-		 * The minimum time between tap(touchstart and touchend) events
-		 *
-		 * @type number
-		 */
-		this.tapDelay = options.tapDelay || 200;
-
-		/**
-		 * The maximum time for a tap
-		 *
-		 * @type number
-		 */
-		this.tapTimeout = options.tapTimeout || 700;
-
-		if (FastClick.notNeeded(layer)) {
-			return;
-		}
-
-		// Some old versions of Android don't have Function.prototype.bind
-		function bind(method, context) {
-			return function() { return method.apply(context, arguments); };
-		}
-
-
-		var methods = ['onMouse', 'onClick', 'onTouchStart', 'onTouchMove', 'onTouchEnd', 'onTouchCancel'];
-		var context = this;
-		for (var i = 0, l = methods.length; i < l; i++) {
-			context[methods[i]] = bind(context[methods[i]], context);
-		}
-
-		// Set up event handlers as required
-		if (deviceIsAndroid) {
-			layer.addEventListener('mouseover', this.onMouse, true);
-			layer.addEventListener('mousedown', this.onMouse, true);
-			layer.addEventListener('mouseup', this.onMouse, true);
-		}
-
-		layer.addEventListener('click', this.onClick, true);
-		layer.addEventListener('touchstart', this.onTouchStart, false);
-		layer.addEventListener('touchmove', this.onTouchMove, false);
-		layer.addEventListener('touchend', this.onTouchEnd, false);
-		layer.addEventListener('touchcancel', this.onTouchCancel, false);
-
-		// Hack is required for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2)
-		// which is how FastClick normally stops click events bubbling to callbacks registered on the FastClick
-		// layer when they are cancelled.
-		if (!Event.prototype.stopImmediatePropagation) {
-			layer.removeEventListener = function(type, callback, capture) {
-				var rmv = Node.prototype.removeEventListener;
-				if (type === 'click') {
-					rmv.call(layer, type, callback.hijacked || callback, capture);
-				} else {
-					rmv.call(layer, type, callback, capture);
-				}
-			};
-
-			layer.addEventListener = function(type, callback, capture) {
-				var adv = Node.prototype.addEventListener;
-				if (type === 'click') {
-					adv.call(layer, type, callback.hijacked || (callback.hijacked = function(event) {
-						if (!event.propagationStopped) {
-							callback(event);
-						}
-					}), capture);
-				} else {
-					adv.call(layer, type, callback, capture);
-				}
-			};
-		}
-
-		// If a handler is already declared in the element's onclick attribute, it will be fired before
-		// FastClick's onClick handler. Fix this by pulling out the user-defined handler function and
-		// adding it as listener.
-		if (typeof layer.onclick === 'function') {
-
-			// Android browser on at least 3.2 requires a new reference to the function in layer.onclick
-			// - the old one won't work if passed to addEventListener directly.
-			oldOnClick = layer.onclick;
-			layer.addEventListener('click', function(event) {
-				oldOnClick(event);
-			}, false);
-			layer.onclick = null;
-		}
-	}
-
-	/**
-	* Windows Phone 8.1 fakes user agent string to look like Android and iPhone.
-	*
-	* @type boolean
-	*/
-	var deviceIsWindowsPhone = navigator.userAgent.indexOf("Windows Phone") >= 0;
-
-	/**
-	 * Android requires exceptions.
-	 *
-	 * @type boolean
-	 */
-	var deviceIsAndroid = navigator.userAgent.indexOf('Android') > 0 && !deviceIsWindowsPhone;
-
-
-	/**
-	 * iOS requires exceptions.
-	 *
-	 * @type boolean
-	 */
-	var deviceIsIOS = /iP(ad|hone|od)/.test(navigator.userAgent) && !deviceIsWindowsPhone;
-
-
-	/**
-	 * iOS 4 requires an exception for select elements.
-	 *
-	 * @type boolean
-	 */
-	var deviceIsIOS4 = deviceIsIOS && (/OS 4_\d(_\d)?/).test(navigator.userAgent);
-
-
-	/**
-	 * iOS 6.0-7.* requires the target element to be manually derived
-	 *
-	 * @type boolean
-	 */
-	var deviceIsIOSWithBadTarget = deviceIsIOS && (/OS [6-7]_\d/).test(navigator.userAgent);
-
-	/**
-	 * BlackBerry requires exceptions.
-	 *
-	 * @type boolean
-	 */
-	var deviceIsBlackBerry10 = navigator.userAgent.indexOf('BB10') > 0;
-
-	/**
-	 * Determine whether a given element requires a native click.
-	 *
-	 * @param {EventTarget|Element} target Target DOM element
-	 * @returns {boolean} Returns true if the element needs a native click
-	 */
-	FastClick.prototype.needsClick = function(target) {
-		switch (target.nodeName.toLowerCase()) {
-
-		// Don't send a synthetic click to disabled inputs (issue #62)
-		case 'button':
-		case 'select':
-		case 'textarea':
-			if (target.disabled) {
-				return true;
-			}
-
-			break;
-		case 'input':
-
-			// File inputs need real clicks on iOS 6 due to a browser bug (issue #68)
-			if ((deviceIsIOS && target.type === 'file') || target.disabled) {
-				return true;
-			}
-
-			break;
-		case 'label':
-		case 'iframe': // iOS8 homescreen apps can prevent events bubbling into frames
-		case 'video':
-			return true;
-		}
-
-		return (/\bneedsclick\b/).test(target.className);
-	};
-
-
-	/**
-	 * Determine whether a given element requires a call to focus to simulate click into element.
-	 *
-	 * @param {EventTarget|Element} target Target DOM element
-	 * @returns {boolean} Returns true if the element requires a call to focus to simulate native click.
-	 */
-	FastClick.prototype.needsFocus = function(target) {
-		switch (target.nodeName.toLowerCase()) {
-		case 'textarea':
-			return true;
-		case 'select':
-			return !deviceIsAndroid;
-		case 'input':
-			switch (target.type) {
-			case 'button':
-			case 'checkbox':
-			case 'file':
-			case 'image':
-			case 'radio':
-			case 'submit':
-				return false;
-			}
-
-			// No point in attempting to focus disabled inputs
-			return !target.disabled && !target.readOnly;
-		default:
-			return (/\bneedsfocus\b/).test(target.className);
-		}
-	};
-
-
-	/**
-	 * Send a click event to the specified element.
-	 *
-	 * @param {EventTarget|Element} targetElement
-	 * @param {Event} event
-	 */
-	FastClick.prototype.sendClick = function(targetElement, event) {
-		var clickEvent, touch;
-
-		// On some Android devices activeElement needs to be blurred otherwise the synthetic click will have no effect (#24)
-		if (document.activeElement && document.activeElement !== targetElement) {
-			document.activeElement.blur();
-		}
-
-		touch = event.changedTouches[0];
-
-		// Synthesise a click event, with an extra attribute so it can be tracked
-		clickEvent = document.createEvent('MouseEvents');
-		clickEvent.initMouseEvent(this.determineEventType(targetElement), true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null);
-		clickEvent.forwardedTouchEvent = true;
-		targetElement.dispatchEvent(clickEvent);
-	};
-
-	FastClick.prototype.determineEventType = function(targetElement) {
-
-		//Issue #159: Android Chrome Select Box does not open with a synthetic click event
-		if (deviceIsAndroid && targetElement.tagName.toLowerCase() === 'select') {
-			return 'mousedown';
-		}
-
-		return 'click';
-	};
-
-
-	/**
-	 * @param {EventTarget|Element} targetElement
-	 */
-	FastClick.prototype.focus = function(targetElement) {
-		var length;
-
-		// Issue #160: on iOS 7, some input elements (e.g. date datetime month) throw a vague TypeError on setSelectionRange. These elements don't have an integer value for the selectionStart and selectionEnd properties, but unfortunately that can't be used for detection because accessing the properties also throws a TypeError. Just check the type instead. Filed as Apple bug #15122724.
-		if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month') {
-			length = targetElement.value.length;
-			targetElement.setSelectionRange(length, length);
-		} else {
-			targetElement.focus();
-		}
-	};
-
-
-	/**
-	 * Check whether the given target element is a child of a scrollable layer and if so, set a flag on it.
-	 *
-	 * @param {EventTarget|Element} targetElement
-	 */
-	FastClick.prototype.updateScrollParent = function(targetElement) {
-		var scrollParent, parentElement;
-
-		scrollParent = targetElement.fastClickScrollParent;
-
-		// Attempt to discover whether the target element is contained within a scrollable layer. Re-check if the
-		// target element was moved to another parent.
-		if (!scrollParent || !scrollParent.contains(targetElement)) {
-			parentElement = targetElement;
-			do {
-				if (parentElement.scrollHeight > parentElement.offsetHeight) {
-					scrollParent = parentElement;
-					targetElement.fastClickScrollParent = parentElement;
-					break;
-				}
-
-				parentElement = parentElement.parentElement;
-			} while (parentElement);
-		}
-
-		// Always update the scroll top tracker if possible.
-		if (scrollParent) {
-			scrollParent.fastClickLastScrollTop = scrollParent.scrollTop;
-		}
-	};
-
-
-	/**
-	 * @param {EventTarget} targetElement
-	 * @returns {Element|EventTarget}
-	 */
-	FastClick.prototype.getTargetElementFromEventTarget = function(eventTarget) {
-
-		// On some older browsers (notably Safari on iOS 4.1 - see issue #56) the event target may be a text node.
-		if (eventTarget.nodeType === Node.TEXT_NODE) {
-			return eventTarget.parentNode;
-		}
-
-		return eventTarget;
-	};
-
-
-	/**
-	 * On touch start, record the position and scroll offset.
-	 *
-	 * @param {Event} event
-	 * @returns {boolean}
-	 */
-	FastClick.prototype.onTouchStart = function(event) {
-		var targetElement, touch, selection;
-
-		// Ignore multiple touches, otherwise pinch-to-zoom is prevented if both fingers are on the FastClick element (issue #111).
-		if (event.targetTouches.length > 1) {
-			return true;
-		}
-
-		targetElement = this.getTargetElementFromEventTarget(event.target);
-		touch = event.targetTouches[0];
-
-		if (deviceIsIOS) {
-
-			// Only trusted events will deselect text on iOS (issue #49)
-			selection = window.getSelection();
-			if (selection.rangeCount && !selection.isCollapsed) {
-				return true;
-			}
-
-			if (!deviceIsIOS4) {
-
-				// Weird things happen on iOS when an alert or confirm dialog is opened from a click event callback (issue #23):
-				// when the user next taps anywhere else on the page, new touchstart and touchend events are dispatched
-				// with the same identifier as the touch event that previously triggered the click that triggered the alert.
-				// Sadly, there is an issue on iOS 4 that causes some normal touch events to have the same identifier as an
-				// immediately preceeding touch event (issue #52), so this fix is unavailable on that platform.
-				// Issue 120: touch.identifier is 0 when Chrome dev tools 'Emulate touch events' is set with an iOS device UA string,
-				// which causes all touch events to be ignored. As this block only applies to iOS, and iOS identifiers are always long,
-				// random integers, it's safe to to continue if the identifier is 0 here.
-				if (touch.identifier && touch.identifier === this.lastTouchIdentifier) {
-					event.preventDefault();
-					return false;
-				}
-
-				this.lastTouchIdentifier = touch.identifier;
-
-				// If the target element is a child of a scrollable layer (using -webkit-overflow-scrolling: touch) and:
-				// 1) the user does a fling scroll on the scrollable layer
-				// 2) the user stops the fling scroll with another tap
-				// then the event.target of the last 'touchend' event will be the element that was under the user's finger
-				// when the fling scroll was started, causing FastClick to send a click event to that layer - unless a check
-				// is made to ensure that a parent layer was not scrolled before sending a synthetic click (issue #42).
-				this.updateScrollParent(targetElement);
-			}
-		}
-
-		this.trackingClick = true;
-		this.trackingClickStart = event.timeStamp;
-		this.targetElement = targetElement;
-
-		this.touchStartX = touch.pageX;
-		this.touchStartY = touch.pageY;
-
-		// Prevent phantom clicks on fast double-tap (issue #36)
-		if ((event.timeStamp - this.lastClickTime) < this.tapDelay) {
-			event.preventDefault();
-		}
-
-		return true;
-	};
-
-
-	/**
-	 * Based on a touchmove event object, check whether the touch has moved past a boundary since it started.
-	 *
-	 * @param {Event} event
-	 * @returns {boolean}
-	 */
-	FastClick.prototype.touchHasMoved = function(event) {
-		var touch = event.changedTouches[0], boundary = this.touchBoundary;
-
-		if (Math.abs(touch.pageX - this.touchStartX) > boundary || Math.abs(touch.pageY - this.touchStartY) > boundary) {
-			return true;
-		}
-
-		return false;
-	};
-
-
-	/**
-	 * Update the last position.
-	 *
-	 * @param {Event} event
-	 * @returns {boolean}
-	 */
-	FastClick.prototype.onTouchMove = function(event) {
-		if (!this.trackingClick) {
-			return true;
-		}
-
-		// If the touch has moved, cancel the click tracking
-		if (this.targetElement !== this.getTargetElementFromEventTarget(event.target) || this.touchHasMoved(event)) {
-			this.trackingClick = false;
-			this.targetElement = null;
-		}
-
-		return true;
-	};
-
-
-	/**
-	 * Attempt to find the labelled control for the given label element.
-	 *
-	 * @param {EventTarget|HTMLLabelElement} labelElement
-	 * @returns {Element|null}
-	 */
-	FastClick.prototype.findControl = function(labelElement) {
-
-		// Fast path for newer browsers supporting the HTML5 control attribute
-		if (labelElement.control !== undefined) {
-			return labelElement.control;
-		}
-
-		// All browsers under test that support touch events also support the HTML5 htmlFor attribute
-		if (labelElement.htmlFor) {
-			return document.getElementById(labelElement.htmlFor);
-		}
-
-		// If no for attribute exists, attempt to retrieve the first labellable descendant element
-		// the list of which is defined here: http://www.w3.org/TR/html5/forms.html#category-label
-		return labelElement.querySelector('button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea');
-	};
-
-
-	/**
-	 * On touch end, determine whether to send a click event at once.
-	 *
-	 * @param {Event} event
-	 * @returns {boolean}
-	 */
-	FastClick.prototype.onTouchEnd = function(event) {
-		var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement;
-
-		if (!this.trackingClick) {
-			return true;
-		}
-
-		// Prevent phantom clicks on fast double-tap (issue #36)
-		if ((event.timeStamp - this.lastClickTime) < this.tapDelay) {
-			this.cancelNextClick = true;
-			return true;
-		}
-
-		if ((event.timeStamp - this.trackingClickStart) > this.tapTimeout) {
-			return true;
-		}
-
-		// Reset to prevent wrong click cancel on input (issue #156).
-		this.cancelNextClick = false;
-
-		this.lastClickTime = event.timeStamp;
-
-		trackingClickStart = this.trackingClickStart;
-		this.trackingClick = false;
-		this.trackingClickStart = 0;
-
-		// On some iOS devices, the targetElement supplied with the event is invalid if the layer
-		// is performing a transition or scroll, and has to be re-detected manually. Note that
-		// for this to function correctly, it must be called *after* the event target is checked!
-		// See issue #57; also filed as rdar://13048589 .
-		if (deviceIsIOSWithBadTarget) {
-			touch = event.changedTouches[0];
-
-			// In certain cases arguments of elementFromPoint can be negative, so prevent setting targetElement to null
-			targetElement = document.elementFromPoint(touch.pageX - window.pageXOffset, touch.pageY - window.pageYOffset) || targetElement;
-			targetElement.fastClickScrollParent = this.targetElement.fastClickScrollParent;
-		}
-
-		targetTagName = targetElement.tagName.toLowerCase();
-		if (targetTagName === 'label') {
-			forElement = this.findControl(targetElement);
-			if (forElement) {
-				this.focus(targetElement);
-				if (deviceIsAndroid) {
-					return false;
-				}
-
-				targetElement = forElement;
-			}
-		} else if (this.needsFocus(targetElement)) {
-
-			// Case 1: If the touch started a while ago (best guess is 100ms based on tests for issue #36) then focus will be triggered anyway. Return early and unset the target element reference so that the subsequent click will be allowed through.
-			// Case 2: Without this exception for input elements tapped when the document is contained in an iframe, then any inputted text won't be visible even though the value attribute is updated as the user types (issue #37).
-			if ((event.timeStamp - trackingClickStart) > 100 || (deviceIsIOS && window.top !== window && targetTagName === 'input')) {
-				this.targetElement = null;
-				return false;
-			}
-
-			this.focus(targetElement);
-			this.sendClick(targetElement, event);
-
-			// Select elements need the event to go through on iOS 4, otherwise the selector menu won't open.
-			// Also this breaks opening selects when VoiceOver is active on iOS6, iOS7 (and possibly others)
-			if (!deviceIsIOS || targetTagName !== 'select') {
-				this.targetElement = null;
-				event.preventDefault();
-			}
-
-			return false;
-		}
-
-		if (deviceIsIOS && !deviceIsIOS4) {
-
-			// Don't send a synthetic click event if the target element is contained within a parent layer that was scrolled
-			// and this tap is being used to stop the scrolling (usually initiated by a fling - issue #42).
-			scrollParent = targetElement.fastClickScrollParent;
-			if (scrollParent && scrollParent.fastClickLastScrollTop !== scrollParent.scrollTop) {
-				return true;
-			}
-		}
-
-		// Prevent the actual click from going though - unless the target node is marked as requiring
-		// real clicks or if it is in the whitelist in which case only non-programmatic clicks are permitted.
-		if (!this.needsClick(targetElement)) {
-			event.preventDefault();
-			this.sendClick(targetElement, event);
-		}
-
-		return false;
-	};
-
-
-	/**
-	 * On touch cancel, stop tracking the click.
-	 *
-	 * @returns {void}
-	 */
-	FastClick.prototype.onTouchCancel = function() {
-		this.trackingClick = false;
-		this.targetElement = null;
-	};
-
-
-	/**
-	 * Determine mouse events which should be permitted.
-	 *
-	 * @param {Event} event
-	 * @returns {boolean}
-	 */
-	FastClick.prototype.onMouse = function(event) {
-
-		// If a target element was never set (because a touch event was never fired) allow the event
-		if (!this.targetElement) {
-			return true;
-		}
-
-		if (event.forwardedTouchEvent) {
-			return true;
-		}
-
-		// Programmatically generated events targeting a specific element should be permitted
-		if (!event.cancelable) {
-			return true;
-		}
-
-		// Derive and check the target element to see whether the mouse event needs to be permitted;
-		// unless explicitly enabled, prevent non-touch click events from triggering actions,
-		// to prevent ghost/doubleclicks.
-		if (!this.needsClick(this.targetElement) || this.cancelNextClick) {
-
-			// Prevent any user-added listeners declared on FastClick element from being fired.
-			if (event.stopImmediatePropagation) {
-				event.stopImmediatePropagation();
-			} else {
-
-				// Part of the hack for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2)
-				event.propagationStopped = true;
-			}
-
-			// Cancel the event
-			event.stopPropagation();
-			event.preventDefault();
-
-			return false;
-		}
-
-		// If the mouse event is permitted, return true for the action to go through.
-		return true;
-	};
-
-
-	/**
-	 * On actual clicks, determine whether this is a touch-generated click, a click action occurring
-	 * naturally after a delay after a touch (which needs to be cancelled to avoid duplication), or
-	 * an actual click which should be permitted.
-	 *
-	 * @param {Event} event
-	 * @returns {boolean}
-	 */
-	FastClick.prototype.onClick = function(event) {
-		var permitted;
-
-		// It's possible for another FastClick-like library delivered with third-party code to fire a click event before FastClick does (issue #44). In that case, set the click-tracking flag back to false and return early. This will cause onTouchEnd to return early.
-		if (this.trackingClick) {
-			this.targetElement = null;
-			this.trackingClick = false;
-			return true;
-		}
-
-		// Very odd behaviour on iOS (issue #18): if a submit element is present inside a form and the user hits enter in the iOS simulator or clicks the Go button on the pop-up OS keyboard the a kind of 'fake' click event will be triggered with the submit-type input element as the target.
-		if (event.target.type === 'submit' && event.detail === 0) {
-			return true;
-		}
-
-		permitted = this.onMouse(event);
-
-		// Only unset targetElement if the click is not permitted. This will ensure that the check for !targetElement in onMouse fails and the browser's click doesn't go through.
-		if (!permitted) {
-			this.targetElement = null;
-		}
-
-		// If clicks are permitted, return true for the action to go through.
-		return permitted;
-	};
-
-
-	/**
-	 * Remove all FastClick's event listeners.
-	 *
-	 * @returns {void}
-	 */
-	FastClick.prototype.destroy = function() {
-		var layer = this.layer;
-
-		if (deviceIsAndroid) {
-			layer.removeEventListener('mouseover', this.onMouse, true);
-			layer.removeEventListener('mousedown', this.onMouse, true);
-			layer.removeEventListener('mouseup', this.onMouse, true);
-		}
-
-		layer.removeEventListener('click', this.onClick, true);
-		layer.removeEventListener('touchstart', this.onTouchStart, false);
-		layer.removeEventListener('touchmove', this.onTouchMove, false);
-		layer.removeEventListener('touchend', this.onTouchEnd, false);
-		layer.removeEventListener('touchcancel', this.onTouchCancel, false);
-	};
-
-
-	/**
-	 * Check whether FastClick is needed.
-	 *
-	 * @param {Element} layer The layer to listen on
-	 */
-	FastClick.notNeeded = function(layer) {
-		var metaViewport;
-		var chromeVersion;
-		var blackberryVersion;
-		var firefoxVersion;
-
-		// Devices that don't support touch don't need FastClick
-		if (typeof window.ontouchstart === 'undefined') {
-			return true;
-		}
-
-		// Chrome version - zero for other browsers
-		chromeVersion = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1];
-
-		if (chromeVersion) {
-
-			if (deviceIsAndroid) {
-				metaViewport = document.querySelector('meta[name=viewport]');
-
-				if (metaViewport) {
-					// Chrome on Android with user-scalable="no" doesn't need FastClick (issue #89)
-					if (metaViewport.content.indexOf('user-scalable=no') !== -1) {
-						return true;
-					}
-					// Chrome 32 and above with width=device-width or less don't need FastClick
-					if (chromeVersion > 31 && document.documentElement.scrollWidth <= window.outerWidth) {
-						return true;
-					}
-				}
-
-			// Chrome desktop doesn't need FastClick (issue #15)
-			} else {
-				return true;
-			}
-		}
-
-		if (deviceIsBlackBerry10) {
-			blackberryVersion = navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/);
-
-			// BlackBerry 10.3+ does not require Fastclick library.
-			// https://github.com/ftlabs/fastclick/issues/251
-			if (blackberryVersion[1] >= 10 && blackberryVersion[2] >= 3) {
-				metaViewport = document.querySelector('meta[name=viewport]');
-
-				if (metaViewport) {
-					// user-scalable=no eliminates click delay.
-					if (metaViewport.content.indexOf('user-scalable=no') !== -1) {
-						return true;
-					}
-					// width=device-width (or less than device-width) eliminates click delay.
-					if (document.documentElement.scrollWidth <= window.outerWidth) {
-						return true;
-					}
-				}
-			}
-		}
-
-		// IE10 with -ms-touch-action: none or manipulation, which disables double-tap-to-zoom (issue #97)
-		if (layer.style.msTouchAction === 'none' || layer.style.touchAction === 'manipulation') {
-			return true;
-		}
-
-		// Firefox version - zero for other browsers
-		firefoxVersion = +(/Firefox\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1];
-
-		if (firefoxVersion >= 27) {
-			// Firefox 27+ does not have tap delay if the content is not zoomable - https://bugzilla.mozilla.org/show_bug.cgi?id=922896
-
-			metaViewport = document.querySelector('meta[name=viewport]');
-			if (metaViewport && (metaViewport.content.indexOf('user-scalable=no') !== -1 || document.documentElement.scrollWidth <= window.outerWidth)) {
-				return true;
-			}
-		}
-
-		// IE11: prefixed -ms-touch-action is no longer supported and it's recomended to use non-prefixed version
-		// http://msdn.microsoft.com/en-us/library/windows/apps/Hh767313.aspx
-		if (layer.style.touchAction === 'none' || layer.style.touchAction === 'manipulation') {
-			return true;
-		}
-
-		return false;
-	};
-
-
-	/**
-	 * Factory method for creating a FastClick object
-	 *
-	 * @param {Element} layer The layer to listen on
-	 * @param {Object} [options={}] The options to override the defaults
-	 */
-	FastClick.attach = function(layer, options) {
-		return new FastClick(layer, options);
-	};
-
-
-	if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {
-
-		// AMD. Register as an anonymous module.
-		define(function() {
-			return FastClick;
-		});
-	} else if (typeof module !== 'undefined' && module.exports) {
-		module.exports = FastClick.attach;
-		module.exports.FastClick = FastClick;
-	} else {
-		window.FastClick = FastClick;
-	}
-}());

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 3
src/main/java/common/utils/tl/h5_demo/java/h5demo/WebContent/js/jquery.min.js


+ 0 - 28
src/main/java/common/utils/tl/h5_demo/java/h5demo/WebContent/js/jquery.qrcode.min.js

@@ -1,28 +0,0 @@
-(function(r){r.fn.qrcode=function(h){var s;function u(a){this.mode=s;this.data=a}function o(a,c){this.typeNumber=a;this.errorCorrectLevel=c;this.modules=null;this.moduleCount=0;this.dataCache=null;this.dataList=[]}function q(a,c){if(void 0==a.length)throw Error(a.length+"/"+c);for(var d=0;d<a.length&&0==a[d];)d++;this.num=Array(a.length-d+c);for(var b=0;b<a.length-d;b++)this.num[b]=a[b+d]}function p(a,c){this.totalCount=a;this.dataCount=c}function t(){this.buffer=[];this.length=0}u.prototype={getLength:function(){return this.data.length},
-write:function(a){for(var c=0;c<this.data.length;c++)a.put(this.data.charCodeAt(c),8)}};o.prototype={addData:function(a){this.dataList.push(new u(a));this.dataCache=null},isDark:function(a,c){if(0>a||this.moduleCount<=a||0>c||this.moduleCount<=c)throw Error(a+","+c);return this.modules[a][c]},getModuleCount:function(){return this.moduleCount},make:function(){if(1>this.typeNumber){for(var a=1,a=1;40>a;a++){for(var c=p.getRSBlocks(a,this.errorCorrectLevel),d=new t,b=0,e=0;e<c.length;e++)b+=c[e].dataCount;
-for(e=0;e<this.dataList.length;e++)c=this.dataList[e],d.put(c.mode,4),d.put(c.getLength(),j.getLengthInBits(c.mode,a)),c.write(d);if(d.getLengthInBits()<=8*b)break}this.typeNumber=a}this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,c){this.moduleCount=4*this.typeNumber+17;this.modules=Array(this.moduleCount);for(var d=0;d<this.moduleCount;d++){this.modules[d]=Array(this.moduleCount);for(var b=0;b<this.moduleCount;b++)this.modules[d][b]=null}this.setupPositionProbePattern(0,0);this.setupPositionProbePattern(this.moduleCount-
-7,0);this.setupPositionProbePattern(0,this.moduleCount-7);this.setupPositionAdjustPattern();this.setupTimingPattern();this.setupTypeInfo(a,c);7<=this.typeNumber&&this.setupTypeNumber(a);null==this.dataCache&&(this.dataCache=o.createData(this.typeNumber,this.errorCorrectLevel,this.dataList));this.mapData(this.dataCache,c)},setupPositionProbePattern:function(a,c){for(var d=-1;7>=d;d++)if(!(-1>=a+d||this.moduleCount<=a+d))for(var b=-1;7>=b;b++)-1>=c+b||this.moduleCount<=c+b||(this.modules[a+d][c+b]=
-0<=d&&6>=d&&(0==b||6==b)||0<=b&&6>=b&&(0==d||6==d)||2<=d&&4>=d&&2<=b&&4>=b?!0:!1)},getBestMaskPattern:function(){for(var a=0,c=0,d=0;8>d;d++){this.makeImpl(!0,d);var b=j.getLostPoint(this);if(0==d||a>b)a=b,c=d}return c},createMovieClip:function(a,c,d){a=a.createEmptyMovieClip(c,d);this.make();for(c=0;c<this.modules.length;c++)for(var d=1*c,b=0;b<this.modules[c].length;b++){var e=1*b;this.modules[c][b]&&(a.beginFill(0,100),a.moveTo(e,d),a.lineTo(e+1,d),a.lineTo(e+1,d+1),a.lineTo(e,d+1),a.endFill())}return a},
-setupTimingPattern:function(){for(var a=8;a<this.moduleCount-8;a++)null==this.modules[a][6]&&(this.modules[a][6]=0==a%2);for(a=8;a<this.moduleCount-8;a++)null==this.modules[6][a]&&(this.modules[6][a]=0==a%2)},setupPositionAdjustPattern:function(){for(var a=j.getPatternPosition(this.typeNumber),c=0;c<a.length;c++)for(var d=0;d<a.length;d++){var b=a[c],e=a[d];if(null==this.modules[b][e])for(var f=-2;2>=f;f++)for(var i=-2;2>=i;i++)this.modules[b+f][e+i]=-2==f||2==f||-2==i||2==i||0==f&&0==i?!0:!1}},setupTypeNumber:function(a){for(var c=
-j.getBCHTypeNumber(this.typeNumber),d=0;18>d;d++){var b=!a&&1==(c>>d&1);this.modules[Math.floor(d/3)][d%3+this.moduleCount-8-3]=b}for(d=0;18>d;d++)b=!a&&1==(c>>d&1),this.modules[d%3+this.moduleCount-8-3][Math.floor(d/3)]=b},setupTypeInfo:function(a,c){for(var d=j.getBCHTypeInfo(this.errorCorrectLevel<<3|c),b=0;15>b;b++){var e=!a&&1==(d>>b&1);6>b?this.modules[b][8]=e:8>b?this.modules[b+1][8]=e:this.modules[this.moduleCount-15+b][8]=e}for(b=0;15>b;b++)e=!a&&1==(d>>b&1),8>b?this.modules[8][this.moduleCount-
-b-1]=e:9>b?this.modules[8][15-b-1+1]=e:this.modules[8][15-b-1]=e;this.modules[this.moduleCount-8][8]=!a},mapData:function(a,c){for(var d=-1,b=this.moduleCount-1,e=7,f=0,i=this.moduleCount-1;0<i;i-=2)for(6==i&&i--;;){for(var g=0;2>g;g++)if(null==this.modules[b][i-g]){var n=!1;f<a.length&&(n=1==(a[f]>>>e&1));j.getMask(c,b,i-g)&&(n=!n);this.modules[b][i-g]=n;e--; -1==e&&(f++,e=7)}b+=d;if(0>b||this.moduleCount<=b){b-=d;d=-d;break}}}};o.PAD0=236;o.PAD1=17;o.createData=function(a,c,d){for(var c=p.getRSBlocks(a,
-c),b=new t,e=0;e<d.length;e++){var f=d[e];b.put(f.mode,4);b.put(f.getLength(),j.getLengthInBits(f.mode,a));f.write(b)}for(e=a=0;e<c.length;e++)a+=c[e].dataCount;if(b.getLengthInBits()>8*a)throw Error("code length overflow. ("+b.getLengthInBits()+">"+8*a+")");for(b.getLengthInBits()+4<=8*a&&b.put(0,4);0!=b.getLengthInBits()%8;)b.putBit(!1);for(;!(b.getLengthInBits()>=8*a);){b.put(o.PAD0,8);if(b.getLengthInBits()>=8*a)break;b.put(o.PAD1,8)}return o.createBytes(b,c)};o.createBytes=function(a,c){for(var d=
-0,b=0,e=0,f=Array(c.length),i=Array(c.length),g=0;g<c.length;g++){var n=c[g].dataCount,h=c[g].totalCount-n,b=Math.max(b,n),e=Math.max(e,h);f[g]=Array(n);for(var k=0;k<f[g].length;k++)f[g][k]=255&a.buffer[k+d];d+=n;k=j.getErrorCorrectPolynomial(h);n=(new q(f[g],k.getLength()-1)).mod(k);i[g]=Array(k.getLength()-1);for(k=0;k<i[g].length;k++)h=k+n.getLength()-i[g].length,i[g][k]=0<=h?n.get(h):0}for(k=g=0;k<c.length;k++)g+=c[k].totalCount;d=Array(g);for(k=n=0;k<b;k++)for(g=0;g<c.length;g++)k<f[g].length&&
-(d[n++]=f[g][k]);for(k=0;k<e;k++)for(g=0;g<c.length;g++)k<i[g].length&&(d[n++]=i[g][k]);return d};s=4;for(var j={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,
-78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(a){for(var c=a<<10;0<=j.getBCHDigit(c)-j.getBCHDigit(j.G15);)c^=j.G15<<j.getBCHDigit(c)-j.getBCHDigit(j.G15);return(a<<10|c)^j.G15_MASK},getBCHTypeNumber:function(a){for(var c=a<<12;0<=j.getBCHDigit(c)-
-j.getBCHDigit(j.G18);)c^=j.G18<<j.getBCHDigit(c)-j.getBCHDigit(j.G18);return a<<12|c},getBCHDigit:function(a){for(var c=0;0!=a;)c++,a>>>=1;return c},getPatternPosition:function(a){return j.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,c,d){switch(a){case 0:return 0==(c+d)%2;case 1:return 0==c%2;case 2:return 0==d%3;case 3:return 0==(c+d)%3;case 4:return 0==(Math.floor(c/2)+Math.floor(d/3))%2;case 5:return 0==c*d%2+c*d%3;case 6:return 0==(c*d%2+c*d%3)%2;case 7:return 0==(c*d%3+(c+d)%2)%2;default:throw Error("bad maskPattern:"+
-a);}},getErrorCorrectPolynomial:function(a){for(var c=new q([1],0),d=0;d<a;d++)c=c.multiply(new q([1,l.gexp(d)],0));return c},getLengthInBits:function(a,c){if(1<=c&&10>c)switch(a){case 1:return 10;case 2:return 9;case s:return 8;case 8:return 8;default:throw Error("mode:"+a);}else if(27>c)switch(a){case 1:return 12;case 2:return 11;case s:return 16;case 8:return 10;default:throw Error("mode:"+a);}else if(41>c)switch(a){case 1:return 14;case 2:return 13;case s:return 16;case 8:return 12;default:throw Error("mode:"+
-a);}else throw Error("type:"+c);},getLostPoint:function(a){for(var c=a.getModuleCount(),d=0,b=0;b<c;b++)for(var e=0;e<c;e++){for(var f=0,i=a.isDark(b,e),g=-1;1>=g;g++)if(!(0>b+g||c<=b+g))for(var h=-1;1>=h;h++)0>e+h||c<=e+h||0==g&&0==h||i==a.isDark(b+g,e+h)&&f++;5<f&&(d+=3+f-5)}for(b=0;b<c-1;b++)for(e=0;e<c-1;e++)if(f=0,a.isDark(b,e)&&f++,a.isDark(b+1,e)&&f++,a.isDark(b,e+1)&&f++,a.isDark(b+1,e+1)&&f++,0==f||4==f)d+=3;for(b=0;b<c;b++)for(e=0;e<c-6;e++)a.isDark(b,e)&&!a.isDark(b,e+1)&&a.isDark(b,e+
-2)&&a.isDark(b,e+3)&&a.isDark(b,e+4)&&!a.isDark(b,e+5)&&a.isDark(b,e+6)&&(d+=40);for(e=0;e<c;e++)for(b=0;b<c-6;b++)a.isDark(b,e)&&!a.isDark(b+1,e)&&a.isDark(b+2,e)&&a.isDark(b+3,e)&&a.isDark(b+4,e)&&!a.isDark(b+5,e)&&a.isDark(b+6,e)&&(d+=40);for(e=f=0;e<c;e++)for(b=0;b<c;b++)a.isDark(b,e)&&f++;a=Math.abs(100*f/c/c-50)/5;return d+10*a}},l={glog:function(a){if(1>a)throw Error("glog("+a+")");return l.LOG_TABLE[a]},gexp:function(a){for(;0>a;)a+=255;for(;256<=a;)a-=255;return l.EXP_TABLE[a]},EXP_TABLE:Array(256),
-LOG_TABLE:Array(256)},m=0;8>m;m++)l.EXP_TABLE[m]=1<<m;for(m=8;256>m;m++)l.EXP_TABLE[m]=l.EXP_TABLE[m-4]^l.EXP_TABLE[m-5]^l.EXP_TABLE[m-6]^l.EXP_TABLE[m-8];for(m=0;255>m;m++)l.LOG_TABLE[l.EXP_TABLE[m]]=m;q.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var c=Array(this.getLength()+a.getLength()-1),d=0;d<this.getLength();d++)for(var b=0;b<a.getLength();b++)c[d+b]^=l.gexp(l.glog(this.get(d))+l.glog(a.get(b)));return new q(c,0)},mod:function(a){if(0>
-this.getLength()-a.getLength())return this;for(var c=l.glog(this.get(0))-l.glog(a.get(0)),d=Array(this.getLength()),b=0;b<this.getLength();b++)d[b]=this.get(b);for(b=0;b<a.getLength();b++)d[b]^=l.gexp(l.glog(a.get(b))+c);return(new q(d,0)).mod(a)}};p.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],
-[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,
-116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,
-43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,
-3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,
-55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,
-45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];p.getRSBlocks=function(a,c){var d=p.getRsBlockTable(a,c);if(void 0==d)throw Error("bad rs block @ typeNumber:"+a+"/errorCorrectLevel:"+c);for(var b=d.length/3,e=[],f=0;f<b;f++)for(var h=d[3*f+0],g=d[3*f+1],j=d[3*f+2],l=0;l<h;l++)e.push(new p(g,j));return e};p.getRsBlockTable=function(a,c){switch(c){case 1:return p.RS_BLOCK_TABLE[4*(a-1)+0];case 0:return p.RS_BLOCK_TABLE[4*(a-1)+1];case 3:return p.RS_BLOCK_TABLE[4*
-(a-1)+2];case 2:return p.RS_BLOCK_TABLE[4*(a-1)+3]}};t.prototype={get:function(a){return 1==(this.buffer[Math.floor(a/8)]>>>7-a%8&1)},put:function(a,c){for(var d=0;d<c;d++)this.putBit(1==(a>>>c-d-1&1))},getLengthInBits:function(){return this.length},putBit:function(a){var c=Math.floor(this.length/8);this.buffer.length<=c&&this.buffer.push(0);a&&(this.buffer[c]|=128>>>this.length%8);this.length++}};"string"===typeof h&&(h={text:h});h=r.extend({},{render:"canvas",width:256,height:256,typeNumber:-1,
-correctLevel:2,background:"#ffffff",foreground:"#000000"},h);return this.each(function(){var a;if("canvas"==h.render){a=new o(h.typeNumber,h.correctLevel);a.addData(h.text);a.make();var c=document.createElement("canvas");c.width=h.width;c.height=h.height;for(var d=c.getContext("2d"),b=h.width/a.getModuleCount(),e=h.height/a.getModuleCount(),f=0;f<a.getModuleCount();f++)for(var i=0;i<a.getModuleCount();i++){d.fillStyle=a.isDark(f,i)?h.foreground:h.background;var g=Math.ceil((i+1)*b)-Math.floor(i*b),
-j=Math.ceil((f+1)*b)-Math.floor(f*b);d.fillRect(Math.round(i*b),Math.round(f*e),g,j)}}else{a=new o(h.typeNumber,h.correctLevel);a.addData(h.text);a.make();c=r("<table></table>").css("width",h.width+"px").css("height",h.height+"px").css("border","0px").css("border-collapse","collapse").css("background-color",h.background);d=h.width/a.getModuleCount();b=h.height/a.getModuleCount();for(e=0;e<a.getModuleCount();e++){f=r("<tr></tr>").css("height",b+"px").appendTo(c);for(i=0;i<a.getModuleCount();i++)r("<td></td>").css("width",
-d+"px").css("background-color",a.isDark(e,i)?h.foreground:h.background).appendTo(f)}}a=c;jQuery(a).appendTo(this)})}})(jQuery);

+ 0 - 64
src/main/java/common/utils/tl/h5_demo/java/h5demo/WebContent/pay.html

@@ -1,64 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-	<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-	<title>H5聚合收银台支付接口</title>
-</head>
-	<body BGCOLOR='#FFFFFF' TEXT='#000000' LINK='#0000FF' VLINK='#0000FF' ALINK='#FF0000'>
-		<br /> <br />
-		<table border="1" cellpadding="1" cellspacing="1" align="center" width="50%">
-			<tr>
-		  		<th colspan="2" bgcolor="#5cacee">
-					请输入订单支付参数	
-				</th>
-		  	</tr> 
-
-			<form method="post" action="sendpay.jsp" accept-charset="utf-8">
-
-				<tr >
-					<td >商户订单号(orderid)</td>
-					
-					<td > 
-						<input type="text" name="reqsn" id="reqsn" value="reqsn001" />
-					</td>
-					
-				</tr>
-
-				<tr >
-					<td >支付金额(trxamt)单位分</td>
-					
-					<td > 
-						<input  type="text" name="trxamt" id="trxamt" value="1" />
-					</td>
-			
-				</tr>
-
-				<tr >
-					<td >订单备注(remark)</td>
-					
-					<td > 
-						<inputtype="text" name="remark" id="remark" value="" />
-					</td>
-				
-				</tr>
-
-				<tr >
-					<td >商品描述信息(body)</td>
-					
-					<td > 
-						<input type="text" name="body" id="body" value="手机充值" />
-					</td>
-					
-				</tr>
-
-				<tr >
-					<td ></td>
-					<td > 
-						<input type="submit" value="提交订单" />
-					</td>
-				</tr>
-
-			</form>
-		</table>
-</body>
-</html>

+ 0 - 49
src/main/java/common/utils/tl/h5_demo/java/h5demo/WebContent/qrcodedemo.jsp

@@ -1,49 +0,0 @@
-<%@ page language="java" contentType="text/html; charset=utf-8"
-    pageEncoding="utf-8"%>
- <%
-//服务器
-String path = request.getContextPath();
-String scheme = request.getHeader("X-Forwarded-Scheme") ;
-String basePath =scheme+"://"+request.getServerName()+path+"/";
-if(scheme==null || scheme.equals("")){
-	scheme=request.getScheme();
-	basePath =scheme+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
-}
-
-request.setAttribute("qrurl",basePath+"pay.html");
-%>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html lang="zh-cmn-Hans"> 
-<head>
-<meta charset='utf-8'>
-<meta name="author" content="xianxm, xianxm@allinpay.com"/>
-<meta name="viewport" content="initial-scale=1, maximum-scale=3, minimum-scale=1, user-scalable=no">
-<meta name="format-detection" content="telephone=no"/>
-<meta name="format-detection" content="email=no"/>
-<script src="js/jquery.min.js"></script>
-<script src="js/jquery.qrcode.min.js"></script>
-<script src="js/fastclick.js"></script>
-<title>微信/支付宝钱包扫一扫</title>
-</head>
-<body >
-<center>
-<b>二维码链接</b>:<%= basePath %>pay.html<br/><br/><br/>
- <div class="msgPC__hd">
-            
- </div>
- <br/><br/><br/>
- 请使用微信/支付宝钱包扫一扫二维码
-</center>
-</body>
-<script type="text/javascript">
-$('.msgPC__hd').qrcode({
-    /* render: "table", //table方式  */
-     width: 240, //宽度 
-     height:240, //高度 
-     text: "${qrurl}", //任意内容 
-     background :"#ffffff",//背景颜色  
-     foreground :"#000000" //前景颜色  
- });
-		$("#msg_PC").show();
-</script>
-</html>

+ 0 - 75
src/main/java/common/utils/tl/h5_demo/java/h5demo/WebContent/sendpay.jsp

@@ -1,75 +0,0 @@
-<%@page import="com.allinpay.syb.lib.SybUtil"%>
-<%@page import="com.allinpay.syb.lib.SybConstants"%>
-<%@page import="java.util.TreeMap"%>
-<%@ page language="java" contentType="text/html; charset=utf-8"%>
-<%! String formatString(String text) {
-		return text == null ? "" : text.trim();
-	}
-%>
-<%
-	request.setCharacterEncoding("utf-8");
-
-	String appid = SybConstants.SYB_APPID;
-	String cusid = SybConstants.SYB_CUSID;
-	String version = SybConstants.VERSION;
-	String charset = "utf-8";
-	String trxamt   = formatString(request.getParameter("trxamt"));
-	String reqsn  = formatString(request.getParameter("reqsn"));
-	String returl = SybConstants.RET_URL;
-	String notify_url = SybConstants.NOTFIY_URL;
-	String body = formatString(request.getParameter("body"));
-	String remark = formatString(request.getParameter("remark"));
-	String randomstr = String.valueOf(System.currentTimeMillis()) ;
-	String validtime = String.valueOf( SybConstants.VALID_TIME);
-	String signtype = SybConstants.SIGN_TYPE;
-	TreeMap<String,String> params = new TreeMap<String,String>();
-	if(!SybUtil.isEmpty(SybConstants.SYB_ORGID))
-		params.put("orgid", SybConstants.SYB_ORGID);
-	params.put("appid", appid);
-	params.put("cusid", cusid);
-	params.put("version", version);
-	params.put("charset", charset);
-	params.put("trxamt", trxamt);
-	params.put("reqsn", reqsn);
-	params.put("returl", returl);
-	params.put("notify_url", notify_url);
-	params.put("body", body);
-	params.put("randomstr", randomstr);
-	params.put("remark", remark);
-	params.put("validtime", validtime);
-
-	params.put("signtype",signtype );
-	String appkey = "";
-	if(SybConstants.SIGN_TYPE.equals("RSA"))
-		appkey = SybConstants.SYB_RSACUSPRIKEY;
-	else if(SybConstants.SIGN_TYPE.equals("SM2"))
-		appkey = SybConstants.SYB_SM2PPRIVATEKEY;
-	else 
-		appkey = SybConstants.SYB_MD5_APPKEY;
-	String sign  = SybUtil.unionSign(params,appkey,SybConstants.SIGN_TYPE);
-	System.out.println(sign);
-%>
-<html>
-	<head>
-		<title>跳转
-		</title>
-	</head>
-	<body   onload="document.gatewayForm.submit()">
-		<form name="gatewayForm" action='<%=SybConstants.SYB_APIURL+"/h5unionpay/unionorder"%>' method='POST'>
-			<input type="hidden" name="appid" id="appid" value="<%=appid %>" />
-       		<input type="hidden" name="cusid" id="cusid" value="<%=cusid%>" />
-       		<input type="hidden" name="version" id="version" value="<%=version%>" />
-       		<input type="hidden" name="charset" id="charset" value="<%=charset%>" />
-       		<input type="hidden" name="trxamt" id="trxamt" value="<%=trxamt%>" />
-       		<input type="hidden" name="reqsn" id="reqsn" value="<%=reqsn%>" />
-       		<input type="hidden" name="randomstr" id="randomstr" value="<%=randomstr%>" />
-       		<input type="hidden" name="body" id="body" value="<%=body%>" />
-       		<input type="hidden" name="validtime" id="validtime" value="<%=validtime%>" />
-       		<input type="hidden" name="remark" id="remark" value="<%=remark%>" />
-       		<input type="hidden" name="returl" id="returl" value="<%=returl %>" />
-       		<input type="hidden" name="notify_url" id="notify_url" value="<%=notify_url%>" />
-       		<input type="hidden" name="signtype" id="signtype" value="<%=signtype%>" />
-       		<input type="hidden" name="sign" id="sign" value="<%=sign%>" />
-		</form>
-	</body>
-</html>

BIN
src/main/java/common/utils/tl/h5_demo/java/h5demo/bin/com/allinpay/syb/lib/HttpConnectionUtil$1.class


BIN
src/main/java/common/utils/tl/h5_demo/java/h5demo/bin/com/allinpay/syb/lib/HttpConnectionUtil.class


BIN
src/main/java/common/utils/tl/h5_demo/java/h5demo/bin/com/allinpay/syb/lib/SSLUtil.class


BIN
src/main/java/common/utils/tl/h5_demo/java/h5demo/bin/com/allinpay/syb/lib/SmUtil.class


BIN
src/main/java/common/utils/tl/h5_demo/java/h5demo/bin/com/allinpay/syb/lib/SybConstants.class


BIN
src/main/java/common/utils/tl/h5_demo/java/h5demo/bin/com/allinpay/syb/lib/SybPayService.class


BIN
src/main/java/common/utils/tl/h5_demo/java/h5demo/bin/com/allinpay/syb/lib/SybUtil.class


BIN
src/main/java/common/utils/tl/h5_demo/java/h5demo/bin/com/allinpay/syb/test/ApiTestV2.class


BIN
src/main/java/common/utils/tl/h5_demo/java/h5demo/bin/com/allinpay/syb/test/NotifyServlet.class


+ 0 - 124
src/main/java/common/utils/tl/h5_demo/java/h5demo/src/com/allinpay/syb/lib/HttpConnectionUtil.java

@@ -1,124 +0,0 @@
-package com.allinpay.syb.lib;
-
-import java.io.ByteArrayOutputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URLEncoder;
-import java.util.Map;
-
-import javax.net.ssl.HostnameVerifier;
-import javax.net.ssl.HttpsURLConnection;
-import javax.net.ssl.SSLSession;
-
-import org.apache.commons.logging.Log;
-
-public class HttpConnectionUtil {
-	private HttpURLConnection conn;
-	private String connectUrl;
-	
-	public HttpConnectionUtil(String connectUrl){
-		this.connectUrl = connectUrl;
-	}
-	
-	public void init() throws Exception{
-		URL url = new URL(connectUrl);
-		System.setProperty("java.protocol.handler.pkgs", "javax.net.ssl");
-	    HostnameVerifier hv = new HostnameVerifier() {
-	         public boolean verify(String urlHostName, SSLSession session) {
-	         return urlHostName.equals(session.getPeerHost());
-	         }
-	    };
-	    HttpsURLConnection.setDefaultHostnameVerifier(hv);
-    	URLConnection conn = url.openConnection();
-    	conn.setDoInput(true);
-    	conn.setDoOutput(true);
-    	conn.setReadTimeout(60000);
-    	conn.setConnectTimeout(30000);
-    	if (conn instanceof HttpsURLConnection){
-    		HttpsURLConnection httpsConn = (HttpsURLConnection)conn;
-    		httpsConn.setSSLSocketFactory(SSLUtil.getInstance().getSSLSocketFactory());
-    	} else if (conn instanceof HttpURLConnection){
-    		HttpURLConnection httpConn = (HttpURLConnection)conn;
-    	} else {
-    		throw new Exception("不是http/https协议的url");
-    	}
-    	this.conn = (HttpURLConnection)conn;
-    	initDefaultPost();
-	}
-	
-	public void destory(){
-		try{
-			if(this.conn!=null){
-				this.conn.disconnect();
-			}
-		}catch(Exception e){
-			
-		}
-	}
-	
-    private void initDefaultPost() throws Exception{
-    	conn.setDoOutput(true);
-    	conn.setDoInput(true);
-    	conn.setRequestMethod("POST");
-    	conn.setUseCaches(false);
-    	conn.setInstanceFollowRedirects(true);
-    	conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
-    }
-    
-    public byte[] postParams(Map<String, String> params,boolean readreturn) throws IOException {
-    	StringBuilder outBuf = new StringBuilder();
-    	boolean isNotFirst = false;
-    	for (Map.Entry<String, String> entry: params.entrySet()){
-    		if (isNotFirst)
-    			outBuf.append('&');
-    		isNotFirst = true;
-    		outBuf
-    			.append(entry.getKey())
-    			.append('=')
-    			.append(URLEncoder.encode(entry.getValue(), "UTF-8"));
-    	}
-    	System.out.println("参数:"+outBuf.toString());
-    	return postParams(outBuf.toString(),readreturn);
-    }
-    
-    public byte[] postParams(String message,boolean readreturn) throws IOException {
-    	DataOutputStream out = new DataOutputStream(conn.getOutputStream());
-    	out.write(message.getBytes("UTF-8"));
-    	out.close();
-    	if(readreturn){
-    		return readBytesFromStream(conn.getInputStream());
-    	}else{
-    		return null;
-    	}
-    }
-    
-    public byte[] postParams(byte[] message,boolean readreturn) throws IOException {
-    	DataOutputStream out = new DataOutputStream(conn.getOutputStream());
-    	out.write(message);
-    	out.close();
-    	if(readreturn){
-    		return readBytesFromStream(conn.getInputStream());
-    	}else{
-    		return null;
-    	}
-    }
-    
-    private byte[] readBytesFromStream(InputStream is) throws IOException{
-    	ByteArrayOutputStream baos = new ByteArrayOutputStream();
-    	int readLen;
-    	byte[] tmpBuf = new byte[4096];
-    	while ((readLen = is.read(tmpBuf)) > 0)
-    		baos.write(tmpBuf, 0, readLen);
-    	is.close();
-    	return baos.toByteArray();
-    }
-
-	public HttpURLConnection getConn() {
-		return conn;
-	}
-    
-}

+ 0 - 54
src/main/java/common/utils/tl/h5_demo/java/h5demo/src/com/allinpay/syb/lib/SSLUtil.java

@@ -1,54 +0,0 @@
-package com.allinpay.syb.lib;
-
-import java.security.KeyManagementException;
-import java.security.NoSuchAlgorithmException;
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSocketFactory;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.X509TrustManager;
-
-/**
- * SSL管理助手类
- * @author Administrator
- *
- */
-public class SSLUtil implements X509TrustManager {
-	private SSLSocketFactory sslFactory = null;
-	
-	private SSLUtil(){
-	}
-	
-	public void checkClientTrusted(X509Certificate[] arg0, String arg1)
-			throws CertificateException {
-	}
-
-	public void checkServerTrusted(X509Certificate[] arg0, String arg1)
-			throws CertificateException {
-	}
-
-	public X509Certificate[] getAcceptedIssuers() {
-		return null;
-	}
-	
-	/** 获取SSL Socket工厂 */
-	public SSLSocketFactory getSSLSocketFactory(){
-		return sslFactory;
-	}
-	
-	private static SSLUtil _instance = null;
-	
-	/** 获取SSL管理助手类实例 */
-	synchronized public static SSLUtil getInstance() throws NoSuchAlgorithmException, KeyManagementException {
-		if (_instance == null){
-			_instance = new SSLUtil();
-			SSLContext sc = SSLContext.getInstance("SSLv3");
-			sc.init(null, new TrustManager[]{new SSLUtil()}, null);
-			_instance.sslFactory = sc.getSocketFactory();
-		}
-		return _instance;
-	}
-
-}

+ 0 - 138
src/main/java/common/utils/tl/h5_demo/java/h5demo/src/com/allinpay/syb/lib/SmUtil.java

@@ -1,138 +0,0 @@
-package com.allinpay.syb.lib;
-
-import java.io.IOException;
-import java.math.BigInteger;
-import java.security.KeyFactory;
-import java.security.PrivateKey;
-import java.security.PublicKey;
-import java.security.SecureRandom;
-import java.security.Security;
-import java.security.Signature;
-import java.security.spec.PKCS8EncodedKeySpec;
-import java.security.spec.X509EncodedKeySpec;
-import java.util.Arrays;
-
-import org.apache.commons.codec.binary.Base64;
-import org.bouncycastle.asn1.ASN1EncodableVector;
-import org.bouncycastle.asn1.ASN1Integer;
-import org.bouncycastle.asn1.ASN1Sequence;
-import org.bouncycastle.asn1.DERSequence;
-import org.bouncycastle.jcajce.spec.SM2ParameterSpec;
-import org.bouncycastle.jce.provider.BouncyCastleProvider;
-import org.bouncycastle.util.encoders.Hex;
-
-public class SmUtil {
-	static{
-        Security.addProvider(new BouncyCastleProvider());
-    }
-	/**算法常量:SM3withSM2*/
-	public static final String ALGORITHM_SM3SM2_BCPROV  		 = "SM3withSM2";
-	private final static int SM3withSM2_RS_LEN=32;
-
-	public static void main(String[] args) throws Exception {
-		/**商户平台分配的appid,也是签名的certid**/
-		String appid = "00000156";
-		/**商户sm2私钥,用于向通联发起请求前进行签名**/
-		String cusPrivateKey = "MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgjj4Rk+b0YjwO+UwXofnHf4bK+kaaY5Btkd8nMP2VimmgCgYIKoEcz1UBgi2hRANCAAQqlALW4qGC3bP1x3wo5QsKxaCMEZJ2ODTTwOQ+d8UGU7GoK/y/WMBQWf5upMnFU06p5FxGooXYYoBtldgm03hq";
-		/**商户sm2公钥,需要配置到通联商户平台**/
-		String cusPubKey = "MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEKpQC1uKhgt2z9cd8KOULCsWgjBGSdjg008DkPnfFBlOxqCv8v1jAUFn+bqTJxVNOqeRcRqKF2GKAbZXYJtN4ag==";
-		
-		/**通联平台sm2公钥,用于请求返回或者通联通知的验签**/
-		String tlPubKey = "MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAE/BnA8BawehBtH0ksPyayo4pmzL/u1FQ2sZcqwOp6bjVqQX4tjo930QAvHZPJ2eez8sCz/RYghcqv4LvMq+kloQ==";
-		
-		String blankStr = "请求待签名数据";
-		PrivateKey privkey = privKeySM2FromBase64Str(cusPrivateKey);
-		String sign = signSM3SM2RetBase64(privkey, appid, blankStr.getBytes("UTF-8"));//签名
-		System.out.println(sign);
-		
-		String rspBlankStr = "返回待验签数据";//通联返回的明文
-		String rspSign = "AovBKQGUe0xuJ0ox7FgIIX+yB3DzbudgUsnNvJmDV0IdHZtU2Y8vdeUY1pd2vmPUf08hNgdkoz+4WP/D/ktOcA==";//通联返回的签名
-		PublicKey publicKey = pubKeySM2FromBase64Str(tlPubKey);
-		boolean isOk = verifySM3SM2(publicKey, "Allinpay", Base64.decodeBase64(rspSign), rspBlankStr.getBytes("UTF-8"));
-		System.out.println("验签结果:"+isOk);
-		
-
-	}
-	
-	/**签名并BASE64编码-SM3WithSM2 */
-	public static String signSM3SM2RetBase64(final PrivateKey privateKey,String certid,final byte[] data) throws Exception{
-		return Base64.encodeBase64String(signSM3SM2(privateKey, certid, data));
-	}
-	
-	/**签名-SM3WithSM2 */
-	public static byte[] signSM3SM2(final PrivateKey privateKey,String certid,final byte[] data) throws Exception{
-		SM2ParameterSpec parameterSpec = new SM2ParameterSpec(certid.getBytes());
-		Signature signer = Signature.getInstance(ALGORITHM_SM3SM2_BCPROV, "BC");
-		signer.setParameter(parameterSpec);
-		signer.initSign(privateKey, new SecureRandom());
-		signer.update(data);
-		return byteAsn12BytePlain(signer.sign());
-	}
-	
-	/** 验证签名-SM3WithSM2*/
-	public static boolean verifySM3SM2(final PublicKey publicKey,String certid,final byte[] signData, final byte[] srcData) throws Exception {
-        SM2ParameterSpec parameterSpec = new SM2ParameterSpec(certid.getBytes());
-        Signature verifier = Signature.getInstance(ALGORITHM_SM3SM2_BCPROV, "BC");
-        verifier.setParameter(parameterSpec);
-        verifier.initVerify(publicKey);
-        verifier.update(srcData);
-        return verifier.verify(bytePlain2ByteAsn1(signData));
-	}
-	
-	/**从字符串读取私钥-目前支持PKCS8(keystr为BASE64格式)*/
-	public static PrivateKey privKeySM2FromBase64Str(String keystr) throws Exception {
-		KeyFactory keyFactory = KeyFactory.getInstance("EC");
-		return keyFactory.generatePrivate(new PKCS8EncodedKeySpec(Base64.decodeBase64(keystr)));
-	}
-	
-	/**从字符串读取RSA公钥(keystr为BASE64格式)*/
-	public static PublicKey pubKeySM2FromBase64Str(String keystr) throws Exception {
-		KeyFactory keyFactory = KeyFactory.getInstance("EC");
-		return keyFactory.generatePublic(new X509EncodedKeySpec(Base64.decodeBase64(keystr)));
-	}
-	
-	/**
-	 * 将普通字节数组转换为ASN1字节数组 适用于SM3withSM2验签时验签明文转换
-	 */
-	private static byte[] bytePlain2ByteAsn1(byte[] data) {
-		if (data.length != SM3withSM2_RS_LEN * 2) throw new RuntimeException("err data. ");
-		BigInteger r = new BigInteger(1, Arrays.copyOfRange(data, 0, SM3withSM2_RS_LEN));
-		BigInteger s = new BigInteger(1, Arrays.copyOfRange(data, SM3withSM2_RS_LEN, SM3withSM2_RS_LEN * 2));
-		ASN1EncodableVector v = new ASN1EncodableVector();
-		v.add(new ASN1Integer(r));
-		v.add(new ASN1Integer(s));
-		try {
-			return new DERSequence(v).getEncoded("DER");
-		} catch (IOException e) {
-			throw new RuntimeException(e);
-		}
-	}
-	/**
-	 * 将ASN1字节数组转换为普通字节数组 适用于SM3withSM2签名时签名结果转换
-	 */
-	private static byte[] byteAsn12BytePlain(byte[] dataAsn1) {
-		ASN1Sequence seq = ASN1Sequence.getInstance(dataAsn1);
-		byte[] r = bigIntToFixexLengthBytes(ASN1Integer.getInstance(seq.getObjectAt(0)).getValue());
-		byte[] s = bigIntToFixexLengthBytes(ASN1Integer.getInstance(seq.getObjectAt(1)).getValue());
-		byte[] result = new byte[SM3withSM2_RS_LEN * 2];
-		System.arraycopy(r, 0, result, 0, r.length);
-		System.arraycopy(s, 0, result, SM3withSM2_RS_LEN, s.length);
-		return result;
-	}
-	
-	private static byte[] bigIntToFixexLengthBytes(BigInteger rOrS) {
-		byte[] rs = rOrS.toByteArray();
-		if (rs.length == SM3withSM2_RS_LEN) return rs;
-		else if (rs.length == SM3withSM2_RS_LEN + 1 && rs[0] == 0)
-			return Arrays.copyOfRange(rs, 1, SM3withSM2_RS_LEN + 1);
-		else if (rs.length < SM3withSM2_RS_LEN) {
-			byte[] result = new byte[SM3withSM2_RS_LEN];
-			Arrays.fill(result, (byte) 0);
-			System.arraycopy(rs, 0, result, SM3withSM2_RS_LEN - rs.length, rs.length);
-			return result;
-		} else {
-			throw new RuntimeException("err rs: " + Hex.toHexString(rs));
-		}
-	}
-
-}

+ 0 - 39
src/main/java/common/utils/tl/h5_demo/java/h5demo/src/com/allinpay/syb/lib/SybConstants.java

@@ -1,39 +0,0 @@
-package com.allinpay.syb.lib;
-
-public class SybConstants {
-//	测试环境测试参数
-//	public static final String SYB_ORGID = "";//集团/机构模式下该参数不为空,且appid与key是与次参数对应
-//	public static final String SYB_CUSID = "990581007426001";
-//	public static final String SYB_APPID = "00000051";
-//	public static final String SYB_MD5_APPKEY = "allinpay888";
-//	public static final String SYB_APIURL = "http://172.16.1.10/apiweb";
-	/**商户RSA私钥,用于向通联发起请求前进行签名**/
-//	public static final String SYB_RSACUSPRIKEY = "MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAK5aIo+E1eyWwEIgMB8ZEZRAaWjSAglmfKVhzy8N1eLjAlqPjJgOCqXGEYt/r61AyIjCCJiYVDTHzcqstmbBU7HKpYjTsquCLjRWcL/fhMwMGBSg2bP5mqw5locSOz1gtRujmd3kZo9OIJuWtfG2+wgPPdKUdGZS+5K8WtWCF4z1AgMBAAECgYAPvvqvkPzb9tpqrmsCJ/qvM6kBazP9Ytjfe8ehFYQLT1qrUJsPMXdzNMHpYhD82eSyeymZFGrIcIIMq4/2lD+pYOMQTMGGjoVb2wnQhZFqPdgjXgOQ90E43X69jD3p5F8CuKVNa13I4l3iyfzlVIL780JPdJdug7yKEFdSeOQZUQJBAONlFpIqz87pbnwzfgO5kRTbbI7DcyObb8OEeCK3VlGB3r9P4NoMEDaXm+HnIdv53gnFq+xgbREWUt2nFq9dSUUCQQDESOIdSvIBc3KQTYR+cnlQTH0SOvm0Tlx4KekBCLxTFAFyBqnOBLdVyQb6Z1wxGz855AjnNbHy1rFhUYQ6hPfxAkAIRZUcnBITJMqwGe9rk0SDzbeVOebmVLEsG5WDLcgmDuNbcjxrsiSk178D6LSCnARHtrkaUCenh3hcN8fLeUlBAkABNP2G9pYEYkRbFM7yxBtw3feK7Cfq7uxspL1VD0uxKxdTLy1OIgNKmMDdO1N6zdMWtQtE+LSObLmMgqbQgU7RAkBFX5kl4+B3k+/aCYB/ndqd1nQIr4SNAtLFJDtlW2xah9W2lQL/7KQDT4o4dUMY51m7Bu61SAmKtralv7Hf25yf";
-//	/**通联平台RSA公钥,用于请求返回或者通联通知的验签**/
-//	public static final String SYB_RSATLPUBKEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDYXfu4b7xgDSmEGQpQ8Sn3RzFgl5CE4gL4TbYrND4FtCYOrvbgLijkdFgIrVVWi2hUW4K0PwBsmlYhXcbR+JSmqv9zviVXZiym0lK3glJGVCN86r9EPvNTusZZPm40TOEKMVENSYaUjCxZ7JzeZDfQ4WCeQQr2xirqn6LdJjpZ5wIDAQAB";
-//
-//	/**商户sm2私钥,用于向通联发起请求前进行签名**/
-//	public static final String SYB_SM2PPRIVATEKEY = "MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgjj4Rk+b0YjwO+UwXofnHf4bK+kaaY5Btkd8nMP2VimmgCgYIKoEcz1UBgi2hRANCAAQqlALW4qGC3bP1x3wo5QsKxaCMEZJ2ODTTwOQ+d8UGU7GoK/y/WMBQWf5upMnFU06p5FxGooXYYoBtldgm03hq";
-//	/**通联平台sm2公钥,用于请求返回或者通联通知的验签**/
-//	public static final String SYB_SM2TLPUBKEY = "MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAE/BnA8BawehBtH0ksPyayo4pmzL/u1FQ2sZcqwOp6bjVqQX4tjo930QAvHZPJ2eez8sCz/RYghcqv4LvMq+kloQ==";
-	
-//	正式环境测试参数
-	public static final String SYB_ORGID = "";//集团/机构模式下该参数不为空,且appid与key是与次参数对应
-	public static final String SYB_CUSID = "990440148166000";
-	public static final String SYB_APPID = "00000003";
-	public static final String SYB_MD5_APPKEY = "a0ea3fa20dbd7bb4d5abf1d59d63bae8";
-	public static final String SYB_APIURL = "https://vsp.allinpay.com/apiweb";//生产环境
-	public static final String SYB_RSACUSPRIKEY = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAO0HpPUP+eHk//Ba6ZOePvoZVDpOCRtt943oeVfCTllye43bqja1jVIaebX0MgX+yPYnWIQIOJ9ubSH0R4iyY9y1/HR00qkUpfW3/0usBPt9qn7r0xtFHerhVCd4dT2rKb2Oc5IhKOg05cw/BmMFohMkFsqt0jlrUXI8zJOlLIcxAgMBAAECgYA9lt/pAYa3iK5sQOMyhUrt54j4QXCiXPeXOxHUmNuM6G9sU+itoI0hCVoYymP5JNQJCf45CH3WB3Z5/SRdQ6Uoo1cjao6cCohPLxMSfJglsZCHckPH53o25RKEza4njIgKC+yN7HAhanKymhw/yYQ6i0aXq38zFIk8djMtE7R6xQJBAP6jvNy7UhPKO5rxGFKR+MvvbO3qnYH6x0jZCGY3FlxuGfbavueOiFtMeK67FuDv683dcUKi+M48yR4kH5CfIusCQQDuS9KF6mlm3kHAiZWgVhE8VVNYGpRLCRDgAKm4InGmvk5mUv+O1yAtAFVAEHWIgD4awC7Eqf1YFrSF/It9HV9TAkEAsXiU7JJxhfFw0XAvL30lFZ1tIfReinSp6A+7VuIV552k4vNaEjC4wEjv43fpXiRZCEXJ5lOHbNXYpfUvOrBuuQJAOpow8rf8Jc0g1G3Be0XPRUwii/c1YuKe4Meo9VybIIuKkkV1Dba/9fEwBepGTURkgYWjur+nSyOCT7UUxLcVewJAPLig8dVfKpsiNwYuveEYMcFaO5xoRuiB7v+CMmvxpuuK+rrFS+d7RdmwDbnBiDV4JkTgFObUiGvB7MtS+LGfhw==";
-	public static final String SYB_RSATLPUBKEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCm9OV6zH5DYH/ZnAVYHscEELdCNfNTHGuBv1nYYEY9FrOzE0/4kLl9f7Y9dkWHlc2ocDwbrFSm0Vqz0q2rJPxXUYBCQl5yW3jzuKSXif7q1yOwkFVtJXvuhf5WRy+1X5FOFoMvS7538No0RpnLzmNi3ktmiqmhpcY/1pmt20FHQQIDAQAB";
-
-	public static final String VERSION = "12";
-	public static final String RET_URL = "https://test.allinpaygd.com/JWeb/reccomparams.jsp";
-	public static final String NOTFIY_URL = "https://test.allinpaygd.com/JWeb/NotifyServlet";
-	public static final String VALID_TIME = "5";
-	public static final String SIGN_TYPE = "SM2";//
-//	/**商户sm2私钥,用于向通联发起请求前进行签名**/
-	public static final String SYB_SM2PPRIVATEKEY = "MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgjj4Rk+b0YjwO+UwXofnHf4bK+kaaY5Btkd8nMP2VimmgCgYIKoEcz1UBgi2hRANCAAQqlALW4qGC3bP1x3wo5QsKxaCMEZJ2ODTTwOQ+d8UGU7GoK/y/WMBQWf5upMnFU06p5FxGooXYYoBtldgm03hq";
-//	/**通联平台sm2公钥,用于请求返回或者通联通知的验签**/
-	public static final String SYB_SM2TLPUBKEY = "MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEBQicgWm0KAMqhO3bdqMUEDrKQvYg8cCXHhdGwq7CGE6oJDzJ1P/94HpuVdBf1KidmPxr7HOH+0DAnpeCcx9TcQ==";
-
-}

+ 0 - 124
src/main/java/common/utils/tl/h5_demo/java/h5demo/src/com/allinpay/syb/lib/SybPayService.java

@@ -1,124 +0,0 @@
-package com.allinpay.syb.lib;
-
-import java.net.URLEncoder;
-import java.util.Map;
-import java.util.TreeMap;
-
-public class SybPayService {
-	
-	public Map<String,String> cancel(long trxamt,String reqsn,String oldtrxid,String oldreqsn) throws Exception{
-		HttpConnectionUtil http = new HttpConnectionUtil(SybConstants.SYB_APIURL+"/unitorder/cancel");
-		http.init();
-		TreeMap<String,String> params = new TreeMap<String,String>();
-		if(!SybUtil.isEmpty(SybConstants.SYB_ORGID))
-			params.put("orgid", SybConstants.SYB_ORGID);
-		params.put("cusid", SybConstants.SYB_CUSID);
-		params.put("appid", SybConstants.SYB_APPID);
-		params.put("version", "11");
-		params.put("trxamt", String.valueOf(trxamt));
-		params.put("reqsn", reqsn);
-		params.put("oldtrxid", oldtrxid);
-		params.put("oldreqsn", oldreqsn);
-		params.put("randomstr", SybUtil.getValidatecode(8));
-		params.put("signtype", SybConstants.SIGN_TYPE);
-		String appkey = "";
-		if(SybConstants.SIGN_TYPE.equals("RSA"))
-			appkey = SybConstants.SYB_RSACUSPRIKEY;
-		else if(SybConstants.SIGN_TYPE.equals("SM2"))
-			appkey = SybConstants.SYB_SM2PPRIVATEKEY;
-		else 
-			appkey = SybConstants.SYB_MD5_APPKEY;
-		params.put("sign", SybUtil.unionSign(params,appkey,SybConstants.SIGN_TYPE));
-		byte[] bys = http.postParams(params, true);
-		String result = new String(bys,"UTF-8");
-		Map<String,String> map = handleResult(result);
-		return map;
-	}
-	
-	public Map<String,String> refund(long trxamt,String reqsn,String oldtrxid,String oldreqsn) throws Exception{
-		HttpConnectionUtil http = new HttpConnectionUtil(SybConstants.SYB_APIURL+"/unitorder/refund");
-		http.init();
-		TreeMap<String,String> params = new TreeMap<String,String>();
-		if(!SybUtil.isEmpty(SybConstants.SYB_ORGID))
-			params.put("orgid", SybConstants.SYB_ORGID);
-		params.put("cusid", SybConstants.SYB_CUSID);
-		params.put("appid", SybConstants.SYB_APPID);
-		params.put("version", "11");
-		params.put("trxamt", String.valueOf(trxamt));
-		params.put("reqsn", reqsn);
-		params.put("oldreqsn", oldreqsn);
-		params.put("oldtrxid", oldtrxid);
-		params.put("randomstr", SybUtil.getValidatecode(8));
-		params.put("signtype", SybConstants.SIGN_TYPE);
-		String appkey = "";
-		if(SybConstants.SIGN_TYPE.equals("RSA"))
-			appkey = SybConstants.SYB_RSACUSPRIKEY;
-		else if(SybConstants.SIGN_TYPE.equals("SM2"))
-			appkey = SybConstants.SYB_SM2PPRIVATEKEY;
-		else 
-			appkey = SybConstants.SYB_MD5_APPKEY;
-		params.put("sign", SybUtil.unionSign(params,appkey,SybConstants.SIGN_TYPE));
-		byte[] bys = http.postParams(params, true);
-		String result = new String(bys,"UTF-8");
-		Map<String,String> map = handleResult(result);
-		return map;
-	}
-	
-	public Map<String,String> query(String reqsn,String trxid) throws Exception{
-		HttpConnectionUtil http = new HttpConnectionUtil(SybConstants.SYB_APIURL+"/unitorder/query");
-		http.init();
-		TreeMap<String,String> params = new TreeMap<String,String>();
-		if(!SybUtil.isEmpty(SybConstants.SYB_ORGID))
-			params.put("orgid", SybConstants.SYB_ORGID);
-		params.put("cusid", SybConstants.SYB_CUSID);
-		params.put("appid", SybConstants.SYB_APPID);
-		params.put("version", "11");
-		params.put("reqsn", reqsn);
-		params.put("trxid", trxid);
-		params.put("randomstr", SybUtil.getValidatecode(8));
-		params.put("signtype", SybConstants.SIGN_TYPE);
-		String appkey = "";
-		if(SybConstants.SIGN_TYPE.equals("RSA"))
-			appkey = SybConstants.SYB_RSACUSPRIKEY;
-		else if(SybConstants.SIGN_TYPE.equals("SM2"))
-			appkey = SybConstants.SYB_SM2PPRIVATEKEY;
-		else 
-			appkey = SybConstants.SYB_MD5_APPKEY;
-		params.put("sign", SybUtil.unionSign(params,appkey,SybConstants.SIGN_TYPE));
-		byte[] bys = http.postParams(params, true);
-		String result = new String(bys,"UTF-8");
-		Map<String,String> map = handleResult(result);
-		return map;
-	}
-	
-	
-	public static Map<String,String> handleResult(String result) throws Exception{
-		System.out.println("ret:"+result);
-		Map map = SybUtil.json2Obj(result, Map.class);
-		if(map == null){
-			throw new Exception("返回数据错误");
-		}
-		if("SUCCESS".equals(map.get("retcode"))){
-			TreeMap tmap = new TreeMap();
-			tmap.putAll(map);
-			String appkey = "";
-			if(SybConstants.SIGN_TYPE.equals("RSA"))
-				appkey = SybConstants.SYB_RSATLPUBKEY;
-			else if(SybConstants.SIGN_TYPE.equals("SM2"))
-				appkey = SybConstants.SYB_SM2TLPUBKEY;
-			else 
-				appkey = SybConstants.SYB_MD5_APPKEY;
-			if(SybUtil.validSign(tmap, appkey, SybConstants.SIGN_TYPE)){
-				System.out.println("签名成功");
-				return map;
-			}else{
-				throw new Exception("验证签名失败");
-			}
-			
-		}else{
-			throw new Exception(map.get("retmsg").toString());
-		}
-	}
-	
-	
-}

+ 0 - 230
src/main/java/common/utils/tl/h5_demo/java/h5demo/src/com/allinpay/syb/lib/SybUtil.java

@@ -1,230 +0,0 @@
-package com.allinpay.syb.lib;
-
-import java.io.UnsupportedEncodingException;
-import java.security.KeyFactory;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.security.PrivateKey;
-import java.security.PublicKey;
-import java.security.spec.PKCS8EncodedKeySpec;
-import java.security.spec.X509EncodedKeySpec;
-import java.util.Map;
-import java.util.Random;
-import java.util.TreeMap;
-import org.apache.commons.codec.binary.Base64;
-import net.sf.json.JSONObject;
-
-public class SybUtil {
-	/**
-	 * js转化为实体
-	 * 
-	 * @param <T>
-	 * @param jsonstr
-	 * @param cls
-	 * @return
-	 */
-	public static <T> T json2Obj(String jsonstr, Class<T> cls) {
-		JSONObject jo = JSONObject.fromObject(jsonstr);
-		T obj = (T) JSONObject.toBean(jo, cls);
-		return obj;
-	}
-
-	/**
-	 * md5
-	 * 
-	 * @param b
-	 * @return
-	 */
-	public static String md5(byte[] b) {
-		try {
-			MessageDigest md = MessageDigest.getInstance("MD5");
-			md.reset();
-			md.update(b);
-			byte[] hash = md.digest();
-			StringBuffer outStrBuf = new StringBuffer(32);
-			for (int i = 0; i < hash.length; i++) {
-				int v = hash[i] & 0xFF;
-				if (v < 16) {
-					outStrBuf.append('0');
-				}
-				outStrBuf.append(Integer.toString(v, 16).toLowerCase());
-			}
-			return outStrBuf.toString();
-		} catch (NoSuchAlgorithmException e) {
-			e.printStackTrace();
-			return new String(b);
-		}
-	}
-
-	/**
-	 * 判断字符串是否为空
-	 * 
-	 * @param s
-	 * @return
-	 */
-	public static boolean isEmpty(String s) {
-		if (s == null || "".equals(s.trim()))
-			return true;
-		return false;
-	}
-
-	/**
-	 * 生成随机码
-	 * 
-	 * @param n
-	 * @return
-	 */
-	public static String getValidatecode(int n) {
-		Random random = new Random();
-		String sRand = "";
-		n = n == 0 ? 4 : n;// default 4
-		for (int i = 0; i < n; i++) {
-			String rand = String.valueOf(random.nextInt(10));
-			sRand += rand;
-		}
-		return sRand;
-	}
-
-
-
-	public static boolean validSign(TreeMap<String, String> param,
-			String appkey, String signType) throws Exception {
-		if (param != null && !param.isEmpty()) {
-			if (!param.containsKey("sign"))
-				return false;
-			String sign = param.remove("sign");
-			if ("MD5".equals(signType)) {// 如果是md5则需要把md5的key加入到排序
-				param.put("key", appkey);
-			}
-			StringBuilder sb = new StringBuilder();
-			for (Map.Entry<String, String> entry : param.entrySet()) {
-				if (entry.getValue() != null && entry.getValue().length() > 0) {
-					sb.append(entry.getKey()).append("=")
-							.append(entry.getValue()).append("&");
-				}
-			}
-			if (sb.length() > 0) {
-				sb.deleteCharAt(sb.length() - 1);
-			}
-			if ("MD5".equals(signType)) {
-				return sign.toLowerCase().equals(
-						md5(sb.toString().getBytes("UTF-8")).toLowerCase());
-			} else if("SM2".equals(signType)){
-				PublicKey publicKey = SmUtil.pubKeySM2FromBase64Str(appkey);
-				return SmUtil.verifySM3SM2(publicKey, "Allinpay", Base64.decodeBase64(sign), sb.toString().getBytes("UTF-8"));
-			}else {
-				return rsaVerifyPublickey(sb.toString(), sign, appkey, "UTF-8");
-			}
-		}
-		return false;
-	}
-
-	public static boolean rsaVerifyPublickey(String content, String sign,
-			String publicKey, String charset) throws Exception {
-		try {
-			PublicKey pubKey = getPublicKeyFromX509("RSA",
-					Base64.decodeBase64(publicKey.getBytes()));
-			return rsaVerifyPublickey(content, sign, pubKey, charset);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw new Exception("RSAcontent = " + content + ",sign=" + sign
-					+ ",charset = " + charset, e);
-		}
-	}
-
-	public static boolean rsaVerifyPublickey(String content, String sign,
-			PublicKey pubKey, String charset) throws Exception {
-		try {
-			java.security.Signature signature = java.security.Signature
-					.getInstance("SHA1WithRSA");
-
-			signature.initVerify(pubKey);
-
-			if (charset == null || "".equals(charset)) {
-				signature.update(content.getBytes());
-			} else {
-				signature.update(content.getBytes(charset));
-			}
-
-			return signature.verify(Base64.decodeBase64(sign.getBytes()));
-		} catch (Exception e) {
-			throw e;
-		}
-	}
-	public static String unionSign(TreeMap<String, String> params,String appkey,
-			String signType) throws Exception {
-		// TODO Auto-generated method stub
-
-		params.remove("sign");
-		if ("MD5".equals(signType)) {// 如果是md5则需要把md5的key加入到排序
-			params.put("key", appkey);
-		}
-		StringBuilder sb = new StringBuilder();
-		for (Map.Entry<String, String> entry : params.entrySet()) {
-			if (entry.getValue() != null && entry.getValue().length() > 0) {
-				sb.append(entry.getKey()).append("=").append(entry.getValue())
-						.append("&");
-			}
-		}
-		if (sb.length() > 0) {
-			sb.deleteCharAt(sb.length() - 1);
-		}
-		String sign = "";
-		if ("MD5".equals(signType)) {
-			System.out.println(sb.toString());
-			sign = md5(sb.toString().getBytes("UTF-8"));// 记得是md5编码的加签
-			params.remove("key");
-		} else if("SM2".equals(signType)){
-			System.out.println(sb.toString());
-			PrivateKey privkey = SmUtil.privKeySM2FromBase64Str(appkey);
-			sign = SmUtil.signSM3SM2RetBase64(privkey, params.get("appid"), sb.toString().getBytes("UTF-8"));//签名
-		} else {
-			System.out.println(sb.toString());
-			sign = rsaSign(sb.toString(), appkey, "UTF-8");
-		}
-		return sign;
-	}
-
-	public static String rsaSign(String content, String privateKey,
-			String charset) throws Exception {
-		PrivateKey priKey = getPrivateKeyFromPKCS8("RSA",
-				Base64.decodeBase64(privateKey.getBytes()));
-		return rsaSign(content, priKey, charset);
-	}
-
-	public static String rsaSign(String content, byte[] privateKey,
-			String charset) throws Exception {
-		PrivateKey priKey = getPrivateKeyFromPKCS8("RSA", privateKey);
-		return rsaSign(content, priKey, charset);
-	}
-
-	public static String rsaSign(String content, PrivateKey priKey,
-			String charset) throws Exception {
-		java.security.Signature signature = java.security.Signature
-				.getInstance("SHA1WithRSA");
-		signature.initSign(priKey);
-		if (charset == null || "".equals(charset)) {
-			signature.update(content.getBytes());
-		} else {
-			signature.update(content.getBytes(charset));
-		}
-		byte[] signed = signature.sign();
-
-		return new String(Base64.encodeBase64(signed));
-	}
-
-	public static PrivateKey getPrivateKeyFromPKCS8(String algorithm,
-			byte[] encodedKey) throws Exception {
-
-		KeyFactory keyFactory = KeyFactory.getInstance(algorithm);
-
-		return keyFactory.generatePrivate(new PKCS8EncodedKeySpec(encodedKey));
-	}
-
-	public static PublicKey getPublicKeyFromX509(String algorithm,
-			byte[] encodedKey) throws Exception {
-		KeyFactory keyFactory = KeyFactory.getInstance(algorithm);
-
-		return keyFactory.generatePublic(new X509EncodedKeySpec(encodedKey));
-	}
-}

+ 0 - 47
src/main/java/common/utils/tl/h5_demo/java/h5demo/src/com/allinpay/syb/test/ApiTestV2.java

@@ -1,47 +0,0 @@
-package com.allinpay.syb.test;
-
-import java.util.Map;
-
-import com.allinpay.syb.lib.SybPayService;
-import com.allinpay.syb.lib.SybUtil;
-
-
-public class ApiTestV2 {
-	public static void main(String[] args) throws Exception{
-		testCancel();
-		//testRefund();
-//		testQuery();
-	}
-	
-	public static void testQuery() throws Exception{
-		SybPayService service = new SybPayService();
-		Map<String, String> map = service.query("", "112094120001239205");
-		print(map);
-	}
-	
-	public static void testRefund() throws Exception{
-		SybPayService service = new SybPayService();
-		String reqsn = String.valueOf(System.currentTimeMillis());
-		Map<String, String> map = service.refund(1, reqsn, "", "20160712167578.2547");
-		print(map);
-	}
-	
-	public static void testCancel() throws Exception{
-		SybPayService service = new SybPayService();
-		String reqsn = String.valueOf(System.currentTimeMillis());
-		Map<String, String> map = service.cancel(1, reqsn, "112094120001239205", "");
-		print(map);
-	}
-	
-	
-	public static void print(Map<String, String> map){
-		System.out.println("返回数据如下:");
-		if(map!=null){
-			for(String key:map.keySet()){
-				System.out.println(key+";"+map.get(key));
-			}
-		}
-	}
-	
-	
-}

+ 0 - 68
src/main/java/common/utils/tl/h5_demo/java/h5demo/src/com/allinpay/syb/test/NotifyServlet.java

@@ -1,68 +0,0 @@
-package com.allinpay.syb.test;
-
-import java.io.IOException;
-import java.util.Map;
-import java.util.TreeMap;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import com.allinpay.syb.lib.SybConstants;
-import com.allinpay.syb.lib.SybUtil;
-
-public class NotifyServlet extends HttpServlet {
-	private static final long serialVersionUID = 1L;
-       
-    public NotifyServlet() {
-        super();
-    }
-
-	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-		System.out.println("get method,no deal");
-	}
-
-	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-		System.out.println("接收到通知");
-		request.setCharacterEncoding("UTF-8");//通知传输的编码为GBK
-		response.setCharacterEncoding("UTF-8");
-		TreeMap<String,String> params = getParams(request);//动态遍历获取所有收到的参数,此步非常关键,因为收银宝以后可能会加字段,动态获取可以兼容
-		try {
-			String appkey = "";
-			if("RSA".equals(params.get("signtype")))
-				appkey = SybConstants.SYB_RSATLPUBKEY;
-			else if("SM2".equals(params.get("signtype")))
-				appkey = SybConstants.SYB_SM2TLPUBKEY;
-			else 
-				appkey = SybConstants.SYB_MD5_APPKEY;
-			boolean isSign = SybUtil.validSign(params, appkey, params.get("signtype"));// 接受到推送通知,首先验签
-			System.out.println("验签结果:"+isSign);
-			//验签完毕进行业务处理
-		} catch (Exception e) {//处理异常
-			// TODO: handle exception
-			e.printStackTrace();
-		}
-		finally{//收到通知,返回success
-			response.getOutputStream().write("success".getBytes());
-			response.flushBuffer();
-		}
-	}
-	
-	/**
-	 * 动态遍历获取所有收到的参数,此步非常关键,因为收银宝以后可能会加字段,动态获取可以兼容由于收银宝加字段而引起的签名异常
-	 * @param request
-	 * @return
-	 */
-	private TreeMap<String, String> getParams(HttpServletRequest request){
-		TreeMap<String, String> map = new TreeMap<String, String>();
-		Map reqMap = request.getParameterMap();
-		for(Object key:reqMap.keySet()){
-			String value = ((String[])reqMap.get(key))[0];
-			System.out.println(key+";"+value);
-			map.put(key.toString(),value);
-		}
-		return map;
-	}
-
-}

BIN
src/main/java/common/utils/tl/h5_demo/java_com_lib/bcpkix-jdk15on-1.59.jar


BIN
src/main/java/common/utils/tl/h5_demo/java_com_lib/bcprov-ext-jdk15on-1.59.jar


BIN
src/main/java/common/utils/tl/h5_demo/java_com_lib/bcprov-jdk15on-1.59.jar


BIN
src/main/java/common/utils/tl/h5_demo/java_com_lib/commons-beanutils-1.8.3.jar


BIN
src/main/java/common/utils/tl/h5_demo/java_com_lib/commons-codec-1.11.jar


BIN
src/main/java/common/utils/tl/h5_demo/java_com_lib/commons-collections-3.2.1.jar


BIN
src/main/java/common/utils/tl/h5_demo/java_com_lib/commons-lang-2.6.jar


BIN
src/main/java/common/utils/tl/h5_demo/java_com_lib/commons-logging-1.1.3.jar


BIN
src/main/java/common/utils/tl/h5_demo/java_com_lib/ezmorph-1.0.6.jar


BIN
src/main/java/common/utils/tl/h5_demo/java_com_lib/json-lib-2.4-jdk15.jar


Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio