Exemple #1
0
 /**
  * @param String $street First street address. Required if using a
  *      shipping address. Character length and limitations: 100 single-byte
  *      characters.
  * @param String $city Name of city. Required if using a shipping address.
  *      Character length and limitations: 40 single-byte characters.
  * @param String $state State or province. Required if using a shipping
  *      address. Character length and limitations: 40 single-byte characters.
  * @param Country $country
  * @return Address to be used as request
  */
 public static function getRequest($street, $city, $state, Country $country)
 {
     $address = new self();
     $address->collection = new Collection(self::$allowedValues, null);
     $address->collection->setValue('STREET', $street);
     $address->collection->setValue('CITY', $city);
     $address->collection->setValue('STATE', $state);
     $address->collection->setValue('COUNTRYCODE', $country->getCode());
     return $address;
 }
Exemple #2
0
 /**
  * Required if using a shipping address.
  *
  * @param Country $country
  */
 public function setCountry(Country $country)
 {
     $this->collection->setValue('SHIPTOCOUNTRYCODE', $country->getCode());
 }