HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/vhost/disk-apps/magento.bikenow.co/vendor/magento/module-paypal/Model/PayflowConfig.php
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Magento\Paypal\Model;

use Magento\Payment\Model\Method\AbstractMethod;

/**
 * Class PayflowConfig
 * @todo ELiminate current configuration class
 */
class PayflowConfig extends Config
{
    /**#@-*/

    /**#@+
     * Payment transaction types
     */
    const TRXTYPE_AUTH_ONLY = 'A';

    const TRXTYPE_SALE = 'S';

    /**#@-*/

    /**
     * Mapper from Magento payment actions to PayPal-specific transaction types
     *
     * @return string|null
     */
    public function getTrxType()
    {
        switch ($this->getValue('payment_action')) {
            case self::PAYMENT_ACTION_AUTH:
                return self::TRXTYPE_AUTH_ONLY;
            case self::PAYMENT_ACTION_SALE:
                return self::TRXTYPE_SALE;
            default:
                break;
        }

        return null;
    }

    /**
     * Getter for URL to perform Payflow requests, based on test mode by default
     *
     * @param bool|null $testMode Ability to specify test mode using
     * @return string
     */
    public function getTransactionUrl($testMode = null)
    {
        $testMode = $testMode === null ? $this->getValue('sandbox_flag') : (bool)$testMode;
        if ($testMode) {
            return $this->methodInstance->getConfigData('transaction_url_test_mode');
        }
        return $this->methodInstance->getConfigData('transaction_url');
    }

    /**
     * Payment action getter compatible with payment model
     *
     * @return string|null
     */
    public function getPaymentAction()
    {
        switch ($this->getValue('payment_action')) {
            case self::PAYMENT_ACTION_AUTH:
                return AbstractMethod::ACTION_AUTHORIZE;
            case self::PAYMENT_ACTION_SALE:
                return AbstractMethod::ACTION_AUTHORIZE_CAPTURE;
            default:
                break;
        }
        return null;
    }

    /**
     * Check whether method active in configuration and supported for merchant country or not
     *
     * @param string $method Method code
     * @return bool
     *
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function isMethodActive($method)
    {
        return parent::isMethodActive(Config::METHOD_PAYMENT_PRO)
            || parent::isMethodActive(Config::METHOD_PAYFLOWPRO);
    }

    /**
     * Map any supported payment method into a config path by specified field name
     *
     * @param string $fieldName
     * @return string|null
     */
    protected function _getSpecificConfigPath($fieldName)
    {
        if ($this->pathPattern) {
            return sprintf($this->pathPattern, $this->_methodCode, $fieldName);
        }

        return "payment/{$this->_methodCode}/{$fieldName}";
    }
}