Saves payment parameters changes.
347837
public function save()
    {
        parent::save();

        $soxId = $this->getEditObjectId();
        $aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
        // checkbox handling
        if (!isset($aParams['oxpayments__oxactive'])) {
            $aParams['oxpayments__oxactive'] = 0;
        }
        if (!isset($aParams['oxpayments__oxchecked'])) {
            $aParams['oxpayments__oxchecked'] = 0;
        }

        $oPayment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);

        if ($soxId != "-1") {
            $oPayment->loadInLang($this->_iEditLang, $soxId);
        } else {
            $aParams['oxpayments__oxid'] = null;
            //$aParams = $oPayment->ConvertNameArray2Idx( $aParams);
        }

        $oPayment->setLanguage(0);
        $oPayment->assign($aParams);

        // setting add sum calculation rules
        $aRules = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("oxpayments__oxaddsumrules");
        // if sum eqals 0, show notice, that default value will be used.
        if (empty($aRules)) {
            $this->_aViewData["noticeoxaddsumrules"] = 1;
        }
        $oPayment->oxpayments__oxaddsumrules = new \OxidEsales\Eshop\Core\Field(array_sum($aRules));


        //#708
        if (!is_array($this->_aFieldArray)) {
            $this->_aFieldArray = \OxidEsales\Eshop\Core\Registry::getUtils()->assignValuesFromText($oPayment->oxpayments__oxvaldesc->value);
        }

        // build value
        $sValdesc = "";
        foreach ($this->_aFieldArray as $oField) {
            $sValdesc .= $oField->name . "__@@";
        }

        $oPayment->oxpayments__oxvaldesc = new \OxidEsales\Eshop\Core\Field($sValdesc, \OxidEsales\Eshop\Core\Field::T_RAW);
        $oPayment->setLanguage($this->_iEditLang);
        $oPayment->save();

        // set oxid if inserted
        $this->setEditObjectId($oPayment->getId());
    }
931131
def save(self):
        
        if not self.vads_trans_date:
            self.vads_trans_date = datetime.datetime.utcnow().replace(
                tzinfo=utc).strftime("%Y%m%d%H%M%S")
        if not self.vads_trans_id:
            self.vads_trans_id = tools.get_vads_trans_id(
                self.vads_site_id, self.vads_trans_date)
        if self.theme and not self.vads_theme_config:
            self.vads_theme_config = str(self.theme)
        if not self.pk:
            super(PaymentRequest, self).save()
        self.set_vads_payment_config()
        self.set_signature()
        super(PaymentRequest, self).save()
503411
public void save(Map<String, Object> changedValues) {
        operationDelegate.onSaveResource(IIOP_OPENJDK_SUBSYSTEM_TEMPLATE, null, changedValues,
                new CrudOperationDelegate.Callback() {
                    @Override
                    public void onSuccess(final AddressTemplate addressTemplate, final String name) {
                        Console.info(Console.MESSAGES.modified("IIOP Subsystem"));
                        refresh();
                    }

                    @Override
                    public void onFailure(final AddressTemplate addressTemplate, final String name, final Throwable t) {
                        Console.error(Console.MESSAGES.modificationFailed("IIOP Subsystem"), t.getMessage());
                        refresh();
                    }
                });
    }
1354919
public function save()
    {
        parent::save();

        $config = \OxidEsales\Eshop\Core\Registry::getConfig();
        /** @var \OxidEsales\PayPalModule\Core\Config $payPalConfig */
        $payPalConfig = oxNew(\OxidEsales\PayPalModule\Core\Config::class);

        $deliverySetId = $this->getEditObjectId();
        $deliverySetMarked = (bool) $config->getRequestParameter('isPayPalDefaultMobilePayment');
        $mobileECDefaultShippingId = $payPalConfig->getMobileECDefaultShippingId();

        if ($deliverySetMarked && $deliverySetId != $mobileECDefaultShippingId) {
            $this->saveECDefaultShippingId($config, $deliverySetId, $payPalConfig);
        } elseif (!$deliverySetMarked && $deliverySetId == $mobileECDefaultShippingId) {
            $this->saveECDefaultShippingId($config, '', $payPalConfig);
        }
    }
