@param string $paymentMethodName

@throws \SprykerEco\Zed\Payone\Business\Exception\InvalidPaymentMethodException

@return \SprykerEco\Zed\Payone\Business\Payment\PaymentMethodMapperInterface
5095
protected function getRegisteredPaymentMethodMapper($paymentMethodName)
    {
        $paymentMethodMapper = $this->findPaymentMethodMapperByName($paymentMethodName);
        if ($paymentMethodMapper === null) {
            throw new InvalidPaymentMethodException(
                sprintf('No registered payment method mapper found for given method name %s', $paymentMethodName)
            );
        }

        return $paymentMethodMapper;
    }
1311102
public function debitPayment($idPayment)
    {
        $paymentEntity = $this->getPaymentEntity($idPayment);
        $paymentMethodMapper = $this->getPaymentMethodMapper($paymentEntity);

        $requestContainer = $paymentMethodMapper->mapPaymentToDebit($paymentEntity);
        $this->setStandardParameter($requestContainer);

        $paymentEntity = $this->findPaymentByTransactionId($paymentEntity->getTransactionId());
        $apiLogEntity = $this->initializeApiLog($paymentEntity, $requestContainer);

        $rawResponse = $this->executionAdapter->sendRequest($requestContainer);
        $responseContainer = new DebitResponseContainer($rawResponse);

        $this->updateApiLogAfterDebit($apiLogEntity, $responseContainer);

        $responseMapper = new DebitResponseMapper();
        $responseTransfer = $responseMapper->getDebitResponseTransfer($responseContainer);

        return $responseTransfer;
    }
1193380
public function getPaymentMethods()
    {
        $paymentMethods = array();

        foreach ($this->data['data'] as $method) {
            $paymentMethods[] = new PaymentMethod(
                $method['id'],
                $method['description']
            );
        }

        return $paymentMethods;
    }
343473
public function pay(OrderPaymentEvent $event)
    {
        $order = $event->getOrder();

        /* call pay method */
        if (null === $paymentModule = ModuleQuery::create()->findPk($order->getPaymentModuleId())) {
            throw new \RuntimeException(
                Translator::getInstance()->trans(
                    "Failed to find a payment Module with ID=%mid for order ID=%oid",
                    [
                        "%mid" => $order->getPaymentModuleId(),
                        "%oid" => $order->getId()
                    ]
                )
            );
        }

        $paymentModuleInstance = $paymentModule->getPaymentModuleInstance($this->container);

        $response = $paymentModuleInstance->pay($order);

        if (null !== $response && $response instanceof Response) {
            $event->setResponse($response);
        }
    }
1110761
public function setPaymentMethod(ComSubscriptionsDomainPaymentMethodInterface $method)
    {
        $this->_payment_method = $method;
        $this->method = (string) $method;

        return $this;
    }
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');
    }
1285626
public function getPaymentMethod()
    {
        try {
            return $this->getOrder()->source->getPayment()->getMethod();
        }
        catch (\Exception $e) {}
        return parent::getPaymentMethod();
    }
459126
public function find($idealPaymentId)
    {
        try {
            $path = $this->_config->merchantPath() . '/ideal_payments/' . $idealPaymentId;
            $response = $this->_http->get($path);
            return IdealPayment::factory($response['idealPayment']);
        } catch (Exception\NotFound $e) {
            throw new Exception\NotFound(
                'iDEAL Payment with id ' . $idealPaymentId . ' not found'
            );
        }
    }
129973
private function transformPaymentInstrumentValue(array $data, $method)
    {
        if ($method == 'card') {
            $instrument = new PaymentInstrumentCard();
        } elseif ($method == 'recurring') {
            $instrument = new PaymentInstrumentRecurring();
        } else {
            throw new Exception\Runtime(sprintf('Method "%s" is not supported', $method));
        }

        $this->map($data, $instrument);

        return $instrument;
    }
1353201
public function setPayment($iPaymentId)
    {
        //  Validate
        $oPayment = $this->oPaymentModel->getById(
            $iPaymentId,
            ['expand' => ['invoice']]
        );

        if (empty($oPayment)) {
            throw new RequestException('Invalid payment ID.');
        }

        $this->oPayment = $oPayment;
        return $this;
    }
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');
    }
258133
public function setPaymentMethod($value)
    {
        if (!$this->_isNumericArray($value)) {
            $value = array ($value);
        }
        $this->_fields['PaymentMethod']['FieldValue'] = $value;
        return $this;
    }
465764
protected function setPaymorrowPaymentMethodId()
    {
        /** @var oxPayment|OxpsPaymorrowOxPayment $payment */
        $payment = oxNew('oxPayment');
        $paymentIdField = self::OXPS_PAYMENT_ID_FIELD;
        $paymentName = (string) $this->getConfig()->getRequestParameter(self::OXPS_PM_PAYMENT_NAME_FIELD);

        if ($payment->loadByPaymorrowName($paymentName) and
            !$this->getConfig()->getRequestParameter($paymentIdField)
        ) {
            $this->appendPostData(array($paymentIdField => (string) $payment->getId()));
        }
    }
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;
    }
158468
protected function createPaymentMethodContainerFromPayment(SpyPaymentPayone $paymentEntity)
    {
        $paymentMethodContainer = new DirectDebitContainer();

        $paymentMethodContainer->setBankCountry($paymentEntity->getSpyPaymentPayoneDetail()->getBankCountry());
        $paymentMethodContainer->setBankAccount($paymentEntity->getSpyPaymentPayoneDetail()->getBankAccount());
        $paymentMethodContainer->setBankCode($paymentEntity->getSpyPaymentPayoneDetail()->getBankCode());
        $paymentMethodContainer->setIban($paymentEntity->getSpyPaymentPayoneDetail()->getIban());
        $paymentMethodContainer->setBic($paymentEntity->getSpyPaymentPayoneDetail()->getBic());

        return $paymentMethodContainer;
    }
909285
public function updateFromEmbeddedApiResponse(array $data, string $currency, PaymentMethodInterface $paymentMethod = null): PaymentMethodInterface
    {
        if (!$paymentMethod) {
            $paymentMethod = $this->getPaymentMethod($data['id']);
        }

        if (!$paymentMethod->getId()) {
            // only update when we create a new entity because this is the embedded method
            $paymentMethod
                ->setFee(DandomainFoundation\createMoney((string) $currency, $data['fee']))
                ->setFeeInclVat($data['feeInclVat'])
                ->setName($data['name']);
        }

        return $paymentMethod;
    }
864487
public function addMethod(PaymentInterface $instance)
    {
        if (null === $instance->getCode()) {
            throw new \RuntimeException(sprintf('Payment handler of class %s must return a code on getCode method. Please refer to the documentation (https://sonata-project.org/bundles/ecommerce/master/doc/reference/bundles/payment/index.html)', \get_class($instance)));
        }

        $this->methods[$instance->getCode()] = $instance;
    }