Renders the payment actions buttons.

@param PaymentInterface $payment
@param string $route
@param array  $routeParameters
@return string
505742
public function renderPaymentActions(PaymentInterface $payment, $route, array $routeParameters)
    {
        if ($payment->getMethod()->getFactoryName() !== 'offline') {
            return '';
        }

        $sm = $this->factory->get($payment);

        $buttons = [];
        $model = '<a href="%s" class="btn btn-%s btn-xs" onclick="confirm(\'Souhaitez-vous réellement %s le payment ?\');">%s</a>';

        foreach (Transitions::getManualTransitions() as $transition) {
            if ($sm->can($transition)) {
                $label = $this->translator->trans(PaymentTransitions::getLabel($transition));
                $path = $this->urlGenerator->generate($route, array_merge(
                    $routeParameters, ['transition' => $transition]
                ));
                $theme = PaymentTransitions::getTheme($transition);
                $buttons[] = sprintf($model, $path, $theme, strtolower($label), $label);
            }
        }

        return implode('', $buttons);
    }
1313475
private function getRoutesFromIndexActions (&$routes, array &$routeActions, &$requestMethod, array &$requestPathParts) {
        foreach ($routeActions as $routeData) {
            $routePath = $routeData[0];
            $routeAction = $routeData[1];
            $routeParameters = [];
            if (strpos($routePath, self::ROUTE_PARAMETER_PREFIX) !== false || strpos($routePath, self::ROUTE_GENERIC_PATH) !== false) {
                $routePathParts = explode(self::ROUTE_PATH_SEPARATOR, trim($routePath, self::ROUTE_PATH_SEPARATOR));;
                for ($i = 0; $i < sizeof($routePathParts); $i++) {
                    $routePathPart = $routePathParts[$i];
                    if ($routePathPart == self::ROUTE_GENERIC_PATH) {
                        $path = array_slice($requestPathParts, $i);
                        $routeParameters[self::ROUTE_PATH_PARAMETER_NAME] = $path;
                        break;
                    }
                    else if ($routePathPart[0] == self::ROUTE_PARAMETER_PREFIX) {
                        $parameterName = substr($routePathPart, 1);
                        $parameterValue = $requestPathParts[$i];
                        $routeParameters[$parameterName] = $parameterValue;
                    }
                }
            }
            if ($routeAction instanceof RouteGenerator) {
                $route = $routeAction->generateRoute($requestMethod, isset($path)?$path : $requestPathParts);
                if ($route) {
                    $routes[] = $route;
                }
            }
            else {
                $routes[] = new Route($routeAction, $routeParameters);
            }
        }
    }
997228
private function createPaymentForm(OrderPaymentInterface $payment, $action, $cancelPath)
    {
        $form = $this->createForm('ekyna_order_order_payment', $payment, [
            'action' => $action,
            'method' => 'POST',
            'attr' => [
                'class' => 'form-horizontal form-with-tabs',
            ],
            'admin_mode' => true,
        ]);
        $form->add('actions', 'form_actions', [
            'buttons' => [
                'save' => [
                    'type' => 'submit', 'options' => [
                        'button_class' => 'primary',
                        'label' => 'ekyna_core.button.save',
                        'attr' => [
                            'icon' => 'ok',
                        ],
                    ],
                ],
                'cancel' => [
                    'type' => 'button', 'options' => [
                        'label' => 'ekyna_core.button.cancel',
                        'button_class' => 'default',
                        'as_link' => true,
                        'attr' => [
                            'class' => 'form-cancel-btn',
                            'icon' => 'remove',
                            'href' => $cancelPath,
                        ],
                    ],
                ],
            ],
        ]);

        return $form;
    }
1196168
protected function _mapAction($action) {
		$actionMap = $this->getConfig('actionMap');
		if (isset($actionMap[$action]) && method_exists($this, $actionMap[$action]['method'])) {
			$pass = (array)$this->_getRequest()->param('pass');
			call_user_func_array([$this, $actionMap[$action]['method']], $pass);

			if ($this->_redirectResponse instanceof Response) {
				return $this->_redirectResponse;
			}

			if (is_string($actionMap[$action]['view'])) {
				try {
					return $this->getController()->render($this->getController()->request->param('action'));
				} catch (MissingTemplateException $e) {
					return $this->getController()->render($actionMap[$action]['view']);
				}
			}

				return $this->_getResponse();
			}

		return false;
	}
946597
public function showPaymentInstructions(Payment $payment): string
	{
		if (empty($_REQUEST['tp_radio_value']) || empty($_REQUEST['tp_radio_is_offline'])) {
			return '';
		}

		$this->clearCookies();

		$href = "{$this->config->gateUrl}radiobuttons/style/radiobuttons.css?v=" . time();
		$href = Escaper::htmlEntityEncode($href);
		$out = "<link href=\"{$href}\" type=\"text/css\" rel=\"stylesheet\" />\n";

		$out .= "<script type=\"text/javascript\">\n";

		$payment->setMethodId(intval($_REQUEST['tp_radio_value']));
		$queryArgs = $payment->getArgs();
		$queryArgs['signature'] = $payment->getSignature();
		$thepayGateUrl = "{$this->config->gateUrl}?" . http_build_query($queryArgs);
		$thepayGateUrl = Escaper::jsonEncode($thepayGateUrl);
		$out .= "\tvar thepayGateUrl = {$thepayGateUrl},\n";

		$thepayDisablePopupCss = Escaper::jsonEncode($this->disablePopupCss);
		$out .= "\tthepayDisablePopupCss = {$thepayDisablePopupCss};\n";

		$out .= "</script>\n";

		$src = "{$this->config->gateUrl}radiobuttons/js/jquery.js?v=" . time();
		$src = Escaper::htmlEntityEncode($src);
		$out .= "<script type=\"text/javascript\" src=\"{$src}\" async=\"async\"></script>";

		$src = "{$this->config->gateUrl}radiobuttons/js/radiobuttons.js?v=" . time();
		$src = Escaper::htmlEntityEncode($src);
		$out .= "<script type=\"text/javascript\" src=\"{$src}\" async=\"async\"></script>";

		$out .= '<div id="thepay-method-result"></div>';

		return $out;
	}
