/** * Check if the shop user is the same as PayPal user. * Fields: first name, last name, street, street nr, city - must be equal. * * @param oePayPalResponseGetExpressCheckoutDetails $oDetails - data returned from PayPal * * @return bool */ public function isSamePayPalUser($oDetails) { $aUserData = array(); $aUserData[] = getStr()->html_entity_decode($this->oxuser__oxfname->value); $aUserData[] = getStr()->html_entity_decode($this->oxuser__oxlname->value); $aCompareData = array(); $aCompareData[] = $oDetails->getFirstName(); $aCompareData[] = $oDetails->getLastName(); return $aUserData == $aCompareData && $this->isSameAddressPayPalUser($oDetails); }
/** * Test getting last name */ public function testGetLastName() { $oResponse = new oePayPalResponseGetExpressCheckoutDetails(); $oResponse->setData($this->_getResponseData()); $this->assertEquals('Surname', $oResponse->getLastName()); }