刷卡付,条码付实现

为兼容刷卡付等支付结果校验,修改校验接口入参
This commit is contained in:
cnzzs
2017-05-10 23:26:46 +08:00
parent 16c7880e3e
commit 904d7a6070
16 changed files with 196 additions and 80 deletions

View File

@@ -60,7 +60,7 @@ public interface PayService {
* @param params 回调回来的参数集
* @return 签名校验 true通过
*/
boolean verify(Map<String, String> params);
boolean verify(Map<String, Object> params);
/**
* 签名校验
@@ -69,7 +69,7 @@ public interface PayService {
* @param sign 签名
* @return 签名校验 true通过
*/
boolean signVerify(Map<String, String> params, String sign);
boolean signVerify(Map<String, Object> params, String sign);
/**
@@ -115,7 +115,7 @@ public interface PayService {
* @param is 请求流
* @return 获得回调的请求参数
*/
Map<String, String> getParameter2Map(Map<String, String[]> parameterMap, InputStream is);
Map<String, Object> getParameter2Map(Map<String, String[]> parameterMap, InputStream is);
/**
* 获取输出消息,用户返回给支付端
@@ -144,6 +144,14 @@ public interface PayService {
*/
BufferedImage genQrPay(PayOrder order);
/**
* 刷卡付,pos主动扫码付款(条码付)
*
* @param order 发起支付的订单信息
* @return 返回支付结果
*/
Map<String, Object> microPay(PayOrder order);
/**
* 交易查询接口
*

View File

@@ -4,7 +4,6 @@ import java.io.Serializable;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.Map;
@@ -18,25 +17,25 @@ import java.util.Map;
* </pre>
*/
public class PayMessage implements Serializable {
private Map<String, String> payMessage = null;
private Map<String, Object> payMessage = null;
private String msgType;
private String payType;
private String transactionType;
private String fromPay;
private String describe;
public PayMessage(Map<String, String> payMessage) {
public PayMessage(Map<String, Object> payMessage) {
this.payMessage = payMessage;
}
public PayMessage(Map<String, String> payMessage, String payType, String msgType) {
public PayMessage(Map<String, Object> payMessage, String payType, String msgType) {
this(payMessage);
this.payType = payType;
this.msgType = msgType;
}
public PayMessage(Map<String, String> payMessage, String msgType, String payType, String transactionType) {
public PayMessage(Map<String, Object> payMessage, String msgType, String payType, String transactionType) {
this.payMessage = payMessage;
this.msgType = msgType;
this.payType = payType;
@@ -84,25 +83,25 @@ public class PayMessage implements Serializable {
this.describe = describe;
}
public String getDiscount(){
return payMessage.get("discount");
return (String) payMessage.get("discount");
}
public String getSubject(){
return payMessage.get("subject");
return (String) payMessage.get("subject");
}
/////////微信与支付宝共用
public String getOutTradeNo(){
return payMessage.get("out_trade_no");
return (String) payMessage.get("out_trade_no");
}
public String getSign(){
return payMessage.get("sign");
return (String) payMessage.get("sign");
}
public Number getTotalFee(){
String total_fee = payMessage.get("total_fee");
String total_fee = (String) payMessage.get("total_fee");
if (null == total_fee || "".equals(total_fee)){ return 0; }
if (isNumber(total_fee)){
BigDecimal totalFee = new BigDecimal(total_fee);
@@ -138,7 +137,7 @@ public class PayMessage implements Serializable {
return payMessage.toString();
}
public Map<String, String> getPayMessage() {
public Map<String, Object> getPayMessage() {
return payMessage;
}