Пример #1
0
 /**
  * adds addressinformation to the consumerdata.
  * used {@link WirecardCEE_Stdlib_ConsumerData::getData()}
  *
  * @param WirecardCEE_Stdlib_ConsumerData_Address $address
  * @return WirecardCEE_Stdlib_ConsumerData
  */
 public function addAddressInformation(WirecardCEE_Stdlib_ConsumerData_Address $address)
 {
     $consumerData = array_merge($this->_consumerData, $address->getData());
     $this->_consumerData = $consumerData;
     return $this;
 }
 public function testAddAddressInformation()
 {
     $firstname = 'Kein';
     $lastname = 'Name';
     $billingAddress = new WirecardCEE_Stdlib_ConsumerData_Address(WirecardCEE_Stdlib_ConsumerData_Address::TYPE_BILLING);
     $billingAddress->setFirstname($firstname);
     $billingAddress->setLastname($lastname);
     $this->object->addAddressInformation($billingAddress);
     $data = $this->object->getData();
     $this->assertArrayHasKey('consumerBillingFirstname', $data);
     $this->assertArrayHasKey('consumerBillingLastname', $data);
     $this->assertEquals($firstname, $data['consumerBillingFirstname']);
     $this->assertEquals($lastname, $data['consumerBillingLastname']);
 }
Пример #3
0
 /**
  * @param Mage_Sales_Model_Order_Address $source
  * @param string $type
  *
  * @return WirecardCEE_Stdlib_ConsumerData_Address
  */
 protected function _getAddress($source, $type = 'billing')
 {
     switch ($type) {
         case 'shipping':
             $address = new WirecardCEE_Stdlib_ConsumerData_Address(WirecardCEE_Stdlib_ConsumerData_Address::TYPE_SHIPPING);
             break;
         default:
             $address = new WirecardCEE_Stdlib_ConsumerData_Address(WirecardCEE_Stdlib_ConsumerData_Address::TYPE_BILLING);
             break;
     }
     $address->setFirstname($source->getFirstname());
     $address->setLastname($source->getLastname());
     $address->setAddress1($source->getStreet1());
     $address->setAddress2($source->getStreet2());
     $address->setZipCode($source->getPostcode());
     $address->setCity($source->getCity());
     $address->setCountry($source->getCountry());
     $address->setState($source->getRegionCode());
     $address->setPhone($source->getTelephone());
     $address->setFax($source->getFax());
     return $address;
 }
 public function testGetData()
 {
     $data = $this->object->getData();
     $this->assertInternalType('array', $data);
 }