Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
order_payflow_link.php
Go to the documentation of this file.
1 <?php
17 
18 $objManager = Bootstrap::getObjectManager();
19 
21 $store = $objManager->get(StoreManagerInterface::class)
22  ->getStore();
23 
25 $quote = $objManager->create(CartInterface::class);
26 $quote->setReservedOrderId('000000045')
27  ->setStoreId($store->getId());
28 
30 $quoteRepository = $objManager->get(CartRepositoryInterface::class);
32 
34 $payment = $objManager->create(Payment::class);
35 $payment->setMethod(Config::METHOD_PAYFLOWLINK)
36  ->setBaseAmountAuthorized(100)
37  ->setAdditionalInformation([
38  'secure_silent_post_hash' => 'cf7i85d01ed7c92223031afb4rdl2f1f'
39  ]);
40 
41 
43 $order = $objManager->create(OrderInterface::class);
44 $order->setIncrementId('000000045')
45  ->setBaseGrandTotal(100)
46  ->setQuoteId($quote->getId())
47  ->setStoreId($store->getId())
48  ->setState(Order::STATE_PENDING_PAYMENT)
49  ->setPayment($payment);
50 
52 $orderRepository = $objManager->get(OrderRepositoryInterface::class);