public String refundPayment() { logger.info("确认还款操作"); CustomerCompany customerCompany = CustomerCompanyModel.getInfoByP2pCustomerNo(this.info.getPayerNo()); PaymentAccountInformation payer = PaymentAccountInformationModel.getInfoByCustomerNo(customerCompany.getP2pCustomerNo()); if (payer == null) { this.setErrDesc("此付款方尚未注册易宝平台账户"); this.setErrCode("paymentAccountInformation is null"); logger.error("此付款方尚未注册易宝平台账户"); return SUCCESS; } PaymentAccountInformation payee = PaymentAccountInformationModel.getInfoByCustomerNo(this.info.getP2pCustomerNo()); if (payee == null) { this.setErrDesc("此收款方尚未注册易宝平台账户"); this.setErrCode("accountInformation is null"); logger.error("此收款方尚未注册易宝平台账户"); return SUCCESS; } CpTransactionReq<Repayment> cpTransactionReq = new CpTransactionReq<Repayment>(); cpTransactionReq.setRequestNo(String.valueOf(this.info.getId())); cpTransactionReq.setPlatformNo("default"); cpTransactionReq.setPlatformUserNo(String.valueOf(customerCompany.getP2pCustomerNo())); cpTransactionReq.setUserType(String.valueOf(CardStatus.MEMBER)); cpTransactionReq.setBizType(String.valueOf(ServiceStates.REPAYMENT)); // cpTransactionReq.setExpired(String.valueOf(this.info.getPayEndTime())); Detail detail = new Detail(); detail.setAmount(String.valueOf(this.info.getPayMoney())); detail.setTargetUserType(String.valueOf(CardStatus.MEMBER)); detail.setTargetPlatformUserNo(String.valueOf(this.info.getP2pCustomerNo())); detail.setBizType(String.valueOf(ServiceStates.REPAYMENT)); List<Detail> detailList = new ArrayList<>(); detailList.add(detail); Details details = new Details(); details.setDetails(detailList); cpTransactionReq.setDetails(details); Repayment repayment = new Repayment(); repayment.setTenderOrderNo(String.valueOf(this.info.getP2pProductNo())); cpTransactionReq.setExtend(repayment.getExtend()); cpTransactionReq.setNotifyUrl( UrlHelper.buildPaymentSiteUrl("/payment/paymentRefund/repaymentNotify")); cpTransactionReq.setCallbackUrl( UrlHelper.buildPaymentSiteUrl("/payment/paymentRefund/repaymentCallback")); cpTransactionReq.setRemark("还款操作"); try { this.paymentData = GatewayModel.repayment(cpTransactionReq); } catch (Exception e) { logger.error("还款操作出现异常", e); } return SUCCESS; }
public String cancelRefundPayment() { logger.info("取消还款确认操作"); try { CompleteTransactionReq completeTransactionReq = new CompleteTransactionReq(); completeTransactionReq.setPlatformNo("default"); completeTransactionReq.setRequestNo(String.valueOf(this.getId())); completeTransactionReq.setMode(TransferStatus.CANCEL); completeTransactionReq.setNotifyUrl( UrlHelper.buildPaymentSiteUrl("/payment/paymentRefund/cancelTransactionNotify")); ControllerModel.getCompleteTransaction(completeTransactionReq); } catch (Exception e) { logger.error("还款转账确认出现异常", e); this.setErrCode("failed"); } return SUCCESS; }