public function __construct($user_obj)
 {
     global $ilUser;
     parent::__construct();
     if (isset($_SESSION['shop_user_id']) && $_SESSION['shop_user_id'] != ANONYMOUS_USER_ID) {
         ilPaymentShoppingCart::_assignObjectsToUserId($_SESSION['shop_user_id']);
         $this->user_obj = new ilObjUser($_SESSION['shop_user_id']);
     } else {
         if ($user_obj != NULL) {
             $this->user_obj = $user_obj;
         } else {
             if ($ilUser->getId() != ANONYMOUS_USER_ID) {
                 $this->user_obj = $ilUser;
                 $_SESSION['shop_user_id'] = null;
             } else {
                 $this->session_id = session_id();
             }
         }
     }
     $this->coupon_obj = new ilPaymentCoupons($this->user_obj);
     $ppSet = ilPaypalSettings::getInstance();
     $this->paypalConfig = $ppSet->getAll();
     //		$this->epSet = ilEPaySettings::getInstance();
     //		$this->epayConfig = $this->epSet->getAll();
     $this->checkCouponsOfShoppingCart();
     #$this->default_currency = ilPaymentCurrency::_getDefaultCurrency();
 }
 public function __construct($user_obj)
 {
     $this->user_obj = $user_obj;
     $this->pay_method = ilPayMethods::_getIdByTitle('paypal');
     $ppSet = ilPaypalSettings::getInstance();
     $this->paypalConfig = $ppSet->getAll();
     parent::__construct($this->user_obj, $this->pay_method);
 }
 public function __construct($user_obj)
 {
     parent::__construct();
     $this->user_obj = $user_obj;
     $this->session_id = session_id();
     $this->coupon_obj = new ilPaymentCoupons($this->user_obj);
     $ppSet = ilPaypalSettings::getInstance();
     $this->paypalConfig = $ppSet->getAll();
     //		$this->epSet = ilEPaySettings::getInstance();
     //		$this->epayConfig = $this->epSet->getAll();
     $this->checkCouponsOfShoppingCart();
     #$this->default_currency = ilPaymentCurrency::_getDefaultCurrency();
 }
 public function savePaypalSettingsObject()
 {
     include_once './Services/Payment/classes/class.ilPaypalSettings.php';
     global $rbacsystem;
     // MINIMUM ACCESS LEVEL = 'read'
     if (!$rbacsystem->checkAccess('read', $this->object->getRefId())) {
         $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'), $this->ilErr->MESSAGE);
     }
     $ppSet = ilPaypalSettings::getInstance();
     $ppSet->setServerHost(ilUtil::stripSlashes($_POST['server_host']));
     $ppSet->setServerPath(ilUtil::stripSlashes($_POST['server_path']));
     $ppSet->setVendor(ilUtil::stripSlashes($_POST['vendor']));
     //		$ppSet->setVendorPassword(ilUtil::stripSlashes($_POST['vendor_password']));
     $ppSet->setAuthToken(ilUtil::stripSlashes($_POST['auth_token']));
     $ppSet->setPageStyle(ilUtil::stripSlashes($_POST['page_style']));
     $ppSet->setSsl(ilUtil::stripSlashes($_POST['ssl']));
     if ($_POST['server_host'] == '' || $_POST['server_path'] == '' || $_POST['vendor'] == '' || $_POST['auth_token'] == '') {
         $this->error = $this->lng->txt('pays_paypal_settings_not_valid');
         ilUtil::sendFailure($this->error);
         $this->paypalSettingsObject();
         return true;
     }
     $ppSet->save();
     $this->paypalSettingsObject();
     ilUtil::sendSuccess($this->lng->txt('pays_updated_paypal_settings'));
     return true;
 }