|
|
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.uas.platform.b2c.common.account.model.User;
|
|
|
import com.uas.platform.b2c.core.support.SystemSession;
|
|
|
import com.uas.platform.b2c.fa.payment.constant.B2CField;
|
|
|
+import com.uas.platform.b2c.fa.payment.constant.PingAnField;
|
|
|
import com.uas.platform.b2c.fa.payment.constant.StringConstant;
|
|
|
import com.uas.platform.b2c.fa.payment.facade.PingAnFacade;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -100,27 +101,27 @@ public class PingAnFacadeImpl implements PingAnFacade {
|
|
|
public String khPaySMS(JSONObject json, Boolean isPersonal) {
|
|
|
HashMap<String, String> map = new HashMap<>();
|
|
|
if (json == null) {
|
|
|
- map.put("amount", "10");
|
|
|
- map.put("currency", "RMB");
|
|
|
- map.put("objectName", "test");
|
|
|
- map.put("OpenId", "20003111462017122041072723");
|
|
|
+ map.put(PingAnField.AMOUNT, "10");
|
|
|
+ map.put(PingAnField.CURRENCY, "RMB");
|
|
|
+ map.put(PingAnField.OBJECTNAME, "test");
|
|
|
+ map.put(PingAnField.OPENID, "20003111462017122041072723");
|
|
|
} else {
|
|
|
- String amount = json.getString("amount");
|
|
|
+ String amount = json.getString(PingAnField.AMOUNT);
|
|
|
if (StringUtils.isEmpty(amount)) {
|
|
|
throw new IllegalArgumentException("传入的金额合计为空");
|
|
|
}
|
|
|
- map.put("amount", amount);
|
|
|
+ map.put(PingAnField.AMOUNT, amount);
|
|
|
|
|
|
- String currency = json.getString("currency");
|
|
|
+ String currency = json.getString(PingAnField.CURRENCY);
|
|
|
if (StringUtils.isEmpty(currency)) {
|
|
|
currency = StringConstant.RMB_String;
|
|
|
}
|
|
|
- map.put("currency", currency);
|
|
|
+ map.put(PingAnField.CURRENCY, currency);
|
|
|
|
|
|
- String objectName = json.getString("objectName");
|
|
|
- map.put("objectName", objectName == null ? "" : objectName);
|
|
|
+ String objectName = json.getString(PingAnField.OBJECTNAME);
|
|
|
+ map.put(PingAnField.OBJECTNAME, objectName == null ? "" : objectName);
|
|
|
//绑卡之后,会从银联返回一个OpenId;
|
|
|
- map.put("OpenId", "20003111462017122041072723");
|
|
|
+ map.put(PingAnField.OPENID, "20003111462017122041072723");
|
|
|
}
|
|
|
isPersonal = true;
|
|
|
Map<String, String> infoMap = getUserInfoMap(isPersonal);
|
|
|
@@ -140,7 +141,53 @@ public class PingAnFacadeImpl implements PingAnFacade {
|
|
|
@Override
|
|
|
public String khPay(JSONObject json, Boolean isPersonal) {
|
|
|
HashMap<String, String> map = new HashMap<>();
|
|
|
+ if (json != null) {
|
|
|
+ String orderid = json.getString(PingAnField.ORDERID);
|
|
|
+ if (StringUtils.isEmpty(orderid)) {
|
|
|
+ throw new IllegalArgumentException("传入的支付流水号为空");
|
|
|
+ }
|
|
|
+ map.put(PingAnField.ORDERID, orderid);
|
|
|
+ String payDate = json.getString(PingAnField.PAYDATE);
|
|
|
+ if (StringUtils.isEmpty(payDate)) {
|
|
|
+ throw new IllegalArgumentException("传入的支付时间为空");
|
|
|
+ }
|
|
|
+ map.put(PingAnField.PAYDATE, payDate);
|
|
|
+
|
|
|
+ String amout = json.getString(PingAnField.AMOUNT);
|
|
|
+ if (StringUtils.isEmpty(amout)) {
|
|
|
+ throw new IllegalArgumentException("传入的支付金额为空");
|
|
|
+ }
|
|
|
+ map.put(PingAnField.AMOUNT, amout);
|
|
|
+
|
|
|
+ String objName = json.getString(PingAnField.OBJECTNAME);
|
|
|
+ if (StringUtils.isEmpty(objName)) {
|
|
|
+ objName = StringConstant.EMPTY_STRING;
|
|
|
+ }
|
|
|
+ map.put(PingAnField.OBJECTNAME, objName);
|
|
|
+
|
|
|
+ String verifyCode = json.getString(PingAnField.VERIFYCODE);
|
|
|
+ if (StringUtils.isEmpty(verifyCode)) {
|
|
|
+ throw new IllegalArgumentException("传入的动态验证码为空");
|
|
|
+ }
|
|
|
+ map.put(PingAnField.VERIFYCODE, verifyCode);
|
|
|
+ }
|
|
|
Map<String, String> infoMap = getUserInfoMap(isPersonal);
|
|
|
+ /*
|
|
|
+ * orderId 支付的流水号必须和发送短信的接口一致
|
|
|
+ * paydate 支付的时间,必须与获取短信的时间一致
|
|
|
+ * opendid 银行卡的开户行id 在查询的时候就会把信息带过去
|
|
|
+ * currency 币种 RMB
|
|
|
+ * amount 金额 12整数,2小数
|
|
|
+ * objectName 订单款项描述
|
|
|
+ * verifyCode 短信验证码
|
|
|
+ * payCardType 支付卡类型,01:借记卡,02:信用卡
|
|
|
+ * issInsCode 发卡机构代码 查询绑卡信息时返回结果之后,会查询我们建的表信息,返回前端会带着个信息
|
|
|
+ * */
|
|
|
+
|
|
|
+ map.put("paydate", "");
|
|
|
+ infoMap.putAll(map);
|
|
|
+ map.put("currency", "RMB");
|
|
|
+ map.put("amount", "");
|
|
|
return null;
|
|
|
}
|
|
|
}
|