public function validate_address($id = false) { $this->loadModel('UserAddress'); $address = $this->UserAddress->findById($id); App::import('Vendor', 'UspsApi', array('file' => 'UspsApi.php')); $u = new UspsApi(); $res = $u->validate_address($address['UserAddress']); die(print_r(simplexml_load_string($res))); }
public function usps_address() { $this->loadModel('Warehouse'); $wh = $this->Warehouse->findById(1); $address = array("street" => "2669 Nutmeg Cir", "city" => "Simi Valley", "postal_code" => "93065", "province" => "CA", "apt" => ""); App::import("Vendor", "UspsApi", array("file" => "UspsApi.php")); $u = new UspsApi(false, $wh); $res = $u->validate_address($address); }