main
parent
7f7c19cdbf
commit
e6d122bf7b
|
|
@ -1,8 +1,36 @@
|
|||
package com.czcb.scfs.api.service.v1.pay;
|
||||
|
||||
import com.czcb.scfs.api.core.ApiClient;
|
||||
import com.czcb.scfs.api.core.http.HttpHeaders;
|
||||
import com.czcb.scfs.api.core.http.HttpResponse;
|
||||
import com.czcb.scfs.api.service.v1.pay.model.MerWithdrawRequest;
|
||||
import com.czcb.scfs.api.service.v1.pay.model.MerWithdrawResponse;
|
||||
|
||||
import static com.czcb.scfs.api.core.Constants.API_VERSION;
|
||||
import static com.czcb.scfs.api.core.Constants.V_1;
|
||||
|
||||
/**
|
||||
* @author wangwei
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public class PayService {
|
||||
private final ApiClient apiClient;
|
||||
|
||||
public PayService(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* 提现
|
||||
*
|
||||
* @param request MerWithdrawRequest
|
||||
* @return MerWithdrawResponse
|
||||
*/
|
||||
public MerWithdrawResponse withdraw(MerWithdrawRequest request) {
|
||||
String url = "/merTrade/mer_withdraw";
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.addHeader(API_VERSION, V_1);
|
||||
HttpResponse<MerWithdrawResponse> httpResponse = apiClient.post(url, headers, request.toJsonRequest(), MerWithdrawResponse.class);
|
||||
return httpResponse.getServiceResponse();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,89 @@
|
|||
package com.czcb.scfs.api.service.v1.pay.model;
|
||||
|
||||
import com.czcb.scfs.api.core.ApiRequest;
|
||||
import com.czcb.scfs.api.service.TransType;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 提现
|
||||
*
|
||||
* @author wangwei
|
||||
* @since 2.0.0
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TransType("100018")
|
||||
public class MerWithdrawRequest implements ApiRequest {
|
||||
/**
|
||||
* 渠道编号
|
||||
*/
|
||||
@SerializedName("channel_no")
|
||||
private String channelNo;
|
||||
|
||||
/**
|
||||
* 应用编号
|
||||
*/
|
||||
@SerializedName("app_no")
|
||||
private String appNo;
|
||||
|
||||
/**
|
||||
* 流水号
|
||||
*/
|
||||
@SerializedName("serial_no")
|
||||
private String serialNo;
|
||||
|
||||
/**
|
||||
* 收款账户账号
|
||||
*/
|
||||
@SerializedName("account_no")
|
||||
private String accountNo;
|
||||
|
||||
/**
|
||||
* 收款账户户名
|
||||
*/
|
||||
@SerializedName("account_name")
|
||||
private String accountName;
|
||||
|
||||
@SerializedName("primary_account")
|
||||
private String primaryAccount;
|
||||
|
||||
@SerializedName("amount")
|
||||
private BigDecimal amount;
|
||||
|
||||
@SerializedName("trade_no")
|
||||
private String tradeNo;
|
||||
|
||||
@SerializedName("verify_code")
|
||||
private String verifyCode;
|
||||
|
||||
@SerializedName("trans_summary")
|
||||
private String transSummary;
|
||||
|
||||
@SerializedName("receive_url")
|
||||
private String receiveUrl;
|
||||
|
||||
@SerializedName("trans_fee")
|
||||
private BigDecimal transFee;
|
||||
|
||||
@SerializedName("fee_account_no")
|
||||
private String feeAccountNo;
|
||||
|
||||
@SerializedName("fee_account_name")
|
||||
private String feeAccountName;
|
||||
|
||||
/**
|
||||
* 操作日期
|
||||
*/
|
||||
@SerializedName("original_serialno")
|
||||
private String transDate;
|
||||
|
||||
/**
|
||||
* 操作时间
|
||||
*/
|
||||
@SerializedName("trans_tradetime")
|
||||
private String transTradeTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
package com.czcb.scfs.api.service.v1.pay.model;
|
||||
|
||||
import com.czcb.scfs.api.core.ApiResponse;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 提现
|
||||
*
|
||||
* @author wangwei
|
||||
* @since 2.0.0
|
||||
*/
|
||||
@Data
|
||||
public class MerWithdrawResponse implements ApiResponse {
|
||||
/**
|
||||
* 000000:表示成功
|
||||
*/
|
||||
@SerializedName("recode")
|
||||
private String recode;
|
||||
|
||||
/**
|
||||
* 结果信息
|
||||
*/
|
||||
@SerializedName("recode_Info")
|
||||
private String recodeInfo;
|
||||
|
||||
/**
|
||||
* 流水号
|
||||
*/
|
||||
@SerializedName("serial_no")
|
||||
private String serialNo;
|
||||
|
||||
/**
|
||||
* 账号
|
||||
*/
|
||||
@SerializedName("account_no")
|
||||
private String accountNo;
|
||||
|
||||
/**
|
||||
* 户名
|
||||
*/
|
||||
@SerializedName("account_name")
|
||||
private String accountName;
|
||||
|
||||
/**
|
||||
* 原交易码
|
||||
*/
|
||||
@SerializedName("original_tradeno")
|
||||
private String originalTradeNo;
|
||||
|
||||
/**
|
||||
* 原交易流水号
|
||||
*/
|
||||
@SerializedName("original_serialno")
|
||||
private String originalSerialNo;
|
||||
/**
|
||||
* 交易金额
|
||||
*/
|
||||
@SerializedName("trans_amount")
|
||||
private BigDecimal transAmount;
|
||||
|
||||
/**
|
||||
* 系统日期(YYYY-MM-DD)
|
||||
*/
|
||||
@SerializedName("sys_date")
|
||||
private String sysDate;
|
||||
|
||||
/**
|
||||
* 系统时间(YYYY-MM-DD hh:mm:ss)
|
||||
*/
|
||||
@SerializedName("recode_Info")
|
||||
private String sysTime;
|
||||
}
|
||||
Loading…
Reference in New Issue