private ArrayList<ShippingMethod> getValidShippingMethods(ShippingInformation shippingInformation) { ArrayList<ShippingMethod> shippingMethods = new ArrayList<>(); shippingMethods.add(new ShippingMethod("UPS Ground", "ups-ground", "Arrives in 3-5 days", 0, "USD")); shippingMethods.add(new ShippingMethod("FedEx", "fedex", "Arrives tomorrow", 599, "USD")); if (shippingInformation.getAddress() != null && shippingInformation.getAddress().getPostalCode().equals("94110")) { shippingMethods.add(new ShippingMethod("1 Hour Courier", "courier", "Arrives in the next hour", 1099, "USD")); } return shippingMethods; }
/** * @param shippingInformation shippingInformation to populated into the widget input fields. */ public void populateShippingInfo(@Nullable ShippingInformation shippingInformation) { if (shippingInformation == null) { return; } Address address = shippingInformation.getAddress(); if (address != null) { mCityEditText.setText(address.getCity()); if (address.getCountry() != null && !address.getCountry().isEmpty()) { mCountryAutoCompleteTextView.setCountrySelected(address.getCountry()); } mAddressEditText.setText(address.getLine1()); mAddressEditText2.setText(address.getLine2()); mPostalCodeEditText.setText(address.getPostalCode()); mStateEditText.setText(address.getState()); } mNameEditText.setText(shippingInformation.getName()); mPhoneNumberEditText.setText(shippingInformation.getPhone()); }
assertEquals("eur", sepaDebitSource.getCurrency()); assertEquals("Eureka", sepaDebitSource.getOwner().getAddress().getCity()); assertEquals("90210", sepaDebitSource.getOwner().getAddress().getPostalCode()); assertEquals("EI", sepaDebitSource.getOwner().getAddress().getCountry()); assertEquals("Sepa Account Holder", sepaDebitSource.getOwner().getName());
assertEquals("eur", sepaDebitSource.getCurrency()); assertEquals("Eureka", sepaDebitSource.getOwner().getAddress().getCity()); assertEquals("90210", sepaDebitSource.getOwner().getAddress().getPostalCode()); assertEquals("123 Main St", sepaDebitSource.getOwner().getAddress().getLine1()); assertEquals("EI", sepaDebitSource.getOwner().getAddress().getCountry());
assertEquals("eur", sepaDebitSource.getCurrency()); assertEquals("Eureka", sepaDebitSource.getOwner().getAddress().getCity()); assertEquals("90210", sepaDebitSource.getOwner().getAddress().getPostalCode()); assertEquals("123 Main St", sepaDebitSource.getOwner().getAddress().getLine1()); assertEquals("EI", sepaDebitSource.getOwner().getAddress().getCountry());
assertEquals("Sheboygan", cardSource.getOwner().getAddress().getCity()); assertEquals("WI", cardSource.getOwner().getAddress().getState()); assertEquals("53081", cardSource.getOwner().getAddress().getPostalCode()); assertEquals("123 Main St", cardSource.getOwner().getAddress().getLine1()); assertEquals("#456", cardSource.getOwner().getAddress().getLine2());