Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* 支付宝开放平台API
* 支付宝开放平台v3协议文档
*
* The version of the OpenAPI document: 2024-11-12
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.alipay.v3.api;
import com.alipay.v3.ApiCallback;
import com.alipay.v3.ApiClient;
import com.alipay.v3.ApiException;
import com.alipay.v3.ApiResponse;
import com.alipay.v3.Configuration;
import com.alipay.v3.Pair;
import com.alipay.v3.ProgressRequestBody;
import com.alipay.v3.ProgressResponseBody;
import com.alipay.v3.util.AlipayLogger;
import com.alipay.v3.util.model.CustomizedParams;
import com.google.common.base.Strings;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.alipay.v3.model.AlipayTradeCancelDefaultResponse;
import com.alipay.v3.model.AlipayTradeCancelModel;
import com.alipay.v3.model.AlipayTradeCancelResponseModel;
import com.alipay.v3.model.AlipayTradeCloseDefaultResponse;
import com.alipay.v3.model.AlipayTradeCloseModel;
import com.alipay.v3.model.AlipayTradeCloseResponseModel;
import com.alipay.v3.model.AlipayTradeCreateDefaultResponse;
import com.alipay.v3.model.AlipayTradeCreateModel;
import com.alipay.v3.model.AlipayTradeCreateResponseModel;
import com.alipay.v3.model.AlipayTradePayDefaultResponse;
import com.alipay.v3.model.AlipayTradePayModel;
import com.alipay.v3.model.AlipayTradePayResponseModel;
import com.alipay.v3.model.AlipayTradePrecreateDefaultResponse;
import com.alipay.v3.model.AlipayTradePrecreateModel;
import com.alipay.v3.model.AlipayTradePrecreateResponseModel;
import com.alipay.v3.model.AlipayTradeQueryDefaultResponse;
import com.alipay.v3.model.AlipayTradeQueryModel;
import com.alipay.v3.model.AlipayTradeQueryResponseModel;
import com.alipay.v3.model.AlipayTradeRefundDefaultResponse;
import com.alipay.v3.model.AlipayTradeRefundModel;
import com.alipay.v3.model.AlipayTradeRefundResponseModel;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class AlipayTradeApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public AlipayTradeApi() {
this(Configuration.getDefaultApiClient());
}
public AlipayTradeApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for cancel
* @param alipayTradeCancelModel (optional)
* @param _callback Callback for upload/download progress
* @param customizedParams
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
*/
public okhttp3.Call cancelCall(AlipayTradeCancelModel alipayTradeCancelModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = (customizedParams != null && !Strings.isNullOrEmpty(customizedParams.getBodyContent()))
? customizedParams.getBodyContent() : alipayTradeCancelModel;
// create path and map variables
String localVarPath = "/v3/alipay/trade/cancel";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
if (customizedParams != null) {
//额外query参数
if (customizedParams.getQueryParams() != null && customizedParams.getQueryParams().size() > 0) {
for (Map.Entry entry : customizedParams.getQueryParams().entrySet()) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair(entry.getKey(), entry.getValue()));
}
}
if (!Strings.isNullOrEmpty(customizedParams.getAppAuthToken())) {
localVarHeaderParams.put("alipay-app-auth-token", customizedParams.getAppAuthToken());
}
//额外非全局header参数
if (customizedParams.getHeaderParams() != null && customizedParams.getHeaderParams().size() > 0) {
localVarHeaderParams.putAll(customizedParams.getHeaderParams());
}
}
String[] localVarAuthNames = new String[] { };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call cancelValidateBeforeCall(AlipayTradeCancelModel alipayTradeCancelModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException {
okhttp3.Call localVarCall = cancelCall(alipayTradeCancelModel, _callback, customizedParams);
return localVarCall;
}
/**
* 统一收单交易撤销接口
* 支付交易返回失败或支付系统超时,调用该接口撤销交易。如果此订单用户支付失败,支付宝系统会将此订单关闭;如果用户支付成功,支付宝系统会将此订单资金退还给用户。 注意:只有发生支付系统超时或者支付结果未知时可调用撤销,其他正常支付的单如需实现相同功能请调用申请退款API。提交支付交易后调用【查询订单API】,没有明确的支付结果再调用【撤销订单API】。
* @param alipayTradeCancelModel (optional)
* @return AlipayTradeCancelResponseModel
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
*/
public AlipayTradeCancelResponseModel cancel(AlipayTradeCancelModel alipayTradeCancelModel) throws ApiException {
ApiResponse localVarResp = cancelWithHttpInfo(alipayTradeCancelModel, null);
return localVarResp.getData();
}
public AlipayTradeCancelResponseModel cancel(AlipayTradeCancelModel alipayTradeCancelModel, CustomizedParams customizedParams) throws ApiException {
ApiResponse localVarResp = cancelWithHttpInfo(alipayTradeCancelModel, customizedParams);
return localVarResp.getData();
}
/**
* 统一收单交易撤销接口
* 支付交易返回失败或支付系统超时,调用该接口撤销交易。如果此订单用户支付失败,支付宝系统会将此订单关闭;如果用户支付成功,支付宝系统会将此订单资金退还给用户。 注意:只有发生支付系统超时或者支付结果未知时可调用撤销,其他正常支付的单如需实现相同功能请调用申请退款API。提交支付交易后调用【查询订单API】,没有明确的支付结果再调用【撤销订单API】。
* @param alipayTradeCancelModel (optional)
* @return ApiResponse<AlipayTradeCancelResponseModel>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
*/
public ApiResponse cancelWithHttpInfo(AlipayTradeCancelModel alipayTradeCancelModel, CustomizedParams customizedParams) throws ApiException {
okhttp3.Call localVarCall = cancelValidateBeforeCall(alipayTradeCancelModel, null, customizedParams);
try {
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
try {
e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType()));
} catch (Exception ex) {
AlipayLogger.logBizWarn(ex);
}
throw e;
}
}
/**
* 统一收单交易撤销接口 (asynchronously)
* 支付交易返回失败或支付系统超时,调用该接口撤销交易。如果此订单用户支付失败,支付宝系统会将此订单关闭;如果用户支付成功,支付宝系统会将此订单资金退还给用户。 注意:只有发生支付系统超时或者支付结果未知时可调用撤销,其他正常支付的单如需实现相同功能请调用申请退款API。提交支付交易后调用【查询订单API】,没有明确的支付结果再调用【撤销订单API】。
* @param alipayTradeCancelModel (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
* @deprecated
*/
@Deprecated
public okhttp3.Call cancelAsync(AlipayTradeCancelModel alipayTradeCancelModel, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = cancelValidateBeforeCall(alipayTradeCancelModel, _callback, null);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
@Deprecated
public okhttp3.Call cancelAsync(AlipayTradeCancelModel alipayTradeCancelModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException {
okhttp3.Call localVarCall = cancelValidateBeforeCall(alipayTradeCancelModel, _callback, customizedParams);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for close
* @param alipayTradeCloseModel (optional)
* @param _callback Callback for upload/download progress
* @param customizedParams
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
*/
public okhttp3.Call closeCall(AlipayTradeCloseModel alipayTradeCloseModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = (customizedParams != null && !Strings.isNullOrEmpty(customizedParams.getBodyContent()))
? customizedParams.getBodyContent() : alipayTradeCloseModel;
// create path and map variables
String localVarPath = "/v3/alipay/trade/close";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
if (customizedParams != null) {
//额外query参数
if (customizedParams.getQueryParams() != null && customizedParams.getQueryParams().size() > 0) {
for (Map.Entry entry : customizedParams.getQueryParams().entrySet()) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair(entry.getKey(), entry.getValue()));
}
}
if (!Strings.isNullOrEmpty(customizedParams.getAppAuthToken())) {
localVarHeaderParams.put("alipay-app-auth-token", customizedParams.getAppAuthToken());
}
//额外非全局header参数
if (customizedParams.getHeaderParams() != null && customizedParams.getHeaderParams().size() > 0) {
localVarHeaderParams.putAll(customizedParams.getHeaderParams());
}
}
String[] localVarAuthNames = new String[] { };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call closeValidateBeforeCall(AlipayTradeCloseModel alipayTradeCloseModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException {
okhttp3.Call localVarCall = closeCall(alipayTradeCloseModel, _callback, customizedParams);
return localVarCall;
}
/**
* 统一收单交易关闭接口
* 用于交易创建后,用户在一定时间内未进行支付,可调用该接口直接将未付款的交易进行关闭。
* @param alipayTradeCloseModel (optional)
* @return AlipayTradeCloseResponseModel
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
*/
public AlipayTradeCloseResponseModel close(AlipayTradeCloseModel alipayTradeCloseModel) throws ApiException {
ApiResponse localVarResp = closeWithHttpInfo(alipayTradeCloseModel, null);
return localVarResp.getData();
}
public AlipayTradeCloseResponseModel close(AlipayTradeCloseModel alipayTradeCloseModel, CustomizedParams customizedParams) throws ApiException {
ApiResponse localVarResp = closeWithHttpInfo(alipayTradeCloseModel, customizedParams);
return localVarResp.getData();
}
/**
* 统一收单交易关闭接口
* 用于交易创建后,用户在一定时间内未进行支付,可调用该接口直接将未付款的交易进行关闭。
* @param alipayTradeCloseModel (optional)
* @return ApiResponse<AlipayTradeCloseResponseModel>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
*/
public ApiResponse closeWithHttpInfo(AlipayTradeCloseModel alipayTradeCloseModel, CustomizedParams customizedParams) throws ApiException {
okhttp3.Call localVarCall = closeValidateBeforeCall(alipayTradeCloseModel, null, customizedParams);
try {
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
try {
e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType()));
} catch (Exception ex) {
AlipayLogger.logBizWarn(ex);
}
throw e;
}
}
/**
* 统一收单交易关闭接口 (asynchronously)
* 用于交易创建后,用户在一定时间内未进行支付,可调用该接口直接将未付款的交易进行关闭。
* @param alipayTradeCloseModel (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
* @deprecated
*/
@Deprecated
public okhttp3.Call closeAsync(AlipayTradeCloseModel alipayTradeCloseModel, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = closeValidateBeforeCall(alipayTradeCloseModel, _callback, null);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
@Deprecated
public okhttp3.Call closeAsync(AlipayTradeCloseModel alipayTradeCloseModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException {
okhttp3.Call localVarCall = closeValidateBeforeCall(alipayTradeCloseModel, _callback, customizedParams);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for create
* @param alipayTradeCreateModel (optional)
* @param _callback Callback for upload/download progress
* @param customizedParams
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
*/
public okhttp3.Call createCall(AlipayTradeCreateModel alipayTradeCreateModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = (customizedParams != null && !Strings.isNullOrEmpty(customizedParams.getBodyContent()))
? customizedParams.getBodyContent() : alipayTradeCreateModel;
// create path and map variables
String localVarPath = "/v3/alipay/trade/create";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
if (customizedParams != null) {
//额外query参数
if (customizedParams.getQueryParams() != null && customizedParams.getQueryParams().size() > 0) {
for (Map.Entry entry : customizedParams.getQueryParams().entrySet()) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair(entry.getKey(), entry.getValue()));
}
}
if (!Strings.isNullOrEmpty(customizedParams.getAppAuthToken())) {
localVarHeaderParams.put("alipay-app-auth-token", customizedParams.getAppAuthToken());
}
//额外非全局header参数
if (customizedParams.getHeaderParams() != null && customizedParams.getHeaderParams().size() > 0) {
localVarHeaderParams.putAll(customizedParams.getHeaderParams());
}
}
String[] localVarAuthNames = new String[] { };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createValidateBeforeCall(AlipayTradeCreateModel alipayTradeCreateModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException {
okhttp3.Call localVarCall = createCall(alipayTradeCreateModel, _callback, customizedParams);
return localVarCall;
}
/**
* 统一收单交易创建接口
* 商户通过该接口进行交易的创建下单
* @param alipayTradeCreateModel (optional)
* @return AlipayTradeCreateResponseModel
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
*/
public AlipayTradeCreateResponseModel create(AlipayTradeCreateModel alipayTradeCreateModel) throws ApiException {
ApiResponse localVarResp = createWithHttpInfo(alipayTradeCreateModel, null);
return localVarResp.getData();
}
public AlipayTradeCreateResponseModel create(AlipayTradeCreateModel alipayTradeCreateModel, CustomizedParams customizedParams) throws ApiException {
ApiResponse localVarResp = createWithHttpInfo(alipayTradeCreateModel, customizedParams);
return localVarResp.getData();
}
/**
* 统一收单交易创建接口
* 商户通过该接口进行交易的创建下单
* @param alipayTradeCreateModel (optional)
* @return ApiResponse<AlipayTradeCreateResponseModel>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
*/
public ApiResponse createWithHttpInfo(AlipayTradeCreateModel alipayTradeCreateModel, CustomizedParams customizedParams) throws ApiException {
okhttp3.Call localVarCall = createValidateBeforeCall(alipayTradeCreateModel, null, customizedParams);
try {
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
try {
e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType()));
} catch (Exception ex) {
AlipayLogger.logBizWarn(ex);
}
throw e;
}
}
/**
* 统一收单交易创建接口 (asynchronously)
* 商户通过该接口进行交易的创建下单
* @param alipayTradeCreateModel (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
* @deprecated
*/
@Deprecated
public okhttp3.Call createAsync(AlipayTradeCreateModel alipayTradeCreateModel, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = createValidateBeforeCall(alipayTradeCreateModel, _callback, null);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
@Deprecated
public okhttp3.Call createAsync(AlipayTradeCreateModel alipayTradeCreateModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException {
okhttp3.Call localVarCall = createValidateBeforeCall(alipayTradeCreateModel, _callback, customizedParams);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for pay
* @param alipayTradePayModel (optional)
* @param _callback Callback for upload/download progress
* @param customizedParams
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
*/
public okhttp3.Call payCall(AlipayTradePayModel alipayTradePayModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = (customizedParams != null && !Strings.isNullOrEmpty(customizedParams.getBodyContent()))
? customizedParams.getBodyContent() : alipayTradePayModel;
// create path and map variables
String localVarPath = "/v3/alipay/trade/pay";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
if (customizedParams != null) {
//额外query参数
if (customizedParams.getQueryParams() != null && customizedParams.getQueryParams().size() > 0) {
for (Map.Entry entry : customizedParams.getQueryParams().entrySet()) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair(entry.getKey(), entry.getValue()));
}
}
if (!Strings.isNullOrEmpty(customizedParams.getAppAuthToken())) {
localVarHeaderParams.put("alipay-app-auth-token", customizedParams.getAppAuthToken());
}
//额外非全局header参数
if (customizedParams.getHeaderParams() != null && customizedParams.getHeaderParams().size() > 0) {
localVarHeaderParams.putAll(customizedParams.getHeaderParams());
}
}
String[] localVarAuthNames = new String[] { };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call payValidateBeforeCall(AlipayTradePayModel alipayTradePayModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException {
okhttp3.Call localVarCall = payCall(alipayTradePayModel, _callback, customizedParams);
return localVarCall;
}
/**
* 统一收单交易支付接口
* 收银员使用扫码设备读取用户手机支付宝“付款码”获取设备(如扫码枪)读取用户手机支付宝的付款码信息后,将二维码或条码信息通过本接口上送至支付宝发起支付。
* @param alipayTradePayModel (optional)
* @return AlipayTradePayResponseModel
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
*/
public AlipayTradePayResponseModel pay(AlipayTradePayModel alipayTradePayModel) throws ApiException {
ApiResponse localVarResp = payWithHttpInfo(alipayTradePayModel, null);
return localVarResp.getData();
}
public AlipayTradePayResponseModel pay(AlipayTradePayModel alipayTradePayModel, CustomizedParams customizedParams) throws ApiException {
ApiResponse localVarResp = payWithHttpInfo(alipayTradePayModel, customizedParams);
return localVarResp.getData();
}
/**
* 统一收单交易支付接口
* 收银员使用扫码设备读取用户手机支付宝“付款码”获取设备(如扫码枪)读取用户手机支付宝的付款码信息后,将二维码或条码信息通过本接口上送至支付宝发起支付。
* @param alipayTradePayModel (optional)
* @return ApiResponse<AlipayTradePayResponseModel>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
*/
public ApiResponse payWithHttpInfo(AlipayTradePayModel alipayTradePayModel, CustomizedParams customizedParams) throws ApiException {
okhttp3.Call localVarCall = payValidateBeforeCall(alipayTradePayModel, null, customizedParams);
try {
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
try {
e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType()));
} catch (Exception ex) {
AlipayLogger.logBizWarn(ex);
}
throw e;
}
}
/**
* 统一收单交易支付接口 (asynchronously)
* 收银员使用扫码设备读取用户手机支付宝“付款码”获取设备(如扫码枪)读取用户手机支付宝的付款码信息后,将二维码或条码信息通过本接口上送至支付宝发起支付。
* @param alipayTradePayModel (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
* @deprecated
*/
@Deprecated
public okhttp3.Call payAsync(AlipayTradePayModel alipayTradePayModel, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = payValidateBeforeCall(alipayTradePayModel, _callback, null);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
@Deprecated
public okhttp3.Call payAsync(AlipayTradePayModel alipayTradePayModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException {
okhttp3.Call localVarCall = payValidateBeforeCall(alipayTradePayModel, _callback, customizedParams);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for precreate
* @param alipayTradePrecreateModel (optional)
* @param _callback Callback for upload/download progress
* @param customizedParams
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
*/
public okhttp3.Call precreateCall(AlipayTradePrecreateModel alipayTradePrecreateModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = (customizedParams != null && !Strings.isNullOrEmpty(customizedParams.getBodyContent()))
? customizedParams.getBodyContent() : alipayTradePrecreateModel;
// create path and map variables
String localVarPath = "/v3/alipay/trade/precreate";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
if (customizedParams != null) {
//额外query参数
if (customizedParams.getQueryParams() != null && customizedParams.getQueryParams().size() > 0) {
for (Map.Entry entry : customizedParams.getQueryParams().entrySet()) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair(entry.getKey(), entry.getValue()));
}
}
if (!Strings.isNullOrEmpty(customizedParams.getAppAuthToken())) {
localVarHeaderParams.put("alipay-app-auth-token", customizedParams.getAppAuthToken());
}
//额外非全局header参数
if (customizedParams.getHeaderParams() != null && customizedParams.getHeaderParams().size() > 0) {
localVarHeaderParams.putAll(customizedParams.getHeaderParams());
}
}
String[] localVarAuthNames = new String[] { };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call precreateValidateBeforeCall(AlipayTradePrecreateModel alipayTradePrecreateModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException {
okhttp3.Call localVarCall = precreateCall(alipayTradePrecreateModel, _callback, customizedParams);
return localVarCall;
}
/**
* 统一收单线下交易预创建
* 收银员通过收银台或商户后台调用支付宝接口,生成二维码后,展示给用户,由用户扫描二维码完成订单支付。
* @param alipayTradePrecreateModel (optional)
* @return AlipayTradePrecreateResponseModel
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
*/
public AlipayTradePrecreateResponseModel precreate(AlipayTradePrecreateModel alipayTradePrecreateModel) throws ApiException {
ApiResponse localVarResp = precreateWithHttpInfo(alipayTradePrecreateModel, null);
return localVarResp.getData();
}
public AlipayTradePrecreateResponseModel precreate(AlipayTradePrecreateModel alipayTradePrecreateModel, CustomizedParams customizedParams) throws ApiException {
ApiResponse localVarResp = precreateWithHttpInfo(alipayTradePrecreateModel, customizedParams);
return localVarResp.getData();
}
/**
* 统一收单线下交易预创建
* 收银员通过收银台或商户后台调用支付宝接口,生成二维码后,展示给用户,由用户扫描二维码完成订单支付。
* @param alipayTradePrecreateModel (optional)
* @return ApiResponse<AlipayTradePrecreateResponseModel>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
*/
public ApiResponse precreateWithHttpInfo(AlipayTradePrecreateModel alipayTradePrecreateModel, CustomizedParams customizedParams) throws ApiException {
okhttp3.Call localVarCall = precreateValidateBeforeCall(alipayTradePrecreateModel, null, customizedParams);
try {
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
try {
e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType()));
} catch (Exception ex) {
AlipayLogger.logBizWarn(ex);
}
throw e;
}
}
/**
* 统一收单线下交易预创建 (asynchronously)
* 收银员通过收银台或商户后台调用支付宝接口,生成二维码后,展示给用户,由用户扫描二维码完成订单支付。
* @param alipayTradePrecreateModel (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
* @deprecated
*/
@Deprecated
public okhttp3.Call precreateAsync(AlipayTradePrecreateModel alipayTradePrecreateModel, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = precreateValidateBeforeCall(alipayTradePrecreateModel, _callback, null);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
@Deprecated
public okhttp3.Call precreateAsync(AlipayTradePrecreateModel alipayTradePrecreateModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException {
okhttp3.Call localVarCall = precreateValidateBeforeCall(alipayTradePrecreateModel, _callback, customizedParams);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for query
* @param alipayTradeQueryModel (optional)
* @param _callback Callback for upload/download progress
* @param customizedParams
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
*/
public okhttp3.Call queryCall(AlipayTradeQueryModel alipayTradeQueryModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = (customizedParams != null && !Strings.isNullOrEmpty(customizedParams.getBodyContent()))
? customizedParams.getBodyContent() : alipayTradeQueryModel;
// create path and map variables
String localVarPath = "/v3/alipay/trade/query";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
if (customizedParams != null) {
//额外query参数
if (customizedParams.getQueryParams() != null && customizedParams.getQueryParams().size() > 0) {
for (Map.Entry entry : customizedParams.getQueryParams().entrySet()) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair(entry.getKey(), entry.getValue()));
}
}
if (!Strings.isNullOrEmpty(customizedParams.getAppAuthToken())) {
localVarHeaderParams.put("alipay-app-auth-token", customizedParams.getAppAuthToken());
}
//额外非全局header参数
if (customizedParams.getHeaderParams() != null && customizedParams.getHeaderParams().size() > 0) {
localVarHeaderParams.putAll(customizedParams.getHeaderParams());
}
}
String[] localVarAuthNames = new String[] { };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call queryValidateBeforeCall(AlipayTradeQueryModel alipayTradeQueryModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException {
okhttp3.Call localVarCall = queryCall(alipayTradeQueryModel, _callback, customizedParams);
return localVarCall;
}
/**
* 统一收单交易查询
* 该接口提供所有支付宝支付订单的查询,商户可以通过该接口主动查询订单状态,完成下一步的业务逻辑。 需要调用查询接口的情况: 当商户后台、网络、服务器等出现异常,商户系统最终未接收到支付通知; 调用支付接口后,返回系统错误或未知交易状态情况; 调用alipay.trade.pay,返回INPROCESS的状态; 调用alipay.trade.cancel之前,需确认支付状态;
* @param alipayTradeQueryModel (optional)
* @return AlipayTradeQueryResponseModel
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
*/
public AlipayTradeQueryResponseModel query(AlipayTradeQueryModel alipayTradeQueryModel) throws ApiException {
ApiResponse localVarResp = queryWithHttpInfo(alipayTradeQueryModel, null);
return localVarResp.getData();
}
public AlipayTradeQueryResponseModel query(AlipayTradeQueryModel alipayTradeQueryModel, CustomizedParams customizedParams) throws ApiException {
ApiResponse localVarResp = queryWithHttpInfo(alipayTradeQueryModel, customizedParams);
return localVarResp.getData();
}
/**
* 统一收单交易查询
* 该接口提供所有支付宝支付订单的查询,商户可以通过该接口主动查询订单状态,完成下一步的业务逻辑。 需要调用查询接口的情况: 当商户后台、网络、服务器等出现异常,商户系统最终未接收到支付通知; 调用支付接口后,返回系统错误或未知交易状态情况; 调用alipay.trade.pay,返回INPROCESS的状态; 调用alipay.trade.cancel之前,需确认支付状态;
* @param alipayTradeQueryModel (optional)
* @return ApiResponse<AlipayTradeQueryResponseModel>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
*/
public ApiResponse queryWithHttpInfo(AlipayTradeQueryModel alipayTradeQueryModel, CustomizedParams customizedParams) throws ApiException {
okhttp3.Call localVarCall = queryValidateBeforeCall(alipayTradeQueryModel, null, customizedParams);
try {
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
try {
e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType()));
} catch (Exception ex) {
AlipayLogger.logBizWarn(ex);
}
throw e;
}
}
/**
* 统一收单交易查询 (asynchronously)
* 该接口提供所有支付宝支付订单的查询,商户可以通过该接口主动查询订单状态,完成下一步的业务逻辑。 需要调用查询接口的情况: 当商户后台、网络、服务器等出现异常,商户系统最终未接收到支付通知; 调用支付接口后,返回系统错误或未知交易状态情况; 调用alipay.trade.pay,返回INPROCESS的状态; 调用alipay.trade.cancel之前,需确认支付状态;
* @param alipayTradeQueryModel (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
* @deprecated
*/
@Deprecated
public okhttp3.Call queryAsync(AlipayTradeQueryModel alipayTradeQueryModel, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = queryValidateBeforeCall(alipayTradeQueryModel, _callback, null);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
@Deprecated
public okhttp3.Call queryAsync(AlipayTradeQueryModel alipayTradeQueryModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException {
okhttp3.Call localVarCall = queryValidateBeforeCall(alipayTradeQueryModel, _callback, customizedParams);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for refund
* @param alipayTradeRefundModel (optional)
* @param _callback Callback for upload/download progress
* @param customizedParams
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
*/
public okhttp3.Call refundCall(AlipayTradeRefundModel alipayTradeRefundModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = (customizedParams != null && !Strings.isNullOrEmpty(customizedParams.getBodyContent()))
? customizedParams.getBodyContent() : alipayTradeRefundModel;
// create path and map variables
String localVarPath = "/v3/alipay/trade/refund";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
if (customizedParams != null) {
//额外query参数
if (customizedParams.getQueryParams() != null && customizedParams.getQueryParams().size() > 0) {
for (Map.Entry entry : customizedParams.getQueryParams().entrySet()) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair(entry.getKey(), entry.getValue()));
}
}
if (!Strings.isNullOrEmpty(customizedParams.getAppAuthToken())) {
localVarHeaderParams.put("alipay-app-auth-token", customizedParams.getAppAuthToken());
}
//额外非全局header参数
if (customizedParams.getHeaderParams() != null && customizedParams.getHeaderParams().size() > 0) {
localVarHeaderParams.putAll(customizedParams.getHeaderParams());
}
}
String[] localVarAuthNames = new String[] { };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call refundValidateBeforeCall(AlipayTradeRefundModel alipayTradeRefundModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException {
okhttp3.Call localVarCall = refundCall(alipayTradeRefundModel, _callback, customizedParams);
return localVarCall;
}
/**
* 统一收单交易退款接口
* 当交易发生之后一段时间内,由于买家或者卖家的原因需要退款时,卖家可以通过退款接口将支付款退还给买家,支付宝将在收到退款请求并且验证成功之后,按照退款规则将支付款按原路退到买家帐号上。 交易超过约定时间(签约时设置的可退款时间)的订单无法进行退款。 支付宝退款支持单笔交易分多次退款,多次退款需要提交原支付订单的订单号和设置不同的退款请求号。一笔退款失败后重新提交,要保证重试时退款请求号不能变更,防止该笔交易重复退款。 同一笔交易累计提交的退款金额不能超过原始交易总金额。
* @param alipayTradeRefundModel (optional)
* @return AlipayTradeRefundResponseModel
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
*/
public AlipayTradeRefundResponseModel refund(AlipayTradeRefundModel alipayTradeRefundModel) throws ApiException {
ApiResponse localVarResp = refundWithHttpInfo(alipayTradeRefundModel, null);
return localVarResp.getData();
}
public AlipayTradeRefundResponseModel refund(AlipayTradeRefundModel alipayTradeRefundModel, CustomizedParams customizedParams) throws ApiException {
ApiResponse localVarResp = refundWithHttpInfo(alipayTradeRefundModel, customizedParams);
return localVarResp.getData();
}
/**
* 统一收单交易退款接口
* 当交易发生之后一段时间内,由于买家或者卖家的原因需要退款时,卖家可以通过退款接口将支付款退还给买家,支付宝将在收到退款请求并且验证成功之后,按照退款规则将支付款按原路退到买家帐号上。 交易超过约定时间(签约时设置的可退款时间)的订单无法进行退款。 支付宝退款支持单笔交易分多次退款,多次退款需要提交原支付订单的订单号和设置不同的退款请求号。一笔退款失败后重新提交,要保证重试时退款请求号不能变更,防止该笔交易重复退款。 同一笔交易累计提交的退款金额不能超过原始交易总金额。
* @param alipayTradeRefundModel (optional)
* @return ApiResponse<AlipayTradeRefundResponseModel>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
*/
public ApiResponse refundWithHttpInfo(AlipayTradeRefundModel alipayTradeRefundModel, CustomizedParams customizedParams) throws ApiException {
okhttp3.Call localVarCall = refundValidateBeforeCall(alipayTradeRefundModel, null, customizedParams);
try {
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} catch (ApiException e) {
try {
e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType()));
} catch (Exception ex) {
AlipayLogger.logBizWarn(ex);
}
throw e;
}
}
/**
* 统一收单交易退款接口 (asynchronously)
* 当交易发生之后一段时间内,由于买家或者卖家的原因需要退款时,卖家可以通过退款接口将支付款退还给买家,支付宝将在收到退款请求并且验证成功之后,按照退款规则将支付款按原路退到买家帐号上。 交易超过约定时间(签约时设置的可退款时间)的订单无法进行退款。 支付宝退款支持单笔交易分多次退款,多次退款需要提交原支付订单的订单号和设置不同的退款请求号。一笔退款失败后重新提交,要保证重试时退款请求号不能变更,防止该笔交易重复退款。 同一笔交易累计提交的退款金额不能超过原始交易总金额。
* @param alipayTradeRefundModel (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
200
common response
-
0
请求失败
-
* @deprecated
*/
@Deprecated
public okhttp3.Call refundAsync(AlipayTradeRefundModel alipayTradeRefundModel, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = refundValidateBeforeCall(alipayTradeRefundModel, _callback, null);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
@Deprecated
public okhttp3.Call refundAsync(AlipayTradeRefundModel alipayTradeRefundModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException {
okhttp3.Call localVarCall = refundValidateBeforeCall(alipayTradeRefundModel, _callback, customizedParams);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}