@param $paymentMethod

@return mixed
195585
public function get($paymentMethod)
    {
        $id = null;
        if ($paymentMethod instanceof HpsPayPlanPaymentMethod) {
            $id = $paymentMethod->paymentMethodKey;
        } else {
            $id = $paymentMethod;
        }
        $result = $this->doRequest(null, array(
            'verb'     => 'GET',
            'endpoint' => 'paymentMethods/'.$id
        ));
        return $this->hydrateObject($result, 'HpsPayPlanPaymentMethod');
    }
991141
public function getTermsOfPayment()
    {
        if ($terms = $this->entity->getTermsOfPayment()) {
            return array(
                'id' => $terms->getId(),
                'terms' => $terms->getTerms()
            );
        }

        return null;
    }
1107081
static public function isPaymentMethod($paymentMethod) {
    return ((string) $paymentMethod == Connect2PayClient::PAYMENT_METHOD_CREDITCARD ||
        (string) $paymentMethod == Connect2PayClient::PAYMENT_METHOD_TODITOCASH ||
        (string) $paymentMethod == Connect2PayClient::PAYMENT_METHOD_BANKTRANSFER ||
        (string) $paymentMethod == Connect2PayClient::PAYMENT_METHOD_DIRECTDEBIT ||
        (string) $paymentMethod == Connect2PayClient::PAYMENT_METHOD_WECHAT ||
        (string) $paymentMethod == Connect2PayClient::PAYMENT_METHOD_LINE ||
        (string) $paymentMethod == Connect2PayClient::PAYMENT_METHOD_ALIPAY);
  }
1334934
public function getPaymentMethods()
    {
        $obj = new stdClass();

        // Must be in specific order for checksum --
        $obj->Timestamp = $this->getTimeStamp();
        $obj->SessionID = $this->getSessionID();
        $obj->PinCode = $this->getPinCode();
        $obj->UserAgent = $this->getUserAgent();
        // -----------------------------------------
        // Generate Checksum
        $obj->Checksum = $this->generateChecksum($obj);

        // Ask for GetPaymentMethods and get response
        $result = $this->client->GetPaymentMethods($obj);
        $result = $result->GetPaymentMethodsResult;
        $methods = isset($result->PaymentMethods->PaymentMethod) ? $result->PaymentMethods->PaymentMethod : null;

        $obj->Timestamp = $result->Timestamp;

        if (!is_null($methods)) {
            // Assign all properties of the PaymentMethods object as property of mainObject
            $obj = $this->parseForChecksum($obj, $methods);
        }

        // Unset properties for new Checksum
        unset($obj->Checksum);

        // Verify response data by making a new Checksum
        $CheckSum = $this->generateChecksum($obj);

        // Compare Checksums
        if ($result->Checksum != $CheckSum)
            throw new Exception('Data could not be verified');

        return (array) $methods;
    }
543576
public function getPaymentLink()
    {
        if (($sValue = $this->getViewConfigParam('paymentlink')) === null) {
            $sValue = $this->getConfig()->getShopSecureHomeUrl() . 'cl=payment';
            $this->setViewConfigParam('paymentlink', $sValue);
        }

        return $sValue;
    }
95210
public function get($paymentId)
    {

        $this->debugData[] = __METHOD__;

        $method = 'GET';
        $uri = $this->config['apiQueryUri'] . \sprintf('/sales/%s', $paymentId);
        $options = [
            'headers' => $this->headers
        ];

        $this->debugData[][__LINE__]['method'] = $method;
        $this->debugData[][__LINE__]['uri'] = $uri;
        $this->debugData[][__LINE__]['options'] = $uri;

        try {

            $response = $this->http()->request($method, $uri, $options);

            $this->debugData[][__LINE__]['response'] = $response;

            $result = \json_decode($response->getBody()->getContents(), true);            

            if ($response->getStatusCode() === HttpStatus::Ok) {
                return $result;
            } elseif ($response->getStatusCode() == HttpStatus::BadRequest) {
                return 'status_codex';
            }

        } catch (\Exception $e) {

            $result = array(
                'code'=>$e->getCode(),
                'message'=>$e->getMessage()
                );

            $this->debugData[][__LINE__]['exception'] = $e->getMessage();

        }

        return $result;
    }
648906
public function makePaymentUsingExistingPaymentMethod($accountID, $paymentMethodID, $amount)
    {
        return $this->httpHelper->post("/accounts/" . intval($accountID) . "/transactions/payments", [
            'payment_method_id' => intval($paymentMethodID),
            'amount' => trim($amount),
            'auto_apply' => true,
        ]);
    }
34776
public function create($payment, $paymentId = null)
    {
        if (isset($paymentId)) {
            return $this->client()->put($payment, 'payments/{paymentId}', ['paymentId' => $paymentId]);
        }

        return $this->client()->post($payment, 'payments');
    }
1302724
public function getMethodTitle($shippingMethod)
    {
        $this->fetchAvailableShippingMethods();
        return isset($this->methods[$shippingMethod]['display_text']) ?
            $this->methods[$shippingMethod]['display_text'] : null;
    }
