public void provisionData(String number, ApplicationResponse applicationResponse) { try { PurchaseHistory purchaseHistory = purchaseHistoryDao.getPurchaseHistoryByNumber(number); Provisioning provisioning = new Provisioning(); provisioning.setSmsFallbackMethod(applicationResponse.getSmsFallbackMethod()); provisioning.setSmsFallbackUrl(applicationResponse.getSmsFallbackUrl()); provisioning.setSmsMethod(applicationResponse.getSmsMethod()); provisioning.setSmsStatusCallback(applicationResponse.getSmsStatusCallback()); provisioning.setSmsUrl(applicationResponse.getSmsUrl()); provisioning.setStatusCallBack(applicationResponse.getStatusCallback()); provisioning.setStatusCallbackMethod(applicationResponse.getStatusCallbackMethod()); provisioning.setVoiceFallbackMethod(applicationResponse.getVoiceFallbackMethod()); provisioning.setVoiceFallbackUrl(applicationResponse.getVoiceFallback()); provisioning.setNumber(number); provisioning.setVoiceUrl( applicationResponse.getVoiceUrl() == null ? applicationResponse.getTrunkSid() : applicationResponse.getVoiceUrl()); provisioningDao.updateProvisioning(provisioning); purchaseHistory.setNumberProvisioning(provisioning); purchaseHistoryDao.createNewPurchaseHistory(purchaseHistory); } catch (Exception e) { LOG.error(ImiDataFormatUtils.getStackTrace(e)); } }
public PurchaseHistory updatePurchasehistory(Purchase purchase) { PurchaseHistory purchasehistory = new PurchaseHistory(); try { purchasehistory.setEndDate(ImiDataFormatUtils.getmaxDateString()); purchasehistory.setMonthlyRentalRate(purchase.getMonthlyRentalRate()); purchasehistory.setNumber(purchase.getNumber()); purchasehistory.setNumberType(purchase.getNumberType()); purchasehistory.setNumberProviderCountry(purchase.getNumberProviderCountry()); purchasehistory.setResourceManagerId(purchase.getResouceManagerId()); purchasehistory.setRestrictions(purchase.getRestrictions()); purchasehistory.setSetUpRate(purchase.getSetUpRate()); purchasehistory.setSmsPrice(purchase.getSmsRate()); purchasehistory.setStartDate(purchase.getEffectiveDate()); purchasehistory.setVoicePrice(purchase.getVoicePrice()); purchaseHistoryDao.createNewPurchaseHistory(purchasehistory); } catch (Exception e) { LOG.error(ImiDataFormatUtils.getStackTrace(e)); } return purchasehistory; }