
com.nextpls.sdk.request.NextPlsDoTransactionRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdk Show documentation
Show all versions of sdk Show documentation
Use to connect to the nextpls
The newest version!
package com.nextpls.sdk.request;
import com.alibaba.fastjson.JSONObject;
import com.nextpls.sdk.NextPlsRequest;
import com.nextpls.sdk.constants.ApiNameConst;
import com.nextpls.sdk.pojo.request.NextPlsBaseRequest;
import com.nextpls.sdk.pojo.request.NextPlsTransactionRequestDto;
import com.nextpls.sdk.pojo.response.NextPlsTxnStatusResponse;
import org.apache.http.client.methods.HttpPost;
/**
* @author zhangchao
* @create 2020-01-08-14:47
*/
public class NextPlsDoTransactionRequest implements NextPlsRequest {
private static final String API_METHOD_NAME = ApiNameConst.DO_TRANSACTION;
private NextPlsBaseRequest baseRequest = new NextPlsBaseRequest<>();
private String bizContents;
@Override
public String getApiMethodName() {
return API_METHOD_NAME;
}
@Override
public String getRequestMethod() {
return HttpPost.METHOD_NAME;
}
@Override
public boolean isNeedEncrypt() {
return true;
}
@Override
public String getBizContents() {
return this.bizContents;
}
@Override
public Class getResponseClass() {
return NextPlsTxnStatusResponse.class;
}
public void setRequestDto(NextPlsTransactionRequestDto requestDto) {
this.baseRequest.setEntity(requestDto);
this.baseRequest.setApiName(API_METHOD_NAME);
this.bizContents = JSONObject.toJSONString(this.baseRequest);
}
public static NextPlsDoTransactionRequest build(NextPlsTransactionRequestDto requestDto) {
NextPlsDoTransactionRequest request = new NextPlsDoTransactionRequest();
request.setRequestDto(requestDto);
return request;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy