PaymentModel example

/** * @throws \Shopware\Components\Api\Exception\ValidationException * @throws Exception * * @return PaymentModel */
    public function create(array $params)
    {
        $this->checkPrivilege('create');

        $payment = new PaymentModel();

        $payment->setAdditionalDescription('');

        $params = $this->preparePaymentData($params);

        $payment->fromArray($params);

        $violations = $this->getManager()->validate($payment);

        if ($violations->count() > 0) {
            throw new ApiException\ValidationException($violations);
        }
Home | Imprint | This part of the site doesn't use cookies.