/** * Update a card. * * @param array $properties * * @return Card */ public function update(array $properties = array()) { $this->info(); if (!empty($properties['brand'])) { $this->local_card->brand = $properties['brand']; } if (!empty($properties['last4'])) { $this->local_card->last4 = $properties['last4']; } if (!empty($properties['name'])) { $this->local_card->name = $properties['name']; } if (!empty($properties['exp_month'])) { $this->local_card->exp_month = $properties['exp_month']; } if (!empty($properties['exp_year'])) { $this->local_card->exp_year = $properties['exp_year']; } if (!empty($properties['address_line1'])) { $this->local_card->address_line1 = $properties['address_line1']; } if (!empty($properties['address_line2'])) { $this->local_card->address_line2 = $properties['address_line2']; } if (!empty($properties['address_city'])) { $this->local_card->address_city = $properties['address_city']; } if (!empty($properties['address_state'])) { $this->local_card->address_state = $properties['address_state']; } if (!empty($properties['address_zip'])) { $this->local_card->address_zip = $properties['address_zip']; } if (!empty($properties['address_country'])) { $this->local_card->address_country = $properties['address_country']; } $this->local_card->save(); $this->gateway->apiDelay(); return $this; }