/** * @param OpenpayCardType $cardType * @return CardInterface */ protected function populate(OpenpayCardType $cardType) { $object = clone $this->object; $object->setCustomerId($cardType->getCustomerId()); $object->setCardId($cardType->getId()); $object->setCreatedAt($cardType->getCreationDate()); $object->setType($cardType->getType()); $object->setBrand($cardType->getBrand()); $object->setCardNumber($cardType->getCardNumber()); $object->setHolderName($cardType->getHolderName()); $object->setExpirationYear($cardType->getExpirationYear()); $object->setExpirationMonth($cardType->getExpirationMonth()); $object->setAllowsCharges($cardType->isAllowsCharges()); $object->setAllowsPayouts($cardType->isAllowsPayouts()); $object->setBankName($cardType->getBankName()); $object->setBankCode($cardType->getBankCode()); if (!is_null($cardType->getAddress())) { $address = $this->addressMapper->create($cardType->getAddress()); $object->setAddress($address); } return $object; }