/**
  * Test getting salutation
  */
 public function testGetSalutation()
 {
     $oResponse = new oePayPalResponseGetExpressCheckoutDetails();
     $oResponse->setData($this->_getResponseData());
     $this->assertEquals('this is salutation', $oResponse->getSalutation());
 }
Пример #2
0
 /**
  * Prepare address data array from PayPal response data.
  *
  * @param oePayPalResponseGetExpressCheckoutDetails $oPayPalData PayPal data.
  *
  * @return array
  */
 protected function _prepareDataPayPalUser($oPayPalData)
 {
     $aUserData = array();
     $oFullName = oxNew('oePayPalFullName', $oPayPalData->getShipToName());
     $aUserData['oxfname'] = $oFullName->getFirstName();
     $aUserData['oxlname'] = $oFullName->getLastName();
     $aStreet = $this->_splitShipToStreetPayPalUser($oPayPalData->getShipToStreet());
     $aUserData['oxstreet'] = $aStreet['street'];
     $aUserData['oxstreetnr'] = $aStreet['streetnr'];
     $aUserData['oxcity'] = $oPayPalData->getShipToCity();
     $oCountry = oxNew('oxCountry');
     $sCountryId = $oCountry->getIdByCode($oPayPalData->getShipToCountryCode());
     $aUserData['oxcountryid'] = $sCountryId;
     $sStateId = '';
     if ($oPayPalData->getShipToState()) {
         $oState = oxNew('oxState');
         $sStateId = $oState->getIdByCode($oPayPalData->getShipToState(), $sCountryId);
     }
     $aUserData['oxstateid'] = $sStateId;
     $aUserData['oxzip'] = $oPayPalData->getShipToZip();
     $aUserData['oxfon'] = $oPayPalData->getShipToPhoneNumber();
     $aUserData['oxaddinfo'] = $oPayPalData->getShipToStreet2();
     $aUserData['oxsal'] = $oPayPalData->getSalutation();
     $aUserData['oxcompany'] = $oPayPalData->getBusiness();
     return $aUserData;
 }