Mark this payment as one-click payment template

Basically, this is a lazy method for setting $payOperation to OPERATION_ONE_CLICK

@param bool $oneClick

@return $this
162406
function setOneClickPayment($oneClick = true) {
		$this->payOperation = $oneClick ? self::OPERATION_ONE_CLICK : self::OPERATION_PAYMENT;
		return $this;
	}
312376
public static function disablePaymentMethod()
    {
        $payment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);
        if ($payment->load('oxidpaypal')) {
            $payment->oxpayments__oxactive = new \OxidEsales\Eshop\Core\Field(0);
            $payment->save();
        }
    }
103596
public function onPaymentPrepare(PaymentEvent $event)
    {
        $payment = $event->getPayment();

        $storage = $this->registry->getStorage(get_class($payment));

        $storage->update($payment);

        $captureToken = $this->factory->createCaptureToken(
            $payment->getMethod(),
            $payment,
            'ekyna_payment_done' // the route to redirect after capture
        );

        $event->setResponse(new RedirectResponse($captureToken->getTargetUrl()));
    }
1158507
public function setOpenToggle($toggle = null)
	{
		if (func_num_args() and is_bool($toggle))
		{
			$this->jsOpenToggle = $toggle;
		}

		return $this->jsOpenToggle;
	}
343473
public function pay(OrderPaymentEvent $event)
    {
        $order = $event->getOrder();

        /* call pay method */
        if (null === $paymentModule = ModuleQuery::create()->findPk($order->getPaymentModuleId())) {
            throw new \RuntimeException(
                Translator::getInstance()->trans(
                    "Failed to find a payment Module with ID=%mid for order ID=%oid",
                    [
                        "%mid" => $order->getPaymentModuleId(),
                        "%oid" => $order->getId()
                    ]
                )
            );
        }

        $paymentModuleInstance = $paymentModule->getPaymentModuleInstance($this->container);

        $response = $paymentModuleInstance->pay($order);

        if (null !== $response && $response instanceof Response) {
            $event->setResponse($response);
        }
    }
976557
public function codeReverseOneClick(OneClickReverseInput $codeReverseOneClickInput)
    {
        $codeReverseOneClick = new CodeReverseOneClick();
        $codeReverseOneClick->arg0 = $codeReverseOneClickInput;

        return $this->callSoapMethod('codeReverseOneClick', $codeReverseOneClick);
    }
1151501
public function click(WebDriverElement $element = null)
    {
        $this->action->addAction(
            new WebDriverClickAction($this->mouse, $element)
        );

        return $this;
    }
1281789
public function setNotForPayment($notForPayment = true)
    {
        parent::setNotForPayment($notForPayment);

        if ($notForPayment === true) {
            if ($this->getWithReferenceNumber() === true) {
                $this->setReferenceNumber('XXXXXXXXXXXXXXXXXXXX');
            }
            if ($this->getWithBankingCustomerId() === true) {
                $this->setBankingCustomerId('XXXXXX');
            }
        }

        return $this;
    }
1004523
public function doubleClick(WebDriverElement $element = null)
    {
        $this->action->addAction(
            new WebDriverDoubleClickAction($this->mouse, $element)
        );

        return $this;
    }
798225
public function incrementAndInvoice($count = 1)
    {
        $this->incrementQuantity($count);

        $this->user->invoice(['subscription' => $this->stripe_id]);

        return $this;
    }
594582
public function onPaymentDone(PaymentEvent $event)
    {
        $payment = $event->getPayment();
        if (!$payment instanceof OrderPayment) {
            return;
        }

        $order = $payment->getOrder();
        if ($order->getLocked()) {
            $order->setLocked(false);
            $this->updateOrder($order, $event);
        }

        $returnPath = null;
        $details = $payment->getDetails();
        if (array_key_exists('done_redirect_path', $details)) {
            $returnPath = $details['done_redirect_path'];
        } else {
            $type = $order->getType();
            if ($type === OrderTypes::TYPE_CART) {
                $returnPath = $this->urlGenerator->generate('ekyna_cart_payment');
            } elseif ($type === OrderTypes::TYPE_QUOTE) {
                throw new \BadMethodCallException('Not yet implemented');
            } elseif ($type === OrderTypes::TYPE_ORDER) {
                if ($this->authorization->isGranted('ROLE_ADMIN')) {
                    $returnPath = $this->urlGenerator->generate(
                        'ekyna_order_order_admin_show',
                        array('orderId' => $order->getId())
                    );
                } else {
                    $returnPath = $this->urlGenerator->generate(
                        'ekyna_cart_confirmation',
                        array(
                            'orderKey' => $order->getKey(),
                            'paymentId' => $payment->getId(),
                        )
                    );
                }
            }
        }

        if (null === $returnPath) {
            throw new LogicException('Unable to determine return path.');
        }

        $event->setResponse(new RedirectResponse($returnPath));
    }
