Установить тип платежа. Из констант
@param int $paymentType
throws SdkException
@return CreateDocumentRequest
10546
public function addPaymentType($paymentType){
        if(!in_array($paymentType, $this->getPaymentTypes())){
            throw new SdkException('Wrong payment type');
        }
        
        $this->paymentType = $paymentType;
        return $this;
    }
1288461
private function generatePublicHash(PaymentTokenInterface $paymentToken) {
        $hashKey = $paymentToken->getGatewayToken();

        if ($paymentToken->getCustomerId()) {
            $hashKey = $paymentToken->getCustomerId();
        }

        $hashKey .= $paymentToken->getPaymentMethodCode()
            . $paymentToken->getType()
            . $paymentToken->getTokenDetails();

        return $this->encryptor->getHash($hashKey);
    }
835553
public function edit(HpsPayPlanPaymentMethod $paymentMethod)
    {
        $result = null;
        if ($paymentMethod->paymentMethodType == HpsPayPlanPaymentMethodType::ACH) {
            $result = $this->editACH($paymentMethod);
        } else {
            $result = $this->editCreditCard($paymentMethod);
        }
        return $this->hydrateObject($result, 'HpsPayPlanPaymentMethod');
    }
397201
public function createApiLogByPaymentAndRequestTypeQuery($fkPayment, $requestName)
    {
        $query = $this->getFactory()->createPaymentPayoneApiLogQuery();
        $query->filterByFkPaymentPayone($fkPayment)
              ->filterByRequest($requestName);

        return $query;
    }
743202
public function setTransactionType($transactionType)
	{
		$validValues = [
			Request::TRANSACTION_TYPE_PURCHASE,
			Request::TRANSACTION_TYPE_REFUND,
			Request::TRANSACTION_TYPE_PRE_AUTH,
			Request::TRANSACTION_TYPE_COMPLETION,
			Request::TRANSACTION_TYPE_STATUS,
		];

		$this->validateInput(Request::ATTRIBUTE_TRANSACTION_TYPE, $transactionType, $validValues);

		$this->transactionType = $transactionType;

		return $this;
	}
246764
protected function createSignature($requestType)
    {
        if (empty($this->getPostData())) {
            throw new RuntimeException('Need setup post data');
        }

        $canonical = $this->getCanonicalRequest($requestType, $this->getPostData());
        $stringToSign = $this->getStringToSign($canonical);
        return $this->getSignature($stringToSign);
    }
255719
public function setPayment(Payment $payment)
    {
        $this->payment = $payment;

        if (!$payment->hasPaymentTransaction($this))
        {
            $payment->addPaymentTransaction($this);
        }

        return $this;
    }
1060028
public function setBillingType($billingType)
    {
        $allowed_values = $this->getBillingTypeAllowableValues();
        if (!in_array($billingType, $allowed_values)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'billingType', must be one of '%s'",
                    implode("', '", $allowed_values)
                )
            );
        }
        $this->container['billingType'] = $billingType;

        return $this;
    }
658008
public function _build($payment, $type)
        {
            $order    = $payment->getOrder();
            $billing  = $order->getBillingAddress();
            $shipping = $order->getShippingAddress();

            # Should be only used in the developement environment
            # without it we get duplicate order id.
            $token = $this->getConfigData('order_token');
            $token = (empty($token)) ? "" : "-" . $token;


            $transaction = array(
                'type'       => $type,
                'order_id'   => $order->getIncrementId() . $token,
                'crypt_type' => self::CRYPT_TYPE,
            );


            switch($type) {
                case self::TRANSACTION_PREAUTH :
                    $transaction = $transaction + array(
                        'cust_id'    => $billing->getCustomerId(),
                        'amount'     => sprintf("%01.2f", $payment->getAmount()),
                        'pan'        => $this->_cleanCC($payment->getCcNumber()),
                        'expdate'    => $this->_formatExpirationDate($payment->getCcExpYear(), $payment->getCcExpMonth()),
                        'cvd_value'  => $payment->getCcCid(),
                        'cvd_indicator' => 1
                    );

                    break;
                case self::TRANSACTION_COMPLETION :
                    $transaction = $transaction + array(
                        'comp_amount' => sprintf("%01.2f", $payment->getAmount()),
                        'txn_number'  => $payment->getCcTransId(),
                    );

                    break;
                case self::TRANSACTION_VOID :
                    $transaction = $transaction + array(
                        'comp_amount' => sprintf("%01.2f", $payment->getAmount()),
                        'txn_number'  => $payment->getCcTransId(),
                    );
                    break;

            }

            return new mpgTransaction($transaction);
        }
435806
public function mapPaymentToDebit(SpyPaymentPayone $paymentEntity): DebitContainer
    {
        $debitContainer = new DebitContainer();

        $debitContainer->setTxid($paymentEntity->getTransactionId());
        $debitContainer->setSequenceNumber($this->getNextSequenceNumber($paymentEntity->getTransactionId()));
        $debitContainer->setCurrency($this->getStandardParameter()->getCurrency());
        $debitContainer->setAmount($paymentEntity->getSpyPaymentPayoneDetail()->getAmount());

        return $debitContainer;
    }
934117
public function setDocumentType(\Core\Entity\DocumentType $documentType = null) {
        $this->documentType = $documentType;

        return $this;
    }
