/** * Update data for pm regarding to step number and input request. * * @param pmId * @param request */ private void execute(SeventhStepRequest requestObject) throws Exception { String amount = requestObject.getAmount(); if (amount == null || amount.isEmpty()) throw new Exception("The amount field is blank."); SqlSession sqlSession = RazorServer.openSession(); PaymentMethod managerPaymentMethod = sqlSession.getMapper(PaymentMethodMapper.class).read_by_pm(this.getPmId()); Party action = new Party(); action.setId(this.getPmId().toString()); if (managerPaymentMethod != null && managerPaymentMethod.getAmount() != null) { PropertyManagerInfo managerInfo = sqlSession.getMapper(PropertyManagerInfoMapper.class).readbypmid(this.getPmId()); if (managerInfo == null) { throw new ServiceException(Error.organization_info); } if (amount.equals(managerPaymentMethod.getAmount().toString())) { managerPaymentMethod.setVerifiedDate(new Date()); action.setState(Party.CREATED); managerInfo.setRegistrationStepId(RegistrationConstants.FINAL_STEP); sqlSession.getMapper(PaymentMethodMapper.class).update(managerPaymentMethod); sqlSession.getMapper(PropertyManagerInfoMapper.class).update(managerInfo); sqlSession.getMapper(PartyMapper.class).update(action); } else { throw new ServiceException(Error.card_amount); } } else { throw new ServiceException(Error.payment_method_unsupported); } sqlSession.commit(); }
public CommissionSeparatorUtil( SqlSession sqlSession, HasPrice hasPrice, Double totalAmount, Double nightlyRate) { this.setTotalAmount(totalAmount); this.setNightlyRate(nightlyRate); this.channelPartner = sqlSession .getMapper(ChannelPartnerMapper.class) .readByPartyId(Integer.valueOf(hasPrice.getAgentid())); if (this.channelPartner != null && this.channelPartner.getCommission() != null) { channelPartnerCommission = Double.valueOf(this.channelPartner.getCommission()); } this.pmInfo = sqlSession .getMapper(PropertyManagerInfoMapper.class) .readbypmid(Integer.valueOf(hasPrice.getSupplierid())); if (this.pmInfo != null) { this.netRate = pmInfo.isNetRate(); } else { this.netRate = false; } }
public Boolean isBPFundsHolder() { return pmInfo.getFundsHolder() == ManagerToGateway.BOOKINGPAL_HOLDER; }
public Boolean isPMFundsHolder() { return pmInfo.getFundsHolder() == ManagerToGateway.PROPERTY_MANAGER_HOLDER; }
public Double getPmCommission() { Double pmCommission = pmInfo.getCommission() / 100.; return pmCommission; }
public Double getPmsMarkupCommission() { Double pmsCommission = pmInfo.getPmsMarkup() / 100.; return pmsCommission; }