/**
  * @param OpenpayCustomerType $customerType
  * @return CustomerInterface
  */
 protected function populate(OpenpayCustomerType $customerType)
 {
     $object = clone $this->object;
     $addressMapper = $this->addressMapper->create($customerType->getAddress());
     $object->setEntityId($customerType->getId());
     $object->setAddress($addressMapper);
     $object->setBalance($customerType->getBalance());
     $object->setClabe($customerType->getClabe());
     $object->setCreationDate($customerType->getCreationDate());
     $object->setEmail($customerType->getEmail());
     $object->setName($customerType->getName());
     $object->setLastName($customerType->getLastName());
     $object->setPhoneNumber($customerType->getPhoneNumber());
     $storeType = $this->storeMapper->create($customerType->getStore());
     $object->setStore($storeType);
     return $object;
 }
Ejemplo n.º 2
0
 /**
  * @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;
 }