Markette\Gopay\Service\PaymentService::buildPayment PHP Метод

buildPayment() защищенный Метод

Check and create payment
protected buildPayment ( Markette\Gopay\Entity\Payment $payment, string $channel ) : integer
$payment Markette\Gopay\Entity\Payment
$channel string
Результат integer
    protected function buildPayment(Payment $payment, $channel)
    {
        if ($payment instanceof ReturnedPayment) {
            throw new InvalidArgumentException("Cannot use instance of 'ReturnedPayment'! This payment has been already used for paying");
        }
        $channels = $this->getPaymentChannels($channel);
        try {
            $customer = $payment->getCustomer();
            $paymentSessionId = $this->gopay->soap->createPayment($this->gopay->config->getGopayId(), $payment->getProductName(), $payment->getSumInCents(), $payment->getCurrency(), $payment->getVariable(), $this->successUrl, $this->failureUrl, $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);
        }
    }