public void removeUnusedPhones(ShippingInfoForm form) { Address address = form.getAddress(); Phone primaryPhone = address.getPhonePrimary(); Phone secondaryPhone = address.getPhoneSecondary(); Phone faxPhone = address.getPhoneFax(); if ((primaryPhone != null) && (StringUtils.isEmpty(primaryPhone.getPhoneNumber()))) { address.setPhonePrimary(null); } if ((secondaryPhone != null) && (StringUtils.isEmpty(secondaryPhone.getPhoneNumber()))) { address.setPhoneSecondary(null); } if ((faxPhone != null) && (StringUtils.isEmpty(faxPhone.getPhoneNumber()))) { address.setPhoneFax(null); } }
public void removeUnusedPhones(CustomerAddressForm form) { if ((form.getAddress().getPhonePrimary() != null) && (StringUtils.isEmpty(form.getAddress().getPhonePrimary().getPhoneNumber()))) { form.getAddress().setPhonePrimary(null); } if ((form.getAddress().getPhoneSecondary() != null) && (StringUtils.isEmpty(form.getAddress().getPhoneSecondary().getPhoneNumber()))) { form.getAddress().setPhoneSecondary(null); } if ((form.getAddress().getPhoneFax() != null) && (StringUtils.isEmpty(form.getAddress().getPhoneFax().getPhoneNumber()))) { form.getAddress().setPhoneFax(null); } }
public void setAddress(Address address) { if (address.getPhonePrimary() == null) { address.setPhonePrimary(new PhoneImpl()); } if (address.getPhoneSecondary() == null) { address.setPhoneSecondary(new PhoneImpl()); } if (address.getPhoneFax() == null) { address.setPhoneFax(new PhoneImpl()); } this.address = address; }
public String addCustomerPayment(HttpServletRequest request, Model model, PaymentInfoForm paymentInfoForm, BindingResult bindingResult) { Customer customer = CustomerState.getCustomer(); addressService.populateAddressISOCountrySub(paymentInfoForm.getAddress()); paymentInfoFormValidator.validate(paymentInfoForm, bindingResult); if (!bindingResult.hasErrors()) { if ((paymentInfoForm.getAddress().getPhonePrimary() != null) && (StringUtils.isEmpty(paymentInfoForm.getAddress().getPhonePrimary().getPhoneNumber()))) { paymentInfoForm.getAddress().setPhonePrimary(null); } if ((paymentInfoForm.getAddress().getPhoneSecondary() != null) && (StringUtils.isEmpty(paymentInfoForm.getAddress().getPhoneSecondary().getPhoneNumber()))) { paymentInfoForm.getAddress().setPhoneSecondary(null); } if ((paymentInfoForm.getAddress().getPhoneFax() != null) && (StringUtils.isEmpty(paymentInfoForm.getAddress().getPhoneFax().getPhoneNumber()))) { paymentInfoForm.getAddress().setPhoneFax(null); } savedPaymentService.addSavedPayment(customer, paymentInfoForm); return getCustomerPaymentRedirect(); } return getCustomerPaymentView(); }
if ((form.getAddress().getPhonePrimary() != null) && (StringUtils.isEmpty(form.getAddress().getPhonePrimary().getPhoneNumber()))) { form.getAddress().setPhonePrimary(null);
if ((paymentForm.getAddress().getPhonePrimary() != null) && (StringUtils.isEmpty(paymentForm.getAddress().getPhonePrimary().getPhoneNumber()))) { paymentForm.getAddress().setPhonePrimary(null);
if (fgAddress.getPhonePrimary() != null) { phone = fgAddress.getPhonePrimary().getPhoneNumber();
if (billAddress.getPhonePrimary() != null) { phone = billAddress.getPhonePrimary().getPhoneNumber();
if ((billingForm.getAddress().getPhonePrimary() != null) && (StringUtils.isEmpty(billingForm.getAddress().getPhonePrimary().getPhoneNumber()))) { billingForm.getAddress().setPhonePrimary(null);
if ((shippingForm.getAddress().getPhonePrimary() != null) && (StringUtils.isEmpty(shippingForm.getAddress().getPhonePrimary().getPhoneNumber()))) { shippingForm.getAddress().setPhonePrimary(null);
dest.setSecondaryPhone(orig.getSecondaryPhone()); dest.setFax(orig.getFax()); dest.setPhonePrimary(phoneService.copyPhone(dest.getPhonePrimary(), orig.getPhonePrimary())); dest.setPhoneSecondary(phoneService.copyPhone(dest.getPhoneSecondary(), orig.getPhoneSecondary())); dest.setPhoneFax(phoneService.copyPhone(dest.getPhoneFax(), orig.getPhoneFax()));
@Override public AddressDto createDto(final Address address, final boolean embed, final boolean link) { return AddressDto.builder() .addressLine1(address.getAddressLine1()) .addressLine2(address.getAddressLine2()) .addressLine3(address.getAddressLine3()) .firstName(address.getFirstName()) .lastName(address.getLastName()) .city(address.getCity()) .postalCode(address.getPostalCode()) .companyName(address.getCompanyName()) .countryCode(Optional.ofNullable(address.getIsoCountryAlpha2()).map(ISOCountry::getAlpha2).orElse(null)) .countrySubdivisionCode(address.getIsoCountrySubdivision()) .email(address.getEmailAddress()) .phone(Optional.ofNullable(address.getPhonePrimary()).map(phoneNumberFormat::format).orElse(null)) .build(); }