Exemplo n.º 1
0
 /**
  * Build WebProfile
  *
  * @return boolean|WebProfile
  */
 protected function buildWebProfile()
 {
     $webProfile = new WebProfile();
     if (Mage::getStoreConfig('iways_paypalplus/dev/web_profile_id')) {
         $webProfile->setId(Mage::getStoreConfig('iways_paypalplus/dev/web_profile_id'));
         return $webProfile;
     }
     try {
         $webProfile->setName('magento_' . microtime());
         $webProfile->setPresentation($this->buildWebProfilePresentation());
         $response = $webProfile->create($this->_apiContext);
         $this->saveWebProfileId($response->getId());
         return $response;
     } catch (\PayPal\Exception\PayPalConnectionException $ex) {
         Mage::helper('iways_paypalplus')->handleException($ex);
     }
     return false;
 }