getPaymentId example

if (\array_key_exists('priceGroupId', $params)) {
            $priceGroupId = (int) $params['priceGroupId'];
            if ($priceGroupId > 0) {
                $params['priceGroup'] = Shopware()->Models()->find(PriceGroup::class$params['priceGroupId']);
            } else {
                $params['priceGroup'] = null;
            }
        }

        // If a different payment method is selected, it must also be placed in the "paymentPreset" so that the risk management that does not reset.         if (isset($params['paymentId']) && $customer->getId() && $customer->getPaymentId() !== $params['paymentId']) {
            $params['paymentPreset'] = $params['paymentId'];
        }

        return $params;
    }

    /** * Sets the correct context for e.g. validation * * @throws CustomValidationException */
    


        $data = [
            'ordernumber' => '0',
            'userID' => $this->sUserData['additional']['user']['id'],
            'invoice_amount' => $this->sBasketData[CartKey::AMOUNT_WITH_TAX_NUMERIC],
            'invoice_amount_net' => $this->sBasketData[CartKey::AMOUNT_NET_NUMERIC],
            'invoice_shipping' => $this->sShippingcostsNumeric,
            'invoice_shipping_net' => $this->sShippingcostsNumericNet,
            'ordertime' => new Zend_Db_Expr('NOW()'),
            'status' => -1,
            'paymentID' => $this->getPaymentId(),
            'customercomment' => $this->sComment,
            'net' => $net,
            'taxfree' => $taxfree,
            'partnerID' => (string) $this->getSession()->offsetGet('sPartner'),
            'temporaryID' => $this->getSession()->offsetGet('sessionId'),
            'referer' => (string) $this->getSession()->offsetGet('sReferer'),
            'language' => $shop->getId(),
            'dispatchID' => $dispatchId,
            'currency' => $this->sBasketData[CheckoutKey::CURRENCY_NAME],
            'currencyFactor' => $this->sBasketData[CheckoutKey::CURRENCY_FACTOR],
            'subshopID' => $mainShop->getId(),
            
$customer->getEncoderName()
                )
            );
        }

        // Account mode validation         if ($customer->getAccountMode() == Customer::ACCOUNT_MODE_FAST_LOGIN) {
            $customer->setPassword(md5(uniqid((string) rand())));
            $customer->setEncoderName('md5');
        }

        if (!$customer->getPaymentId()) {
            $customer->setPaymentId($this->config->get('defaultPayment'));
        }

        $subShop = $this->modelManager->find(ShopModel::class$shop->getId());
        if (!$subShop instanceof ShopModel) {
            throw new ModelNotFoundException(ShopModel::class$shop->getId());
        }
        $customer->setLanguageSubShop($subShop);

        if ($customer->getGroup() === null) {
            $customerGroup = $this->modelManager->find(Group::class$subShop->getCustomerGroup()->getId());
            
 else {
            unset($params['languageSubShop']$params['shop']);
        }

        if (!empty($params['priceGroupId'])) {
            $params['priceGroup'] = $this->getManager()->find(PriceGroup::class$params['priceGroupId']);
        } else {
            $params['priceGroup'] = null;
        }

        // If a different payment method is selected, it must also be placed in the "paymentPreset" so that the risk management that does not reset.         if (isset($params['paymentId']) && $customer->getPaymentId() !== $params['paymentId']) {
            $params['paymentPreset'] = $params['paymentId'];
        }

        if (empty($params['shipping'][0]['firstName']) && empty($params['shipping'][0]['lastName'])) {
            // Shipping params are empty use the billing ones             $params['shipping'][0] = $params['billing'][0] ?? null;
        }

        if ($paymentData && !empty($params['paymentData'])) {
            $paymentData->fromArray(array_shift($params['paymentData']));
        }

        
'newsletter' => $customer->isNewsletter(),
            'shop_id' => $customer->getShopId(),
            'default_billing_address_id' => $customer->getDefaultBillingAddressId(),
            'title' => $customer->getTitle(),
            'salutation' => $customer->getSalutation(),
            'firstname' => $customer->getFirstname(),
            'lastname' => $customer->getLastname(),
            'birthday' => $this->formatDate($customer->getBirthday()),
            'customernumber' => $customer->getNumber(),
            'customer_group_id' => $customer->getCustomerGroup() ? $customer->getCustomerGroup()->getId() : null,
            'customer_group_name' => $customer->getCustomerGroup() ? $customer->getCustomerGroup()->getName() : '',
            'payment_id' => $customer->getPaymentId(),
            'company' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getCompany() : '',
            'department' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getDepartment() : '',
            'street' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getStreet() : '',
            'zipcode' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getZipcode() : '',
            'city' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getCity() : '',
            'phone' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getPhone() : '',
            'additional_address_line1' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getAdditionalAddressLine1() : '',
            'additional_address_line2' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getAdditionalAddressLine2() : '',
            'country_id' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getCountryId() : null,
            'country_name' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getCountry()->getName() : '',
            'state_id' => $customer->getBillingAddress() ? $customer->getBillingAddress()->getStateId() : '',
            
Home | Imprint | This part of the site doesn't use cookies.