public String makeDefaultCustomerPayment(HttpServletRequest request, Model model, Long customerPaymentId) { CustomerPayment customerPayment = customerPaymentService.readCustomerPaymentById(customerPaymentId); if (customerPayment == null) { throw new IllegalArgumentException("Requested customer payment does not exist."); } customerPaymentService.setAsDefaultPayment(customerPayment); return getCustomerPaymentView(); }
protected void copyCustomerPaymentAddressToBillingAddress(PaymentInfoForm paymentForm) { CustomerPayment customerPayment = customerPaymentService.readCustomerPaymentById(paymentForm.getCustomerPaymentId()); if (customerPayment != null) { Address address = customerPayment.getBillingAddress(); if (address != null) { paymentForm.setAddress(addressService.copyAddress(address)); } } }
@Override public DynamicResultSet fetch(PersistencePackage persistencePackage, CriteriaTransferObject cto, DynamicEntityDao dynamicEntityDao, RecordHelper helper) throws ServiceException { OperationType fetchType = persistencePackage.getPersistencePerspective().getOperationTypes().getFetchType(); PersistenceModule persistenceModule = helper.getCompatibleModule(fetchType); DynamicResultSet drs = persistenceModule.fetch(persistencePackage, cto); for (Entity entity : drs.getRecords()) { Property customerPaymentId = entity.findProperty("id"); if (customerPaymentId != null) { CustomerPayment customerPayment = customerPaymentService.readCustomerPaymentById(Long.parseLong(customerPaymentId.getValue())); if (customerPayment != null) { String savedPaymentDisplayValue = buildSavedPaymentDisplayValue(customerPayment); Property derivedLabel = new Property(); derivedLabel.setName(SAVED_PAYMENT_INFO); derivedLabel.setValue(savedPaymentDisplayValue); entity.addProperty(derivedLabel); } } } return drs; }
CustomerPayment customerPayment = customerPaymentService.readCustomerPaymentById(paymentForm.getCustomerPaymentId());
customerPayment = customerPaymentService.readCustomerPaymentById(billingForm.getCustomerPaymentId());