"拉卡拉进件支付代码"
This commit is contained in:
parent
6102029af0
commit
eeffe90fc7
|
|
@ -7,7 +7,9 @@ import cn.pluss.platform.dto.MerChantOrderDTO;
|
|||
import cn.pluss.platform.entity.*;
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
import cn.pluss.platform.klk.LakalaConfig;
|
||||
import cn.pluss.platform.klk.service.impl.LaKalaInterfaceImpl;
|
||||
import cn.pluss.platform.mapper.MerchantBackLklMapper;
|
||||
import cn.pluss.platform.mapper.MerchantBaseInfoMapper;
|
||||
import cn.pluss.platform.pay.PayService;
|
||||
import cn.pluss.platform.util.DateUtils;
|
||||
import cn.pluss.platform.util.SnowFlakeUtil;
|
||||
|
|
@ -35,10 +37,21 @@ public class LkLPayServiceImpl implements PayService {
|
|||
@Autowired
|
||||
LakalaConfig lakalaConfig;
|
||||
|
||||
@Autowired
|
||||
MerchantBaseInfoMapper merchantBaseInfoMapper;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public JSONObject tradePay(MerchantOrder order, MerchantChannelStatus channel, MerchantBaseInfo merchant) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -46,45 +59,40 @@ public class LkLPayServiceImpl implements PayService {
|
|||
public JSONObject tradePay(MerChantOrderDTO merchantOrderDTO, MerchantOrder order) {
|
||||
|
||||
|
||||
QueryWrapper<MerchantBaseInfo> baseQueyWrapper=new QueryWrapper<>();
|
||||
baseQueyWrapper.eq("merchantCode",merchantOrderDTO.getMerchantCode());
|
||||
MerchantBaseInfo baseInfo= merchantBaseInfoMapper.selectOne(baseQueyWrapper);
|
||||
MsgException.checkNull(baseInfo,"商户基本信息错误");
|
||||
|
||||
|
||||
|
||||
QueryWrapper<MerchantBackLkl> queryWrapper=new QueryWrapper<>();
|
||||
queryWrapper.eq("merchant_code",merchantOrderDTO.getMerchantCode());
|
||||
queryWrapper.eq("channel","5");
|
||||
queryWrapper.eq("user_no","20000101");
|
||||
queryWrapper.eq("user_no", LaKalaInterfaceImpl.userNo);
|
||||
|
||||
MerchantBackLkl merchantBackLkl=merchantBackLklMapper.selectOne(queryWrapper);
|
||||
MsgException.checkNull(merchantBackLkl,"进件信息不存在");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
JSONObject obj = new JSONObject(6);
|
||||
|
||||
String req_time= DateUtils.getSdfTimes();
|
||||
Long order_amt = new BigDecimal(order.getConsumeFee()).multiply(new BigDecimal(100)).longValue();
|
||||
String out_trade_no= "LKL".concat(SnowFlakeUtil.nextId().toString());
|
||||
|
||||
|
||||
// String body="{\n" +
|
||||
// "\t\"req_data\": {\n" +
|
||||
// "\t\t\"out_trade_no\": \""+out_trade_no+"\",\n" +
|
||||
// "\t\t\"merchant_no\": \""+lakalaConfig.getMerchantNo()+"\",\n" +
|
||||
// "\t\t\"term_no\": \""+lakalaConfig.getTermNo()+"\",\n" +
|
||||
// "\t\t\"auth_code\": \""+merchantOrderDTO.getAuthCode()+"\",\n" +
|
||||
// "\t\t\"total_amount\": \""+order_amt+"\",\n" +
|
||||
// "\t\t\"notify_url\": \""+lakalaConfig.getCallBackUrl()+"\",\n" +
|
||||
// "\t\t\"location_info\": \"{\"request_ip\":\""+order.getIp()+"\"}\"\n" +
|
||||
// "\t},\n" +
|
||||
// "\t\"version\": \"3.0\",\n" +
|
||||
// "\t\"req_time\": \""+req_time+"\"\n" +
|
||||
// "}";
|
||||
|
||||
|
||||
String body="{\n" +
|
||||
"\t\"req_data\": {\n" +
|
||||
"\t\t\"merchant_no\": \""+lakalaConfig.getMerchantNo()+"\",\n" +
|
||||
"\t\t\"term_no\": \""+lakalaConfig.getTermNo()+"\",\n" +
|
||||
"\t\t\"out_trade_no\": \""+out_trade_no+"\",\n" +
|
||||
"\t\t\"merchant_no\": \""+merchantBackLkl.getExternalCustomerNo()+"\",\n" +
|
||||
"\t\t\"term_no\": \""+merchantBackLkl.getTermNos()+"\",\n" +
|
||||
"\t\t\"out_trade_no\": \""+order.getOrderNumber()+"\",\n" +
|
||||
"\t\t\"total_amount\": \""+order_amt+"\",\n" +
|
||||
"\t\t\"subject\": \"测试\",\n" +
|
||||
"\t\t\"subject\": \""+baseInfo.getMccName()+"\",\n" +
|
||||
"\t\t\"acc_busi_fields\": {},\n" +
|
||||
"\t\t\"notify_url\": \""+lakalaConfig.getCallBackUrl()+"\",\n" +
|
||||
"\t\t\"location_info\": {\n" +
|
||||
|
|
|
|||
|
|
@ -236,9 +236,9 @@ public class LaKalaInterfaceImpl implements LaKalaInterface {
|
|||
object1.put("userNo", userNo); //合作机构信息 由拓客SAAS提供
|
||||
object1.put("email", "chaozhanggui2023@163.com"); //商户邮箱
|
||||
object1.put("busiCode", "PAPER_CODE");//业务类型 BPOS:传统POS, ZPOS:电签,ZPOS4G:4G电签,SUPER_POS:智能pos,B_WIZARD:蓝精灵,PAPER_CODE:码牌,WECHAT_PAY:专业化扫码,KLYX:云音箱,QRCODE:收款王,MONEY_BOX:收钱宝盒根据业务开放取值
|
||||
object1.put("merRegName", merchantBaseInfo.getMerchantName()); //商户注册名称 不能少于七个中文
|
||||
object1.put("merRegName", merchantBaseInfo.getAlias()); //商户注册名称 不能少于七个中文
|
||||
object1.put("merType", (merchantBaseInfo.getMerchantType().equals(1)||merchantBaseInfo.getMerchantType().equals("2"))?"TP_PERSONAL":"TP_MERCHANT"); //商户注册类型 TP_MERCHANT:企业 TP_PERSONAL:⼩微个⼈
|
||||
object1.put("merName", merchantBaseInfo.getMerchantName()); //商户名称(经营名称) 不能少于七个中文
|
||||
object1.put("merName", merchantBaseInfo.getAlias()); //商户名称(经营名称) 不能少于七个中文
|
||||
object1.put("merAddr", merchantBaseInfo.getAddress()); //去掉省,市区后的详细地址
|
||||
object1.put("provinceCode", tbPlussRegionLklService.getOne(new QueryWrapper<TbPlussRegionLklEntity>().likeRight("name",merchantBaseInfo.getProvince()).last("limit 1")).getCode()); //省代码 通过【地区信息→获取地区查询】接口获取 对应 code字段
|
||||
object1.put("cityCode", tbPlussRegionLklService.getOne(new QueryWrapper<TbPlussRegionLklEntity>().likeRight("name",merchantBaseInfo.getCity()).last("limit 1")).getCode()); // 市代码 通过【地区信息→获取地区查询】接口获取 对应 code字段
|
||||
|
|
|
|||
Loading…
Reference in New Issue