Markette\Gopay\Service\RecurrentPaymentService::payRecurrent PHP Method

payRecurrent() public method

Executes payment via redirecting to GoPay payment gate
public payRecurrent ( RecurrentPayment $payment, string $channel, callable $callback ) : Nette\Application\Responses\RedirectResponse
$payment Markette\Gopay\Entity\RecurrentPayment
$channel string
$callback callable
return Nette\Application\Responses\RedirectResponse
    public function payRecurrent(RecurrentPayment $payment, $channel, $callback)
    {
        $paymentSessionId = $this->buildRecurrentPayment($payment, $channel);
        $url = GopayConfig::fullIntegrationURL() . "?sessionInfo.targetGoId=" . $this->gopay->config->getGopayId() . "&sessionInfo.paymentSessionId=" . $paymentSessionId . "&sessionInfo.encryptedSignature=" . $this->createSignature($paymentSessionId);
        call_user_func_array($callback, [$paymentSessionId]);
        return new RedirectResponse($url);
    }