26428
function approvePayment( $continueWorkflow=true )
    {
        if( $this->paymentObject )
        {
            $this->paymentObject->approve();
            $this->paymentObject->store();

            $this->logger->writeTimedString( 'payment was approved' );

            return ( $continueWorkflow ? $this->continueWorkflow() : null );
        }

        $this->logger->writeTimedString( "payment object is not set", 'approvePayment failed' );
        return null;
    }
384336
public function setShopCommission($shopCommission)
    {
        $shopCommission = (bool)$shopCommission;
        if ($this->shopCommission !== $shopCommission) {
            $this->shopCommission     = $shopCommission;
            $this->isShopSumChanged   = true;
            $this->isClientSumChanged = true;

            if ($shopCommission) {
                $this->setCustomParam($this->shopCommissionCustomParamKey, 1);
            } else {
                $this->removeCustomParam($this->shopCommissionCustomParamKey);
            }
        }

        return $this;
    }
1233715
public function setExpressCheckout($data, $subscription = false)
    {
        $this->setItemSubTotal($data);

        $this->post = $this->setCartItems($data['items'])->merge([
            'PAYMENTREQUEST_0_ITEMAMT'       => $this->subtotal,
            'PAYMENTREQUEST_0_AMT'           => $data['total'],
            'PAYMENTREQUEST_0_PAYMENTACTION' => $this->paymentAction,
            'PAYMENTREQUEST_0_CURRENCYCODE'  => $this->currency,
            'PAYMENTREQUEST_0_DESC'          => $data['invoice_description'],
            'PAYMENTREQUEST_0_INVNUM'        => $data['invoice_id'],
            'NOSHIPPING'                     => 1,
            'RETURNURL'                      => $data['return_url'],
            'CANCELURL'                      => $data['cancel_url'],
            'LOCALE'                         => $this->locale,
        ]);

        $this->setShippingAmount($data);

        $this->setShippingDiscount($data);

        $this->setExpressCheckoutRecurringPaymentConfig($data, $subscription);

        $response = $this->doPayPalRequest('SetExpressCheckout');

        return collect($response)->merge([
            'paypal_link' => !empty($response['TOKEN']) ? $this->config['gateway_url'].'/webscr?cmd=_express-checkout&token='.$response['TOKEN'] : null,
        ])->toArray();
    }
710861
public function setCard(?array $data): PaymentInstrumentInterface
    {
        $this->setLast4Digits($data['last_4_digits']);
        $this->setCardType($data['type']);

        return $this;
    }
44140
public function join($table, $one, $operator = null, $two = null, $type = 'inner', $where = false)
    {
        if ($one instanceof Closure) {
            $this->joins[] = new JoinClause($type, $table);

            call_user_func($one, end($this->joins));
        } else {
            $join = new JoinClause($type, $table);

            $this->joins[] = $join->on(
                $one, $operator, $two, 'and', $where
            );
        }

        return $this;
    }
845074
public function redirectToPaypal()
    {
        $parameters = Request::getRequestArrayFromString($request = null);
        foreach ($parameters as $name => $param) {
            if ($name == 'idSite'
                || $name == 'module'
                || $name == 'action'
            ) {
                unset($parameters[$name]);
            }
        }
        $paypalParameters = [
            "cmd" => "_s-xclick"
        ];
        if (empty($parameters["onetime"]) || $parameters["onetime"] != "true") {
            $paypalParameters["hosted_button_id"] = "DVKLY73RS7JTE";
            $paypalParameters["currency_code"] = "USD";
            $paypalParameters["on0"] = "Piwik Supporter";
            if (!empty($parameters["os0"])) {
                $paypalParameters["os0"] = $parameters["os0"];
            }
        } else {
            $paypalParameters["hosted_button_id"] = "RPL23NJURMTFA";
        }

        $url = "https://www.paypal.com/cgi-bin/webscr?" . Url::getQueryStringFromParameters($paypalParameters);

        Url::redirectToUrl($url);
        exit;
    }