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/dev/tests/integration/testsuite/Magento/Paypal/_files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/dev/tests/integration/testsuite/Magento/Paypal/_files/order_payflow_link.php
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

use Magento\Paypal\Model\Config;
use Magento\Quote\Api\CartRepositoryInterface;
use Magento\Quote\Api\Data\CartInterface;
use Magento\Sales\Api\Data\OrderInterface;
use Magento\Sales\Api\OrderRepositoryInterface;
use Magento\Sales\Model\Order;
use Magento\Sales\Model\Order\Payment;
use Magento\Store\Api\Data\StoreInterface;
use Magento\Store\Model\StoreManagerInterface;
use Magento\TestFramework\Helper\Bootstrap;

$objManager = Bootstrap::getObjectManager();

/** @var StoreInterface $store */
$store = $objManager->get(StoreManagerInterface::class)
    ->getStore();

/** @var CartInterface $quote */
$quote = $objManager->create(CartInterface::class);
$quote->setReservedOrderId('000000045')
    ->setStoreId($store->getId());

/** @var CartRepositoryInterface $quoteRepository */
$quoteRepository = $objManager->get(CartRepositoryInterface::class);
$quoteRepository->save($quote);

/** @var Payment $payment */
$payment = $objManager->create(Payment::class);
$payment->setMethod(Config::METHOD_PAYFLOWLINK)
    ->setBaseAmountAuthorized(100)
    ->setAdditionalInformation(
        [
        'secure_silent_post_hash' => 'cf7i85d01ed7c92223031afb4rdl2f1f'
        ]
    );

/** @var OrderInterface $order */
$order = $objManager->create(OrderInterface::class);
$order->setIncrementId('000000045')
    ->setBaseGrandTotal(100)
    ->setQuoteId($quote->getId())
    ->setStoreId($store->getId())
    ->setState(Order::STATE_PENDING_PAYMENT)
    ->setPayment($payment);

/** @var OrderRepositoryInterface $orderRepository */
$orderRepository = $objManager->get(OrderRepositoryInterface::class);
$orderRepository->save($order);

Spamworldpro Mini