update 汇付参数移动到配置文件

This commit is contained in:
2023-05-27 14:27:36 +08:00
parent a46b7c30e2
commit 5804bff3d4
4 changed files with 31 additions and 3 deletions

View File

@@ -54,6 +54,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cglib.beans.BeanMap;
import org.springframework.stereotype.Service;
@@ -93,6 +94,12 @@ public class MemberService {
@Autowired
private OrderService orderService;
@Value("${adapay.appId}")
private String ADAPAY_APP_ID;
@Value("${adapay.callback}")
private String ADAPAY_CALLBACK_URL;
/**
* 校验短信验证码
* @param dto
@@ -450,14 +457,14 @@ public class MemberService {
CreateAdaPaymentParam createAdaPaymentParam = new CreateAdaPaymentParam();
createAdaPaymentParam.setOrder_no(IdUtils.fastSimpleUUID());
createAdaPaymentParam.setPay_amt(AdapayUtil.formatAmount(dto.getAmount()));
createAdaPaymentParam.setApp_id("app_d0c80cb1-ffc8-48cb-a030-fe9bec823aaa"); // todo 后面移动到配置文件中
createAdaPaymentParam.setApp_id(ADAPAY_APP_ID); // 移动到配置文件中
createAdaPaymentParam.setPay_channel("wx_lite"); // todo 如果以后有支付宝等别的渠道,这里需要做修改,判断是什么渠道的请求
createAdaPaymentParam.setGoods_title("余额");
createAdaPaymentParam.setGoods_desc("会员充值余额");
// createAdaPaymentParam.setDescription("充电费用3");
createAdaPaymentParam.setExpend(JSONObject.toJSONString( ImmutableMap.of("open_id", dto.getOpenId())));
//异步通知地址url为http/https路径服务器POST回调URL 上请勿附带参数
createAdaPaymentParam.setNotify_url("https://api.jsowellcloud.com/uniapp/pay/adapayCallback");
createAdaPaymentParam.setNotify_url(ADAPAY_CALLBACK_URL);
Map<String, String> map = Maps.newHashMap();
map.put("type", ScenarioEnum.BALANCE.getValue());
map.put("memberId", dto.getMemberId());