1060566
def save(self, *args, **kwargs):
        
        cls = self.__class__
        if self.pk:
            rows = cls.objects.filter(
                pk=self.pk, _change=self._change).update(
                _change=self._change + 1)
            if not rows:
                raise ConcurrentModificationError(cls.__name__, self.pk)
            self._change += 1

        count = 0
        max_retries=3
        while True:
            try:
                return super(BaseModel, self).save(*args, **kwargs)
            except django.db.utils.OperationalError:
                if count >= max_retries:
                    raise
                count += 1
631150
public function saveAsInit()
	{

		$this->initDoubleBeforeSave();

		if (empty($this->payment->rrn)) {
			$this->payment->rrn = mt_rand(111111111111, 999999999999);
		}
		if (empty($this->payment->irn)) {
			$this->payment->irn = substr(strtoupper(md5($this->payment->rrn . time())), 10, 10);
		}
		$this->payment->status = Status::PROCESSED;
		$this->payment->save();
	}
414543
def save
        if @system_data and (something = @system_data[:client]) and something.respond_to?(:attributes)
          changes = 0
          something.attributes.each do |k, v|
            if self.send(k) != v
              something.send(k + '=', self.send(k))
              changes += 1
            end
          end
          something.save if changes > 0
        else
          raise TaskMapper::Exception.new("#{self.class.name}::#{this_method} method must be implemented by the provider")
        end
      end
577996
public void changeParameters()
    {
        //Get the session object
        String string = null;
        String strPreferences = this.getProperty(DBParams.PREFERENCES);   // Changing parameters
        boolean bSetDefault = true;
        if ((strPreferences == null) || (strPreferences.length() == 0))
            bSetDefault = false;    // Set using a URL (vs set using a form)

        Application application = (BaseApplication)this.getTask().getApplication();

        string = this.getProperty(DBParams.FRAMES);
        if (bSetDefault)
            if (string == null)
                string = DBConstants.NO;
        if (string != null)
            application.setProperty(DBParams.FRAMES, string);

        string = this.getProperty(DBParams.MENUBARS);
        if (bSetDefault)
            if (string == null)
                string = UserInfoModel.YES;
        if (string != null)
            application.setProperty(DBParams.MENUBARS, string);

        string = this.getProperty(DBParams.NAVMENUS);
        if (bSetDefault)
            if (string == null)
                string = UserInfoModel.NO_ICONS;
        if (string != null)
            application.setProperty(DBParams.NAVMENUS, string);

        string = this.getProperty(DBParams.JAVA);
        if (bSetDefault)
            if (string == null)
                string = UserInfoModel.DEFAULT;        // Changing parameters
        if (string != null)
            application.setProperty(DBParams.JAVA, string);

        string = this.getProperty(DBParams.BANNERS);
        if (bSetDefault)
            if (string == null)
                string = DBConstants.NO;
        if (string != null)
            application.setProperty(DBParams.BANNERS, string);

        string = this.getProperty(DBParams.LOGOS);
        if (bSetDefault)
            if (string == null)
                string = UserInfoModel.HOME_PAGE_ONLY;
        if (string != null)
            application.setProperty(DBParams.LOGOS, string);

        string = this.getProperty(DBParams.TRAILERS);
        if (bSetDefault)
            if (string == null)
                string = UserInfoModel.HOME_PAGE_ONLY;
        if (string != null)
            application.setProperty(DBParams.TRAILERS, string);

        string = this.getProperty(DBConstants.SYSTEM_NAME);
        if (string != null)
            application.setProperty(DBConstants.SYSTEM_NAME, string);

        string = this.getProperty(DBConstants.MODE);
        if (string != null)
            application.setProperty(DBConstants.MODE, string);

        string = this.getProperty(DBParams.LANGUAGE);
        if (bSetDefault)
            if (string == null)
                string = UserInfoModel.DEFAULT; /** en (english)*/;
        if (string != null)
            application.setLanguage(string);
        
        if (application instanceof MainApplication)
        {   // Always
            ((MainApplication)application).readUserInfo(true, true);   // Flush the new properties
        }
    }