1254857
public function createOffsitePurchase(array $paymentDetails)
    {

        $paymentDetails['TxType'] = static::OPERATION_PAYMENT;

        $query = http_build_query($paymentDetails);

        $request = new Request(
            'post',
            $this->getOffsiteResource(),
            $this->getGatewayHost()
        );

        $request->setContent($query);

        return $this->doRequest($request);
    }
14230
protected function createPaymentMethodContainerFromPayment(SpyPaymentPayone $paymentEntity)
    {
        $paymentDetailEntity = $paymentEntity->getSpyPaymentPayoneDetail();

        $paymentMethodContainer = new OnlineBankTransferContainer();

        $paymentMethodContainer->setOnlineBankTransferType($paymentDetailEntity->getType());
        $paymentMethodContainer->setRedirect($this->createRedirectContainer($paymentEntity->getSpySalesOrder()->getOrderReference()));
        $paymentMethodContainer->setBankCountry($paymentDetailEntity->getBankCountry());
        $paymentMethodContainer->setBankAccount($paymentDetailEntity->getBankAccount());
        $paymentMethodContainer->setBankCode($paymentDetailEntity->getBankCode());
        $paymentMethodContainer->setBankGroupType($paymentDetailEntity->getBankGroupType());
        $paymentMethodContainer->setIban($paymentDetailEntity->getIban());
        $paymentMethodContainer->setBic($paymentDetailEntity->getBic());

        return $paymentMethodContainer;
    }
301428
public static function newDocumentLink($path = '/', $documentType = '')
    {
        if (self::isLoggedIn()) {
            $path = 0 === strpos($path, '/') ? $path : '/' . $path;
            $linkPostFix = '';
            if ($documentType !== '') {
                $linkPostFix = '&amp;documentType=' . $documentType;
            }
            return Request::$subfolders . 'cms/documents/new-document?path=' . urlencode($path) . $linkPostFix;
        } else {
            return '';
        }
    }
1038377
public function withPaymentMethod($paymentMethod)
    {
        $this->paymentMethod = $paymentMethod;
        if ($paymentMethod instanceof EBTCardData && $paymentMethod->serialNumber !== null) {
            $this->transactionModifier = TransactionModifier::VOUCHER;
        }
        return $this;
    }
519326
public function createCard(BasePaymentForm $paymentForm, Order $order = null): CreditCard {

        $card = new CreditCard;

        if ($paymentForm instanceof CreditCardPaymentForm) {
            $this->populateCard($card, $paymentForm);
        }

        if ($order) {
            if ($billingAddress = $order->getBillingAddress()) {
                // Set top level names to the billing names
                $card->setFirstName($billingAddress->firstName);
                $card->setLastName($billingAddress->lastName);

                $card->setBillingFirstName($billingAddress->firstName);
                $card->setBillingLastName($billingAddress->lastName);
                $card->setBillingAddress1($billingAddress->address1);
                $card->setBillingAddress2($billingAddress->address2);
                $card->setBillingCity($billingAddress->city);
                $card->setBillingPostcode($billingAddress->zipCode);
                if ($billingAddress->getCountry()) {
                    $card->setBillingCountry($billingAddress->getCountry()->iso);
                }
                if ($billingAddress->getState()) {
                    $state = $billingAddress->getState()->abbreviation ?: $billingAddress->getState()->name;
                    $card->setBillingState($state);
                }
                $card->setBillingPhone($billingAddress->phone);
                $card->setBillingCompany($billingAddress->businessName);
                $card->setCompany($billingAddress->businessName);
            }

            if ($shippingAddress = $order->getShippingAddress()) {
                $card->setShippingFirstName($shippingAddress->firstName);
                $card->setShippingLastName($shippingAddress->lastName);
                $card->setShippingAddress1($shippingAddress->address1);
                $card->setShippingAddress2($shippingAddress->address2);
                $card->setShippingCity($shippingAddress->city);
                $card->setShippingPostcode($shippingAddress->zipCode);

                if ($shippingAddress->getCountry()) {
                    $card->setShippingCountry($shippingAddress->getCountry()->iso);
                }

                if ($shippingAddress->getState()) {
                    $state = $shippingAddress->getState()->abbreviation ?: $shippingAddress->getState()->name;
                    $card->setShippingState($state);
                }

                $card->setShippingPhone($shippingAddress->phone);
                $card->setShippingCompany($shippingAddress->businessName);
            }

            $card->setEmail($order->getEmail());
        }

        return $card;
    }
1273977
private function addCreditCard(HpsPayPlanPaymentMethod $paymentMethod)
    {
        $data = $paymentMethod->getEditableFieldsWithValues();
        $data['customerKey'] = $paymentMethod->customerKey;
        if (isset($paymentMethod->accountNumber)) {
            $data['accountNumber'] = $paymentMethod->accountNumber;
        } else if (isset($paymentMethod->paymentToken)) {
            $data['paymentToken'] = $paymentMethod->paymentToken;
        }
        $result = $this->doRequest($data, array(
            'verb'     => 'POST',
            'endpoint' => 'paymentMethodsCreditCard',
        ));
        return $this->hydrateObject($result, 'HpsPayPlanPaymentMethod');
    }