657509
public function render($view, array $parameters = [], Response $response = null)
    {
        return $this->templating->renderResponse($view, $parameters, $response);
    }
128129
public function renderByPathAction($path = '')
    {
        /**
         * @var PageInterface $page
         */
        $page = $this
            ->pageRepository
            ->findOneByPath($path);

        return $this
            ->pageResponseTransformer
            ->createResponseFromPage(
                $page,
                $path
            );
    }
522086
protected function addPaymentMethod(array $params, $payment, array $options)
    {
        if (is_string($payment)) {
            // offline & SPEI
            if (in_array($payment, ['store', 'bank_account'])) {
                return array_merge($params, [
                    'method' => $payment,
                ]);
            }

            // cards
            $paymentData = [
                'method'            => 'card',
                'source_id'         => $payment,
                'device_session_id' => Arr::get($options, 'device_id'),
            ];

            if ($installments = Arr::get($options, 'monthly_installments')) {
                if (is_numeric($installments) && in_array($installments, [3, 6, 9, 12])) {
                    $paymentData['payment_plan'] = ['payments' => (int) $installments];
                }
            }

            return array_merge($params, $paymentData);
        }

        return $params;
    }
130669
public function processCallback(OrderInterface $order, $action)
    {
        $params = [
            'bank' => $this->getCode(),
            'reference' => $order->getReference(),
            'check' => $this->generateUrlCheck($order),
            'action' => $action,
        ];

        $url = $this->router->generate($this->getOption('url_callback'), $params, UrlGeneratorInterface::ABSOLUTE_URL);

        $response = $this->browser->get($url);

        $routeName = 'ok' === $response->getContent() ? 'url_return_ok' : 'url_return_ko';

        $response = new RedirectResponse($this->router->generate($this->getOption($routeName), $params, true), 302, [
            'Content-Type' => 'text/plain',
        ]);
        $response->setPrivate();

        return $response;
    }
361756
public function map($method, $route, $action)
    {
        return $this->getRouter()->map($method, $route, $this->bindClosureToInstance($action, $this));
    }
750166
public function render($route, $id = null, $options = array(), $view = null)
    {
        return $this->pagebar->render($route, $id, $options, $view);
    }
175424
public function create(
       string $action,
       string $prefix,
       string $controller,
       array $param,
       string $path): RouteInterface
   {
       try {
           return $this->factory->create(
               $action,
               $prefix,
               $controller,
               $param,
               $path);
       } catch (InvalidArgumentException $e) {
           throw $e;
       }
   }
323747
public function paymentAction()
    {
        $order = $this->checkRequest();

        return $this->render('SonataPaymentBundle:Payment:debug.html.twig', [
            'order' => $order,
            'check' => $this->getCurrentRequest()->get('check'),
        ]);
    }
914762
public function payment(Payment $payment, &$paymentParams)
    {
        if (!$this->checkCurrency($payment->currency)) {
            Yii::$app->session->setFlash(Yii::t('payment', 'The gateway does not support the current currency!'));
        } else {
            $params = [
                'MerNo' => $this->merNo,
                'BillNo' => $payment->id,
                'Amount' => round($payment->money, 2),
                'ReturnURL' => $this->getReturnUrl(),
                'AdviceURL' => $this->getNoticeUrl(),
                'products' => !empty($payment->model_id) ? $payment->model_id : '充值',
                'Remark' => 'Remark',
                'defaultBankNumber' => $this->defaultBankNumber,
                'orderTime' => date('YmdHis')
            ];
            $md5src = $this->merNo . '&' . $payment->id . '&' . $params['Amount'] . '&' . $params['ReturnURL'] . '&' . $this->md5Key;        //校验源字符串
            $params['SignInfo'] = strtoupper(md5($md5src));//MD5检验结果
            $this->getRedirectResponse($params);
        }
    }
993170
public function createPaymentUrl(PaymentRequestInterface $payment)
    {
        $params = $payment->toArray();
        $params = array_merge($params, array(
            'alias' => $this->alias,
            'mac'   => $this->calculateMac($payment)
        ));

        return sprintf('%s?%s', $this->endpoint, http_build_query($params));
    }
578137
public function callAction(string $action, ?DataMap $params = null): void
    {
        list ($moduleName, $controllerName, $actionName) = $this->getFullAction($action);
        $this->routeInfo->moduleName = $moduleName;
        $this->routeInfo->controllerName = $controllerName;
        $this->routeInfo->actionName = $actionName;
        if ($params != null) {
            $this->routeInfo->params = $params;
        }
        $this->invokeRoute();
    }
268226
public static function listAllPaymentCardsAsync(array $parameters = [])
    {
        return self::listAllPaymentCardsAsyncWithHttpInfo($page, $size, $sort)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }