Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
magento2-base
dev
tests
integration
testsuite
Magento
Paypal
_files
order_hostedpro.php
Go to the documentation of this file.
1
<?php
7
use
Magento\Paypal\Model\Config
;
8
use
Magento\Sales\Model\Order
;
9
use
Magento\Sales\Model\Order\Address
;
10
use
Magento\Sales\Model\Order\Payment
;
11
use
Magento\TestFramework\Helper\Bootstrap
;
12
13
$addressData
= require(
__DIR__
.
'/address_data.php'
);
14
$objManager
= Bootstrap::getObjectManager();
15
16
$billingAddress
=
$objManager
17
->create(Address::class, [
'data'
=>
$addressData
])
18
->setAddressType(
'billing'
);
19
20
$shippingAddress
= clone
$billingAddress
;
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
$addressData
Definition:
order_hostedpro.php:13
$billingAddress
$billingAddress
Definition:
order_hostedpro.php:16
Magento\TestFramework\Helper\Bootstrap
Definition:
Bootstrap.php:12
Magento\Sales\Model\Order
__DIR__
defined('TESTS_BP')||define('TESTS_BP' __DIR__
Definition:
_bootstrap.php:60
$payment
$payment
Definition:
order_hostedpro.php:25
$objManager
$objManager
Definition:
order_hostedpro.php:14
$shippingAddress
$shippingAddress
Definition:
order_hostedpro.php:20
Magento\Sales\Model\Order\Address
Definition:
RendererTest.php:6
Magento\Sales\Model\Order\Payment
Definition:
RepositoryTest.php:6
Magento\Paypal\Model\Config
$order
$order
Definition:
order_hostedpro.php:29