Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
order_hostedpro.php
Go to the documentation of this file.
1 <?php
12 
13 $addressData = require(__DIR__ . '/address_data.php');
14 $objManager = Bootstrap::getObjectManager();
15 
17  ->create(Address::class, ['data' => $addressData])
18  ->setAddressType('billing');
19 
21 $shippingAddress->setId(null)
22  ->setAddressType('shipping');
23 
25 $payment = $objManager->create(Payment::class);
26 $payment->setMethod(Config::METHOD_HOSTEDPRO);
27 
29 $order = $objManager->create(Order::class);
30 $order->setCustomerEmail('[email protected]')
31  ->setIncrementId('100000001')
32  ->setSubtotal(100)
33  ->setBaseSubtotal(100)
34  ->setBaseGrandTotal(100)
35  ->setBaseCurrencyCode('USD')
36  ->setCustomerIsGuest(true)
37  ->setBillingAddress($billingAddress)
38  ->setShippingAddress($shippingAddress)
39  ->setPayment($payment);
40 
41 $order->save();
$addressData
$billingAddress
defined('TESTS_BP')||define('TESTS_BP' __DIR__
Definition: _bootstrap.php:60
$payment
$objManager
$shippingAddress