/**
  * @param OpenpayCardType $object
  * @param array $data
  * @return OpenpayCardType
  */
 public function populate(OpenpayCardType $object, array $data)
 {
     /* Mandatory fields */
     $object->setHolderName($data['holder_name']);
     $object->setExpirationMonth($data['expiration_month']);
     $object->setExpirationYear($data['expiration_year']);
     /* Optional Fields */
     if (isset($data['address'])) {
         $openpayAddressType = $this->openpayAddressMapper->create($data['address']);
         $object->setAddress($openpayAddressType);
     }
     $object->setCvv2(isset($data['cvv2']) ? $data['cvv2'] : null);
     $object->setAllowsCharges(isset($data['allows_charges']) ? $data['allows_charges'] : null);
     $object->setAllowsPayouts(isset($data['allows_payouts']) ? $data['allows_payouts'] : null);
     $object->setBankCode(isset($data['bank_code']) ? $data['bank_code'] : null);
     $object->setBankName(isset($data['bank_name']) ? $data['bank_name'] : null);
     $object->setBrand(isset($data['brand']) ? $data['brand'] : null);
     $object->setCardNumber(isset($data['card_number']) ? $data['card_number'] : null);
     $object->setCreationDate(isset($data['creation_date']) ? $data['creation_date'] : null);
     $object->setCustomerId(isset($data['customer_id']) ? $data['customer_id'] : null);
     $object->setId(isset($data['id']) ? $data['id'] : null);
     $object->setPointsCard(isset($data['points_card']) ? $data['points_card'] : null);
     $object->setType(isset($data['type']) ? $data['type'] : null);
     return $object;
 }
 /**
  * @param OpenpayCustomerType $object
  * @param array $data
  * @return OpenpayCustomerType
  */
 public function populate(OpenpayCustomerType $object, array $data)
 {
     $object->setName($data['name']);
     $object->setLastName($data['last_name']);
     $object->setEmail($data['email']);
     $object->setPhoneNumber($data['phone_number']);
     $object->setClabe($data['clabe']);
     if (isset($data['address'])) {
         $addressType = $this->addressMapper->create($data['address']);
         $object->setAddress($addressType);
     }
     if (isset($data['creation_date'])) {
         $object->setCreationDate($data['creation_date']);
     }
     if (isset($data['id'])) {
         $object->setId($data['id']);
     }
     if (isset($data['status'])) {
         $object->setStatus($data['status']);
     }
     if (isset($data['balance'])) {
         $object->setBalance($data['balance']);
     }
     if (isset($data['store'])) {
         $storeType = $this->storeMapper->create($data['store']);
         $object->setStore($storeType);
     }
     return $object;
 }