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

buildRecurrentPayment() protected method

Check and create recurrent payment
protected buildRecurrentPayment ( RecurrentPayment $payment, string $channel ) : integer
$payment Markette\Gopay\Entity\RecurrentPayment
$channel string
return integer
    protected function buildRecurrentPayment(RecurrentPayment $payment, $channel)
    {
        $channels = $this->getPaymentChannels($channel);
        try {
            $customer = $payment->getCustomer();
            $paymentSessionId = $this->gopay->soap->createRecurrentPayment($this->gopay->config->getGopayId(), $payment->getProductName(), $payment->getSumInCents(), $payment->getCurrency(), $payment->getVariable(), $this->successUrl, $this->failureUrl, $payment->getRecurrenceDateTo(), $payment->getRecurrenceCycle(), $payment->getRecurrencePeriod(), $channels, $channel, $this->gopay->config->getGopaySecretKey(), $customer->firstName, $customer->lastName, $customer->city, $customer->street, $customer->postalCode, $customer->countryCode, $customer->email, $customer->phoneNumber, NULL, NULL, NULL, NULL, $this->lang);
            return $paymentSessionId;
        } catch (Exception $e) {
            throw new GopayException($e->getMessage(), 0, $e);
        }
    }