735961
public function processPayment(StripeMethod $paymentMethod, $amount)
    {
        /**
         * check and set payment data.
         */
        $chargeParams = $this->prepareData(
            $paymentMethod,
            $amount
        );

        /**
         * make payment.
         */
        $transaction = $this
            ->transactionFactory
            ->create($chargeParams);

        /**
         * Payment paid done.
         *
         * Paid process has ended ( No matters result )
         */
        $this
            ->paymentEventDispatcher
            ->notifyPaymentOrderDone(
                $this->paymentBridge,
                $paymentMethod
            );

        /**
         * when a transaction is successful, it is marked as 'closed'.
         */
        if ($transaction['paid'] != 1) {

            /**
             * Payment paid failed.
             *
             * Paid process has ended failed
             */
            $this
                ->paymentEventDispatcher
                ->notifyPaymentOrderFail(
                    $this->paymentBridge,
                    $paymentMethod
                );

            throw new PaymentException();
        }

        $paymentMethod
            ->setTransactionId($transaction['id'])
            ->setTransactionStatus('paid')
            ->setTransactionResponse($transaction);

        /**
         * Payment paid successfully.
         *
         * Paid process has ended successfully
         */
        $this
            ->paymentEventDispatcher
            ->notifyPaymentOrderSuccess(
                $this->paymentBridge,
                $paymentMethod
            );

        return $this;
    }
603055
protected function getHttpMethod($method)
    {
        if (!$this->methodAvailable($method)) {
            throw new \Payrexx\PayrexxException('Method ' . $method . ' not implemented');
        }
        return self::$methods[$method];
    }
1221616
public function getPaymentMethodInstance()
    {
        if (is_null($this->_paymentMethodInstance)) {
            $methodCode = $this->getMethodCode();
            if ($this->getMethodCode() == 'adyen_oneclick') {
                $referenceId = $this->getReferenceId();
                $methodInstanceName = $methodCode . "_" . $referenceId;
            } else {
                $methodInstanceName = $methodCode;
            }

            $this->_paymentMethodInstance = Mage::helper('payment')->getMethodInstance($methodInstanceName);

            if (!$this->_paymentMethodInstance) {
                $this->_paymentMethodInstance = Mage::helper('payment')->getMethodInstance($this->getMethodCode());
            }
        }

        if ($this->_paymentMethodInstance) {
            $this->_paymentMethodInstance->setStore($this->getStoreId());
        }

        return $this->_paymentMethodInstance;
    }
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');
    }
940001
public function getPaymentMethodName()
    {
        $aVerifyData = (array) oxRegistry::getSession()->getVariable('pm_verify');
        $sMethodName = array_key_exists('pm_paymentMethod_name', $aVerifyData)
            ? (string) $aVerifyData['pm_paymentMethod_name']
            : '';

        return $sMethodName;
    }
708949
public function getCheapestShippingMethod(array $shippingMethods)
    {
        return array_reduce(
            $shippingMethods,
            function ($lowestPriceShippingMethod, ShippingMethod $shippingMethod) {

                $shippingMethodPrice = $shippingMethod->getPrice();
                if (
                    !($lowestPriceShippingMethod instanceof ShippingMethod) ||
                    $shippingMethodPrice
                        ->isLessThan(
                            $this
                                ->currencyConverter
                                ->convertMoney(
                                    $lowestPriceShippingMethod->getPrice(),
                                    $shippingMethodPrice->getCurrency()
                                )
                        )
                ) {
                    return $shippingMethod;
                }

                return $lowestPriceShippingMethod;
            },
            null
        );
    }
253292
public function getById(PaymentId $paymentId) : Payment
    {
        if (!array_key_exists((string)$paymentId, $this->payments)) {
            throw PaymentNotFoundException::byId($paymentId);
        }

        return $this->payments[(string)$paymentId];
    }
1311885
public function getPaymentRefunds($paymentID)
    {
        $obj = new stdClass();

        // Must be in specific order for checksum --
        $obj->Secret = $this->getSecretCode();
        $obj->MerchantID = $this->getMerchantID();
        $obj->Timestamp = $this->getTimeStamp();
        $obj->PaymentID = $paymentID;
        // -----------------------------------------  
        // Generate Checksum
        $obj->Checksum = $this->generateChecksum($obj);

        // Ask for getPaymentRefunds and get response
        $result = $this->client->getPaymentRefunds($obj);

        $result = $result->GetPaymentRefundsResult;
        $refunds = isset($result->Refunds->Refund) ? $result->Refunds->Refund : null;

        $obj->Timestamp = $result->Timestamp;

        if (!is_null($refunds)) {
            // Assign all properties of the DayStatistics object as property of mainObject
            $obj = $this->parseForChecksum($obj, $refunds, true, array("RefundID", "DateCreated", "RefundAmount", "RefundCurrency", "Status"));
        }

        // Unset properties for new Checksum
        unset($obj->Checksum);

        // Verify response data by making a new Checksum
        $Checksum = $this->generateChecksum($obj);

        // Compare Checksums
        if ($result->Checksum != $Checksum)
            throw new Exception('Data could not be verified');

        return (!is_null($refunds)) ? $this->forceArray($refunds) : array();
    }