汇付支付订单

This commit is contained in:
2023-05-27 14:12:21 +08:00
parent 36447d502c
commit a46b7c30e2

View File

@@ -119,6 +119,8 @@ public class OrderService {
private List<String> stationIdList = Lists.newArrayList("1", "2");
private String ADAPAY_APP_ID = "app_d0c80cb1-ffc8-48cb-a030-fe9bec823aaa";
/**
* 生成订单
*
@@ -252,11 +254,14 @@ public class OrderService {
createAdaPaymentParam.setOrder_no(orderInfo.getOrderCode());
// createAdaPaymentParam.setPay_amt(new DecimalFormat("#.00").format(dto.getPayAmount()));
createAdaPaymentParam.setPay_amt(AdapayUtil.formatAmount(dto.getPayAmount()));
createAdaPaymentParam.setApp_id("app_d0c80cb1-ffc8-48cb-a030-fe9bec823aaa"); // todo 后面移动到配置文件中
createAdaPaymentParam.setApp_id(ADAPAY_APP_ID); // todo 后面移动到配置文件中
createAdaPaymentParam.setPay_channel("wx_lite"); // todo 如果以后有支付宝等别的渠道,这里需要做修改,判断是什么渠道的请求
createAdaPaymentParam.setGoods_title("充电费用1");
createAdaPaymentParam.setGoods_desc("充电费用2"); // 这个字段是微信支付凭证的商品名
createAdaPaymentParam.setDescription("充电费用3");
createAdaPaymentParam.setGoods_title("充电费用");
createAdaPaymentParam.setGoods_desc("充电桩预付款金额"); // 这个字段是微信支付凭证的商品名
Map<String, String> map = Maps.newHashMap();
map.put("type", ScenarioEnum.ORDER.getValue());
map.put("orderCode", dto.getOrderCode());
createAdaPaymentParam.setDescription(JSON.toJSONString(map));
createAdaPaymentParam.setExpend(JSONObject.toJSONString( ImmutableMap.of("open_id", openId)));
try {
log.info("创建汇付支付参数:{}", JSONObject.toJSONString(createAdaPaymentParam));