com.alipay.api.internal.util.AlipayUtils Java Examples
The following examples show how to use
com.alipay.api.internal.util.AlipayUtils.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ProtocolData.java From alipay-sdk-java-all with Apache License 2.0 | 5 votes |
public static String genStreamId() { long cur = System.currentTimeMillis(); StringBuilder sb = new StringBuilder(); sb.append("c"); sb.append(AlipayUtils.toRadix62Str(cur, 8)); sb.append(RANDOM_NUM); int curSeq = seq.getAndIncrement(); // 3位62进制数最大值为238327 if (curSeq >= 200000) { seq.set(0); } sb.append(AlipayUtils.toRadix62Str(curSeq, 3)); return sb.toString(); }
Example #2
Source File: DefaultAlipayClient.java From alipay-sdk with Apache License 2.0 | 5 votes |
/** * * * @param request * @param accessToken * @param appAuthToken * @return * @throws AlipayApiException */ private <T extends AlipayResponse> Map<String, Object> doPost(AlipayRequest<T> request, String accessToken, String appAuthToken) throws AlipayApiException { Map<String, Object> result = new HashMap<String, Object>(); RequestParametersHolder requestHolder = getRequestHolderWithSign(request, accessToken, appAuthToken); String url = getRequestUrl(requestHolder); // 打印完整请求报文 if (AlipayLogger.isBizDebugEnabled()) { AlipayLogger.logBizDebug(getRedirectUrl(requestHolder)); } String rsp = null; try { if (request instanceof AlipayUploadRequest) { AlipayUploadRequest<T> uRequest = (AlipayUploadRequest<T>) request; Map<String, FileItem> fileParams = AlipayUtils.cleanupMap(uRequest.getFileParams()); rsp = WebUtils.doPost(url, requestHolder.getApplicationParams(), fileParams, charset, connectTimeout, readTimeout, proxyHost, proxyPort); } else { rsp = WebUtils.doPost(url, requestHolder.getApplicationParams(), charset, connectTimeout, readTimeout, proxyHost, proxyPort); } } catch (IOException e) { throw new AlipayApiException(e); } result.put("rsp", rsp); result.put("textParams", requestHolder.getApplicationParams()); result.put("protocalMustParams", requestHolder.getProtocalMustParams()); result.put("protocalOptParams", requestHolder.getProtocalOptParams()); result.put("url", url); return result; }
Example #3
Source File: DefaultAlipayClient.java From pay with Apache License 2.0 | 5 votes |
/** * * * @param request * @param accessToken * @param signType * @return * @throws AlipayApiException */ private <T extends AlipayResponse> Map<String, Object> doPost(AlipayRequest<T> request, String accessToken, String appAuthToken) throws AlipayApiException { Map<String, Object> result = new HashMap<String, Object>(); RequestParametersHolder requestHolder = getRequestHolderWithSign(request, accessToken, appAuthToken); String url = getRequestUrl(requestHolder); // 打印完整请求报文 if (AlipayLogger.isBizDebugEnabled()) { AlipayLogger.logBizDebug(getRedirectUrl(requestHolder)); } String rsp = null; try { if (request instanceof AlipayUploadRequest) { AlipayUploadRequest<T> uRequest = (AlipayUploadRequest<T>) request; Map<String, FileItem> fileParams = AlipayUtils.cleanupMap(uRequest.getFileParams()); rsp = WebUtils.doPost(url, requestHolder.getApplicationParams(), fileParams, charset, connectTimeout, readTimeout); } else { rsp = WebUtils.doPost(url, requestHolder.getApplicationParams(), charset, connectTimeout, readTimeout); } } catch (IOException e) { throw new AlipayApiException(e); } result.put("rsp", rsp); result.put("textParams", requestHolder.getApplicationParams()); result.put("protocalMustParams", requestHolder.getProtocalMustParams()); result.put("protocalOptParams", requestHolder.getProtocalOptParams()); result.put("url", url); return result; }
Example #4
Source File: FileItem.java From alipay-sdk-java-all with Apache License 2.0 | 4 votes |
public String getMimeType() throws IOException { if (this.mimeType == null) { this.mimeType = AlipayUtils.getMimeType(getContent()); } return this.mimeType; }
Example #5
Source File: FileItem.java From alipay-sdk with Apache License 2.0 | 4 votes |
public String getMimeType() throws IOException { if (this.mimeType == null) { this.mimeType = AlipayUtils.getMimeType(getContent()); } return this.mimeType; }
Example #6
Source File: FileItem.java From pay with Apache License 2.0 | 4 votes |
public String getMimeType() throws IOException { if (this.mimeType == null) { this.mimeType = AlipayUtils.getMimeType(getContent()); } return this.mimeType; }