Example #1
0
 /**
  * install plugin
  */
 public static function install()
 {
     if (!class_exists("CoreShop\\Version") || (int) \CoreShop\Version::getBuildNumber() < self::$requiredCoreShopBuild) {
         return 'You need CoreShop (at least build' . self::$requiredCoreShopBuild . ') to run this plugin.';
     }
     return 'Plugin has been successfully installed. Please reload Pimcore.';
 }
Example #2
0
 /**
  * Install Plugin
  */
 public static function install()
 {
     if (!class_exists("CoreShop\\Version") || (int) \CoreShop\Version::getBuildNumber() < self::$requiredCoreShopBuild) {
         return 'You need CoreShop (at least build' . self::$requiredCoreShopBuild . ') to run this plugin.';
     }
     if (class_exists("\\CoreShop\\Plugin")) {
         \CoreShop\Plugin::installPlugin(self::getShop()->getInstall());
     }
 }
 public function paymentAction()
 {
     $configkey = \CoreShop\Model\Configuration::get('SOFORTUEBERWEISUNG.KEY');
     $sofort = new \Sofort\SofortLib\Sofortueberweisung($configkey);
     $sofort->setAmount(Tool::numberFormat($this->cart->getTotal()));
     $sofort->setVersion('CoreShop ' . \CoreShop\Version::getVersion());
     $sofort->setReason('Buy Order (CoreShop)');
     $sofort->setCurrencyCode(Tool::getCurrency()->getIsoCode());
     $sofort->setSuccessUrl(Pimcore\Tool::getHostUrl() . $this->getModule()->url($this->getModule()->getIdentifier(), 'payment-return'));
     $sofort->setAbortUrl(Pimcore\Tool::getHostUrl() . $this->getModule()->url($this->getModule()->getIdentifier(), 'payment-return-abort'));
     $sofort->sendRequest();
     if ($sofort->isError()) {
         var_dump($sofort);
         die('error');
     } else {
         $transactionId = $sofort->getTransactionId();
         $this->cart->setCustomIdentifier($transactionId);
         $this->cart->save();
         $this->redirect($sofort->getPaymentUrl());
     }
 }