public PaymentInfoForm() { address.setPhonePrimary(new PhoneImpl()); address.setPhoneSecondary(new PhoneImpl()); address.setPhoneFax(new PhoneImpl()); }
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 CustomerAddressForm() { address.setPhonePrimary(new PhoneImpl()); address.setPhoneSecondary(new PhoneImpl()); address.setPhoneFax(new PhoneImpl()); }
public BillingInfoForm() { address.setPhonePrimary(new PhoneImpl()); address.setPhoneSecondary(new PhoneImpl()); address.setPhoneFax(new PhoneImpl()); }
public ShippingInfoForm() { address.setPhonePrimary(new PhoneImpl()); address.setPhoneSecondary(new PhoneImpl()); address.setPhoneFax(new PhoneImpl()); }
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 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 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(); }
public CheckoutForm() { shippingAddress = new AddressImpl(); billingAddress = new AddressImpl(); shippingAddress.setPhonePrimary(new PhoneImpl()); billingAddress.setPhonePrimary(new PhoneImpl()); shippingAddress.setPhoneSecondary(new PhoneImpl()); billingAddress.setPhoneSecondary(new PhoneImpl()); shippingAddress.setPhoneFax(new PhoneImpl()); billingAddress.setPhoneFax(new PhoneImpl()); shippingAddress.setIsoCountryAlpha2(new ISOCountryImpl()); billingAddress.setIsoCountryAlpha2(new ISOCountryImpl()); isSameAddress = true; /** * @deprecated - setCountry() and setState() on address have been deprecated in favor of ISO standardization. * Leaving here for legacy implementations. */ shippingAddress.setCountry(new CountryImpl()); billingAddress.setCountry(new CountryImpl()); shippingAddress.setState(new StateImpl()); billingAddress.setState(new StateImpl()); }
form.getAddress().setPhonePrimary(null);
if ((paymentForm.getAddress().getPhonePrimary() != null) && (StringUtils.isEmpty(paymentForm.getAddress().getPhonePrimary().getPhoneNumber()))) { paymentForm.getAddress().setPhonePrimary(null);
billingForm.getAddress().setPhonePrimary(null);
Phone billingPhone = phoneService.create(); billingPhone.setPhoneNumber(dto.getAddressPhone()); address.setPhonePrimary(billingPhone);
shippingForm.getAddress().setPhonePrimary(null);
cloned.setZipFour(zipFour); cloned.setPhoneFax(phoneFax); cloned.setPhonePrimary(phonePrimary); cloned.setPostalCode(postalCode); cloned.setFax(fax);
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()));
address1.setPhonePrimary(primary); address2.setPhonePrimary(primary2);
address1.setPhonePrimary(primary); address2.setPhonePrimary(primary2);
@Override public Address updateEntity(final Address address, final AddressDto addressDto) { address.setAddressLine1(Optional.ofNullable(addressDto.getAddressLine1()).orElse("")); address.setAddressLine2(addressDto.getAddressLine2()); address.setAddressLine3(addressDto.getAddressLine3()); address.setFirstName(addressDto.getFirstName()); address.setLastName(addressDto.getLastName()); address.setCity(Optional.ofNullable(addressDto.getCity()).orElse("")); address.setPostalCode(addressDto.getPostalCode()); address.setCompanyName(addressDto.getCompanyName()); address.setCounty(addressDto.getCountrySubdivisionCode()); address.setIsoCountrySubdivision(addressDto.getCountrySubdivisionCode()); Optional.ofNullable(addressDto.getCountryCode()) .ifPresent(countryCode -> address.setIsoCountryAlpha2(isoService.findISOCountryByAlpha2Code(countryCode))); address.setEmailAddress(addressDto.getEmail()); Optional.ofNullable(addressDto.getPhone()).ifPresent(phone -> address.setPhonePrimary(phoneNumberFormat.parseObject(phone, new ParsePosition(0))) ); return address; }