当前仓库属于暂停状态,部分功能使用受限,详情请查阅 仓库状态说明
1 Star 0 Fork 94

秋天的童话 / payment-thl
暂停

forked from thlws / payment-thl 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
BestPayClient.java 2.62 KB
一键复制 编辑 原始数据 按行查看 历史
package org.thlws.payment;
import cn.hutool.core.lang.Assert;
import org.thlws.payment.bestpay.core.BestpayCore;
import org.thlws.payment.bestpay.entity.request.BarcodePayRequest;
import org.thlws.payment.bestpay.entity.request.OrderRefundRequest;
import org.thlws.payment.bestpay.entity.request.OrderReverseRequest;
import org.thlws.payment.bestpay.entity.request.QueryOrderRequest;
import org.thlws.payment.bestpay.entity.response.OrderRefundResponse;
import org.thlws.payment.bestpay.entity.response.OrderResultResponse;
import org.thlws.payment.bestpay.entity.response.OrderReverseResponse;
import java.util.Objects;
/**
* 翼支付入口Class
*
* @author keriezhang
* 2018 /11/16
*/
public class BestPayClient {
/***
* 扫码支付
* {@link BestpayCore#barcode}
* @param request the request
* @param key the key
* @return order result response
* @throws Exception the exception
*/
public static OrderResultResponse barcode(BarcodePayRequest request, String key) throws Exception {
Objects.requireNonNull(request, "request can not be null");
Assert.notEmpty(key,"key can not be null");
return BestpayCore.barcode(request,key);
}
/***
* 支付查询
* {@link BestpayCore#query}
* @param request the request
* @param key the key
* @return order result response
* @throws Exception the exception
*/
public static OrderResultResponse query(QueryOrderRequest request, String key) throws Exception {
Objects.requireNonNull(request, "request can not be null");
Assert.notEmpty(key,"key can not be null");
return BestpayCore.query(request,key);
}
/***
* 支付退款
* {@link BestpayCore#refund}
* @param request the request
* @param key the key
* @return order refund response
* @throws Exception the exception
*/
public static OrderRefundResponse refund(OrderRefundRequest request, String key) throws Exception {
Objects.requireNonNull(request, "request can not be null");
Assert.notEmpty(key,"key can not be null");
return BestpayCore.refund(request,key);
}
/***
* 撤销
* {@link BestpayCore#reverse}
* @param request the request
* @param key the key
* @return order reverse response
* @throws Exception the exception
*/
public static OrderReverseResponse reverse(OrderReverseRequest request, String key) throws Exception {
Objects.requireNonNull(request, "request can not be null");
Assert.notEmpty(key,"key can not be null");
return BestpayCore.reverse(request,key);
}
}
Java
1
https://gitee.com/skygf163/payment-thl.git
git@gitee.com:skygf163/payment-thl.git
skygf163
payment-thl
payment-thl
master

搜索帮助