(MCH)生成 native 支付回复XML

@param mchPayNativeReply
mchPayNativeReply
@param key
key
@return xml
765873
public static String generateMchPayNativeReplyXML(MchPayNativeReply mchPayNativeReply, String key) {
		Map<String, String> map = MapUtil.objectToMap(mchPayNativeReply);
		String sign = SignatureUtil.generateSign(map, key);
		mchPayNativeReply.setSign(sign);
		return XMLConverUtil.convertToXML(mchPayNativeReply);
	}
1302373
public final PJsonArray getJSONArray(final String key) {
        final JSONArray val = this.obj.optJSONArray(key);
        if (val == null) {
            throw new ObjectMissingException(this, key);
        }
        return new PJsonArray(this, val, key);
    }
794066
private String generateKey(String key,
      HashMap<String, String[]>[] queryVariables) {
    StringBuilder newKey = new StringBuilder(key);
    newKey.append(" -");
    for (int q = 0; q < queryVariables.length; q++) {
      if (queryVariables[q] != null && queryVariables[q].size() > 0) {
        for (String name : queryVariables[q].keySet()) {
          newKey.append(" q" + q + ":$" + name + "=");
          if (queryVariables[q].get(name) != null
              && queryVariables[q].get(name).length == 1) {
            newKey.append("'" + queryVariables[q].get(name)[0]
                .replace("\\", "\\\\").replace(",", "\\,") + "'");
          } else {
            newKey.append("-");
          }
        }
      }
    }
    return newKey.toString();
  }
1341282
public Map<String, String> getMBeanAttributes(String key) throws Exception {
        return getMBeanAttributes(new ObjectName(key));
    }
1235740
public static MchPayApp generateMchAppData(String prepay_id, String appId, String partnerid, String key) {
		Map<String, String> wx_map = new LinkedHashMap<String, String>();
		wx_map.put("appid", appId);
		wx_map.put("partnerid", partnerid);
		wx_map.put("prepayid", prepay_id);
		wx_map.put("package", "Sign=WXPay");
		wx_map.put("noncestr", UUID.randomUUID().toString().replace("-", ""));
		wx_map.put("timestamp", System.currentTimeMillis() / 1000 + "");
		String sign = SignatureUtil.generateSign(wx_map, key);
		MchPayApp mchPayApp = new MchPayApp();
		mchPayApp.setAppid(appId);
		mchPayApp.setPartnerid(partnerid);
		mchPayApp.setPrepayid(prepay_id);
		mchPayApp.setPackage_(wx_map.get("package"));
		mchPayApp.setNoncestr(wx_map.get("noncestr"));
		mchPayApp.setTimestamp(wx_map.get("timestamp"));
		mchPayApp.setSign(sign);
		return mchPayApp;
	}
746881
public static MchReverseResult secapiPayReverse(MchReverse mchReverse,String key){
		Map<String,String> map = MapUtil.objectToMap( mchReverse);
		String sign = SignatureUtil.generateSign(map,mchReverse.getSign_type(),key);
		mchReverse.setSign(sign);
		String secapiPayRefundXML = XMLConverUtil.convertToXML( mchReverse);
		HttpUriRequest httpUriRequest = RequestBuilder.post()
				.setHeader(xmlHeader)
				.setUri(baseURI()+ "/secapi/pay/reverse")
				.setEntity(new StringEntity(secapiPayRefundXML,Charset.forName("utf-8")))
				.build();
		return LocalHttpClient.keyStoreExecuteXmlResult(mchReverse.getMch_id(),httpUriRequest,MchReverseResult.class,mchReverse.getSign_type(),key);
	}
938440
protected static <T> IKey<T> newKey(final String key, final T defaultValue) {
        return new Key<T>(key, defaultValue);
    }
810276
@SuppressWarnings("unchecked")
    public ApiKey getApiKey(final String key) {
        final Query query = pm.newQuery(ApiKey.class, "key == :key");
        final List<ApiKey> result = (List<ApiKey>) query.execute(key);
        return Collections.isEmpty(result) ? null : result.get(0);
    }
1015580
protected String generateCacheKey(HttpServletRequest request, Map<String, ICacheKeyGenerator> cacheKeyGenerators) throws IOException {
		String cacheKey = null;
		if (cacheKeyGenerators != null) {
			// First, decompose any composite cache key generators into their
			// constituent cache key generators so that we can combine them
			// more effectively.  Use TreeMap to get predictable ordering of
			// keys.
			Map<String, ICacheKeyGenerator> gens = new TreeMap<String, ICacheKeyGenerator>();
			for (ICacheKeyGenerator gen : cacheKeyGenerators.values()) {
				List<ICacheKeyGenerator> constituentGens = gen.getCacheKeyGenerators(request);
				addCacheKeyGenerators(gens,
						constituentGens == null ?
								Arrays.asList(new ICacheKeyGenerator[]{gen}) :
									constituentGens);
			}
			cacheKey = KeyGenUtil.generateKey(
					request,
					gens.values());
		}
		return cacheKey;
	}
195525
public static String generateMchPayJsRequestJson(String prepay_id, String appId, String key) {
		String package_ = "prepay_id=" + prepay_id;
		Map<String, String> map = new LinkedHashMap<String, String>();
		map.put("appId", appId);
		map.put("nonceStr", UUID.randomUUID().toString().replace("-", ""));
		map.put("package", package_);
		map.put("signType", "MD5");
		map.put("timeStamp", System.currentTimeMillis() / 1000 + "");
		String paySign = SignatureUtil.generateSign(map, key);
		map.put("paySign", paySign);
		return JsonUtil.toJSONString(map);
	}
715371
public void putNative(String key, Object value)
    {
        String strValue = null;
        if (value != null)
            strValue = value.toString();
        CreateMode createMode = CreateMode.DONT_CREATE;
        if (value != null)
        {
            createMode = CreateMode.CREATE_IF_NOT_FOUND;
            if (Util.isCData(strValue))
                createMode = CreateMode.CREATE_CDATA_NODE;
        }
        Node node = this.getNode(null, key, createMode, true);
        if (node != null)
        {
            if (strValue != null)
                node.setNodeValue(strValue);
            else
                node.getParentNode().removeChild(node);
        }
    }
772288
public static PagerDuty create(String apiKey) {
    Retrofit retrofit = new Retrofit.Builder() //
        .baseUrl(HOST) //
        .addConverterFactory(GsonConverterFactory.create())
        .build();
    return create(apiKey, retrofit);
  }
6483
public static PappayapplyResult payPappayapply(Pappayapply pappayapply,String key){
		Map<String,String> map = MapUtil.objectToMap( pappayapply);
		String sign = SignatureUtil.generateSign(map,pappayapply.getSign_type(),key);
		pappayapply.setSign(sign);
		String secapiPayRefundXML = XMLConverUtil.convertToXML( pappayapply);
		HttpUriRequest httpUriRequest = RequestBuilder.post()
				.setHeader(xmlHeader)
				.setUri(baseURI()+ "/pay/pappayapply")
				.setEntity(new StringEntity(secapiPayRefundXML,Charset.forName("utf-8")))
				.build();
		return LocalHttpClient.executeXmlResult(httpUriRequest,PappayapplyResult.class,pappayapply.getSign_type(),key);
	}
1359505
public XAttributeList createAttributeList(String key, XExtension extension) {
		return new XAttributeListImpl(intern(key), extension);
	}
672018
public void add(final ITopicNode specTopic, final String key) {
        if (specTopic == null) return;

        final Integer topicId = specTopic.getDBId();
        if (!topics.containsKey(topicId)) {
            topics.put(topicId, new LinkedList<ITopicNode>());
        }

        // Make sure the key exists
        if (!topicsKeys.containsKey(key)) {
            topicsKeys.put(key, new LinkedList<ITopicNode>());
        }

        topics.get(topicId).add(specTopic);
        topicsKeys.get(key).add(specTopic);
    }
1162475
public static CorrelationKey unmarshalCorrelationKey( String key ) {
        CorrelationKeyFactory factory = KieInternalServices.Factory.get().newCorrelationKeyFactory();
        if( key == null || key.isEmpty() ) {
           return factory.newCorrelationKey(Collections.EMPTY_LIST);
        }
        List<String> keys = new ArrayList<String>();
        for( String k : key.split(":") ) {
            keys.add(k);
        }
        return KieInternalServices.Factory.get().newCorrelationKeyFactory().newCorrelationKey(keys);
    }
1231401
public static MchOrderInfoResult payPaporderquery(MchOrderquery mchOrderquery,String key){
		Map<String,String> map = MapUtil.objectToMap(mchOrderquery);
		String sign = SignatureUtil.generateSign(map,mchOrderquery.getSign_type(),key);
		mchOrderquery.setSign(sign);
		String closeorderXML = XMLConverUtil.convertToXML(mchOrderquery);
		HttpUriRequest httpUriRequest = RequestBuilder.post()
				.setHeader(xmlHeader)
				.setUri(baseURI()+ "/pay/paporderquery")
				.setEntity(new StringEntity(closeorderXML,Charset.forName("utf-8")))
				.build();
		return LocalHttpClient.executeXmlResult(httpUriRequest,MchOrderInfoResult.class,mchOrderquery.getSign_type(),key);
	}