Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/cartforge.co/vendor/paypal/module-braintree-core/Gateway/Request/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/cartforge.co/vendor/paypal/module-braintree-core/Gateway/Request/CvvDataBuilder.php
<?php

namespace PayPal\Braintree\Gateway\Request;

use Exception;
use Magento\Framework\App\RequestInterface;
use Magento\Payment\Gateway\Request\BuilderInterface;
use PayPal\Braintree\Gateway\Config\Config;
use Psr\Log\LoggerInterface;

class CvvDataBuilder implements BuilderInterface
{
    /**
     * @var RequestInterface $request
     */
    private $request;

    /**
     * @var Config $config
     */
    private $config;

    /**
     * @var LoggerInterface $logger
     */
    private $logger;

    /**
     * CvvDataBuilder constructor.
     * @param RequestInterface $request
     * @param Config $config
     * @param LoggerInterface $logger
     */
    public function __construct(
        RequestInterface $request,
        Config $config,
        LoggerInterface $logger
    ) {
        $this->request = $request;
        $this->config = $config;
        $this->logger = $logger;
    }

    /**
     * @inheritdoc
     */
    public function build(array $buildSubject): array
    {
        if (!$this->request->isSecure() || !$this->config->isCvvEnabledVault()) {
            return [];
        }

        try {
            $input = file_get_contents('php://input'); // @codingStandardsIgnoreLine
            if ($input) {
                $input = json_decode($input, true);
                if (!empty($input['paymentMethod']['additional_data']['cvv'])) {
                    return [
                        'creditCard' => [
                            'cvv' => $input['paymentMethod']['additional_data']['cvv']
                        ]
                    ];
                }
            }
        } catch (Exception $e) {
            $this->logger->critical($e->getMessage());
        }

        return [];
    }
}

Spamworldpro Mini