1023589
def sync(self, data):
        """"""
        for k, v in data.get('billing', {}).items():
            setattr(self, k, v)
        self.card_number = data.get('credit_card', {}).get('card_number',
                                                           self.card_number)
        self.save(sync=False)
542549
private void save() {

        if ((m_focalPoint != null) && isEditable()) {
            int x = (int)m_focalPoint.getX();
            int y = (int)m_focalPoint.getY();
            String val = "" + x + "," + y;
            CmsUUID sid = m_imageInfoProvider.get().getStructureId();
            List<CmsPropertyModification> propChanges = new ArrayList<>();
            propChanges.add(new CmsPropertyModification(sid, CmsGwtConstants.PROPERTY_IMAGE_FOCALPOINT, val, false));
            final CmsPropertyChangeSet changeSet = new CmsPropertyChangeSet(sid, propChanges);
            CmsRpcAction<Void> action = new CmsRpcAction<Void>() {

                @Override
                public void execute() {

                    CmsCoreProvider.getVfsService().saveProperties(changeSet, this);

                }

                @SuppressWarnings("synthetic-access")
                @Override
                protected void onResponse(Void result) {

                    m_savedFocalPoint = m_focalPoint;

                    if (m_pointWidget != null) {
                        m_pointWidget.setIsDefault(false);
                    }
                    m_imageInfoProvider.get().setFocalPoint(m_focalPoint);
                    if (m_nextAction != null) {
                        m_nextAction.run();
                    }

                }
            };
            action.execute();

        }
    }
607555
public function save()
    {
        // save article changes
        $aArticleChanges = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('editval');
        $oArticle = $this->getArticle();
        $oArticle->assign($aArticleChanges);
        $oArticle->save();

        //update article files
        $aArticleFiles = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('article_files');
        if (is_array($aArticleFiles)) {
            foreach ($aArticleFiles as $sArticleFileId => $aArticleFileUpdate) {
                $oArticleFile = oxNew(\OxidEsales\Eshop\Application\Model\File::class);
                $oArticleFile->load($sArticleFileId);
                $aArticleFileUpdate = $this->_processOptions($aArticleFileUpdate);
                $oArticleFile->assign($aArticleFileUpdate);

                if ($oArticleFile->isUnderDownloadFolder()) {
                    $oArticleFile->save();
                } else {
                    \OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay('EXCEPTION_NOFILE');
                }
            }
        }
    }
377929
protected function submitEditCurrency()
    {
        if ($this->isPosted('delete')) {
            $this->deleteCurrency();
        } else if ($this->isPosted('save') && $this->validateEditCurrency()) {
            if (isset($this->data_currency['code'])) {
                $this->updateCurrency();
            } else {
                $this->addCurrency();
            }
        }
    }
550664
def save
      self.attributes.stringify_keys!
      self.attributes.delete('customer')
      self.attributes.delete('product')
      self.attributes.delete('credit_card')
      self.attributes.delete('bank_account')
      self.attributes.delete('paypal_account')

      self.attributes, options = extract_uniqueness_token(attributes)
      self.prefix_options.merge!(options)
      super
    end
460460
def sync(self):
        """"""
        output = get_profile(self.profile_id)
        output['response'].raise_if_error()
        for payment_profile in output['payment_profiles']:
            instance, created = CustomerPaymentProfile.objects.get_or_create(
                customer_profile=self,
                payment_profile_id=payment_profile['payment_profile_id']
            )
            instance.sync(payment_profile)
