mirror of
https://gitee.com/egzosn/pay-java-parent.git
synced 2026-05-09 12:36:16 +08:00
增加二维码信息返回接口
This commit is contained in:
@@ -5,11 +5,13 @@ import com.egzosn.pay.common.bean.*;
|
||||
import com.egzosn.pay.common.exception.PayErrorException;
|
||||
import com.egzosn.pay.common.http.HttpConfigStorage;
|
||||
import com.egzosn.pay.common.http.HttpRequestTemplate;
|
||||
import com.egzosn.pay.common.util.MatrixToImageWriter;
|
||||
import com.egzosn.pay.common.util.sign.SignUtils;
|
||||
import com.egzosn.pay.common.util.str.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.InputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
@@ -141,6 +143,17 @@ public abstract class BasePayService<PC extends PayConfigStorage> implements Pay
|
||||
return buildRequest(orderInfo, MethodType.POST);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成二维码支付
|
||||
*
|
||||
* @param order 发起支付的订单信息
|
||||
* @return 返回图片信息,支付时需要的
|
||||
*/
|
||||
@Override
|
||||
public BufferedImage genQrPay(PayOrder order) {
|
||||
return MatrixToImageWriter.writeInfoToJpgBuff(getQrPay(order));
|
||||
}
|
||||
|
||||
/**
|
||||
* 将请求参数或者请求流转化为 Map
|
||||
*
|
||||
|
||||
@@ -161,6 +161,13 @@ public interface PayService<PC extends PayConfigStorage> {
|
||||
* @return 返回图片信息,支付时需要的
|
||||
*/
|
||||
BufferedImage genQrPay(PayOrder order);
|
||||
/**
|
||||
* 获取输出二维码信息,
|
||||
*
|
||||
* @param order 发起支付的订单信息
|
||||
* @return 返回二维码信息,,支付时需要的
|
||||
*/
|
||||
String getQrPay(PayOrder order);
|
||||
|
||||
/**
|
||||
* 刷卡付,pos主动扫码付款(条码付)
|
||||
|
||||
Reference in New Issue
Block a user