|
|
@@ -9,11 +9,9 @@ import com.poteviohealth.cgp.common.model.VaultsResponse;
|
|
|
import com.poteviohealth.ym.ipos.model.back.BaseBack;
|
|
|
import com.poteviohealth.ym.ipos.model.payment.PayRefundQuery;
|
|
|
import com.poteviohealth.ym.ipos.model.split.*;
|
|
|
-import com.poteviohealth.ym.ipos.model.split.back.AccountBalanceBack;
|
|
|
-import com.poteviohealth.ym.ipos.model.split.back.PayConfirmBack;
|
|
|
-import com.poteviohealth.ym.ipos.model.split.back.PayConfirmQueryBack;
|
|
|
-import com.poteviohealth.ym.ipos.model.split.back.SettlementQueryBack;
|
|
|
+import com.poteviohealth.ym.ipos.model.split.back.*;
|
|
|
import com.poteviohealth.ym.ipos.model.split.detail.*;
|
|
|
+import com.poteviohealth.ym.ipos.model.split.dto.WithdrawDto;
|
|
|
import com.poteviohealth.ym.ipos.service.ISplitRecordsDetailService;
|
|
|
import com.poteviohealth.ym.ipos.service.ISplitRecordsService;
|
|
|
import com.poteviohealth.ym.ipos.service.ISplitService;
|
|
|
@@ -209,4 +207,27 @@ public class SplitServiceImpl implements ISplitService {
|
|
|
|
|
|
return VaultsResponse.failed(back.getResult().getComment());
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public VaultsResponse<WithdrawBack> withdraw(WithdrawDto dto) {
|
|
|
+ Withdraw withdraw = new Withdraw();
|
|
|
+ WithdrawDetail detail = new WithdrawDetail();
|
|
|
+ detail.setMerchant_id(dto.getMerchantId());
|
|
|
+ detail.setAmount(dto.getAmount());
|
|
|
+ withdraw.setMerchant_withdraw_request(detail);
|
|
|
+ WithdrawBack back = null;
|
|
|
+ try {
|
|
|
+ back = (WithdrawBack) YmUtil.resultBack(withdraw,new WithdrawBack());
|
|
|
+ } catch (IllegalAccessException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ return VaultsResponse.failed(e.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ if(YmUtil.SUCCESS.equals(back.getResult().getId())){
|
|
|
+ return VaultsResponse.success(back);
|
|
|
+ }
|
|
|
+
|
|
|
+ return VaultsResponse.failed(back.getResult().getComment());
|
|
|
+
|
|
|
+ }
|
|
|
}
|