828773
@Override
  public final synchronized void saveTradingSettings(
    final Map<String, Object> pAddParam,
      final TradingSettings pEntity) throws Exception {
    if (pEntity.getIsNew()) {
      throw new ExceptionWithCode(ExceptionWithCode.FORBIDDEN,
        "insert_not_allowed::" + pAddParam.get("user"));
    } else if (pEntity.getItsId() != 1L) {
      throw new ExceptionWithCode(ExceptionWithCode.FORBIDDEN,
        "id_not_allowed::" + pAddParam.get("user"));
    } else {
      getSrvOrm().updateEntity(pAddParam, pEntity);
      this.tradingSettings = null;
      lazyGetTradingSettings(pAddParam);
    }
  }
25618
def save(self, *args, **kwargs):
        '''
        
        '''

        # Set the received date if the payment was just marked received
        if not hasattr(self,'__received'):
            if self.received and not self.receivedDate:
                self.receivedDate = timezone.now()
        else:
            if self.received and not self.receivedDate and not self.__receivedDate:
                self.receivedDate = timezone.now()

        # Set the accrual date.  The method for series/events ensures that the accrualDate month
        # is the same as the reported month of the event/series by accruing to the start date of the first
        # occurrence in that month.
        if not self.accrualDate:
            if self.invoiceItem and self.invoiceItem.finalEventRegistration:
                min_event_time = self.invoiceItem.finalEventRegistration.event.eventoccurrence_set.filter(**{'startTime__month':self.invoiceItem.finalEventRegistration.event.month}).first().startTime
                self.accrualDate = min_event_time
            elif self.event:
                self.accrualDate = self.event.eventoccurrence_set.order_by('startTime').filter(**{'startTime__month': self.event.month}).last().startTime
            elif self.invoiceItem:
                self.accrualDate = self.invoiceItem.invoice.creationDate
            elif self.receivedDate:
                self.accrualDate = self.receivedDate
            elif self.submissionDate:
                self.accrualDate = self.submissionDate
            else:
                self.submissionDate = timezone.now()
                self.accrualDate = self.submissionDate

        # Now, set the registration property and check that this item is not attributed
        # to multiple categories.
        if self.invoiceItem and self.invoiceItem.finalEventRegistration:
            self.event = self.invoiceItem.finalEventRegistration.event
        elif self.invoiceItem and self.invoiceItem.temporaryEventRegistration:
            self.event = self.invoiceItem.temporaryEventRegistration.event

        # If no grossTotal is reported, use the net total.  If no net total is reported, use the grossTotal
        if self.grossTotal is None and self.total:
            self.grossTotal = self.total
        if self.total is None and self.grossTotal:
            self.total = self.grossTotal

        super(RevenueItem, self).save(*args, **kwargs)
        self.__received = self.received
        self.__receivedDate = self.receivedDate

        # If a file is attached, ensure that it is not public, and that it is saved in the 'Expense Receipts' folder
        if self.attachment:
            try:
                self.attachment.folder = Folder.objects.get(name=_('Revenue Receipts'))
            except ObjectDoesNotExist:
                pass
            self.attachment.is_public = False
            self.attachment.save()
1241795
@Override
  public final synchronized void saveAccSettings(
    final Map<String, Object> pAddParam,
      final AccSettings pEntity) throws Exception {
    if (pEntity.getIsNew()) {
      throw new ExceptionWithCode(ExceptionWithCode.FORBIDDEN,
        "Attempt to insert accounting settings by " + pAddParam.get("user"));
    } else {
      if (pEntity.getCostPrecision() < 0 || pEntity.getCostPrecision() > 4) {
        throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER,
          "precision_must_be_from_0_to_4");
      }
      if (pEntity.getPricePrecision() < 0 || pEntity.getPricePrecision() > 4) {
        throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER,
          "precision_must_be_from_0_to_4");
      }
      if (pEntity.getQuantityPrecision() < 0
        || pEntity.getQuantityPrecision() > 4) {
        throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER,
          "precision_must_be_from_0_to_4");
      }
      if (pEntity.getBalancePrecision() < 0
        || pEntity.getBalancePrecision() > 4) {
        throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER,
          "precision_must_be_from_0_to_4");
      }
      getSrvOrm().updateEntity(pAddParam, pEntity);
      retrieveAccSettings(pAddParam);
    }
  }