
com.ijpay.core.IJPayHttpResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of IJPay-Core Show documentation
Show all versions of IJPay-Core Show documentation
IJPay 让支付触手可及(Easy Pay Library)-核心工具包
package com.ijpay.core;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.map.CaseInsensitiveMap;
import cn.hutool.core.util.StrUtil;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
* IJPay 让支付触手可及,封装了微信支付、支付宝支付、银联支付常用的支付方式以及各种常用的接口。
*
* 不依赖任何第三方 mvc 框架,仅仅作为工具使用简单快速完成支付模块的开发,可轻松嵌入到任何系统里。
*
* IJPay 交流群: 723992875、864988890
*
* Node.js 版: https://gitee.com/javen205/TNWX
*
* IJPay Http Response
*
* @author Javen
*/
public class IJPayHttpResponse implements Serializable {
private static final long serialVersionUID = 6089103955998013402L;
private String body;
private byte[] bodyByte;
private int status;
private Map> headers;
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public byte[] getBodyByte() {
return bodyByte;
}
public void setBodyByte(byte[] bodyByte) {
this.bodyByte = bodyByte;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public Map> getHeaders() {
return headers;
}
public void setHeaders(Map> headers) {
this.headers = headers;
}
public String getHeader(String name) {
List values = this.headerList(name);
return CollectionUtil.isEmpty(values) ? null : values.get(0);
}
private List headerList(String name) {
if (StrUtil.isBlank(name)) {
return null;
} else {
CaseInsensitiveMap> headersIgnoreCase = new CaseInsensitiveMap<>(getHeaders());
return headersIgnoreCase.get(name.trim());
}
}
@Override
public String toString() {
return "IJPayHttpResponse{" +
"body='" + body + '\'' +
", status=" + status +
", headers=" + headers +
'}';
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy