This commit is contained in:
2023-08-01 14:07:41 +08:00
parent 6b067a5cf5
commit 24557e62ff
2 changed files with 9 additions and 8 deletions

View File

@@ -155,12 +155,13 @@ public class AdapayMemberController extends BaseController {
/**
* 提现接口
* http://localhost:8080/adapay/member/drawCash
*/
@PostMapping("/withdraw")
public AjaxResult withdraw(@RequestBody WithdrawDTO dto) {
@PostMapping("/drawCash")
public AjaxResult drawCash(@RequestBody WithdrawDTO dto) {
AjaxResult result;
try {
adapayMemberService.withdraw(dto);
adapayMemberService.drawCash(dto);
result = AjaxResult.success();
} catch (BaseAdaPayException e) {
logger.error("提现接口 error", e);

View File

@@ -431,7 +431,7 @@ public class AdapayMemberService {
* @param dto
* @throws BaseAdaPayException
*/
public void withdraw(WithdrawDTO dto) throws BaseAdaPayException {
public void drawCash(WithdrawDTO dto) throws BaseAdaPayException {
// 通过merchantId 查询出汇付会员id 和 结算账户id用来查询余额
AdapayMemberAccount adapayMemberAccount = adapayMemberAccountService.selectByMerchantId(dto.getMerchantId());
if (adapayMemberAccount == null) {
@@ -440,17 +440,17 @@ public class AdapayMemberService {
}
Map<String, Object> settleCountParams = Maps.newHashMap();
settleCountParams.put("order_no", "jsdk_payment_" + System.currentTimeMillis());
settleCountParams.put("order_no", "drawcash_" + System.currentTimeMillis());
settleCountParams.put("cash_amt", AdapayUtil.formatAmount(dto.getCashAmt()));
settleCountParams.put("member_id", adapayMemberAccount.getAdapayMemberId());
settleCountParams.put("app_id", ADAPAY_APP_ID);
settleCountParams.put("settle_account_id", adapayMemberAccount.getSettleAccountId());
settleCountParams.put("cash_type", "T1");
settleCountParams.put("notify_url", "");
settleCountParams.put("notify_url", ADAPAY_CALLBACK_URL);
log.info("取现接口,请求参数:" + JSON.toJSONString(settleCountParams));
log.info("取现接口,请求参数:{}", JSON.toJSONString(settleCountParams));
Map<String, Object> settleCount = Drawcash.create(settleCountParams);
log.info("取现接口返回参数" + JSON.toJSONString(settleCount));
log.info("取现接口返回参数{}", JSON.toJSONString(settleCount));
}
/**