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
Sales
_files
order_payment_list.php
Go to the documentation of this file.
1
<?php
7
use
Magento\Sales\Model\Order
;
8
9
require
'order.php'
;
12
$payments
= [
13
[
14
'parent_id'
=>
$order
->getId(),
15
'cc_exp_month'
=>
'06'
,
16
'cc_ss_start_year'
=>
'2014'
,
17
'method'
=>
'checkmo'
,
18
'cc_last_4'
=>
'123'
19
],
20
[
21
'parent_id'
=>
$order
->getId(),
22
'cc_exp_month'
=>
'07'
,
23
'cc_ss_start_year'
=>
'2014'
,
24
'method'
=>
'checkmo'
,
25
'cc_last_4'
=>
'456'
26
],
27
[
28
'parent_id'
=>
$order
->getId(),
29
'cc_exp_month'
=>
'08'
,
30
'cc_ss_start_year'
=>
'2015'
,
31
'method'
=>
'checkmo'
32
],
33
[
34
'parent_id'
=>
$order
->getId(),
35
'cc_exp_month'
=>
'09'
,
36
'cc_ss_start_year'
=>
'2016'
,
37
'method'
=>
'paypal_express'
38
],
39
];
40
42
foreach
(
$payments
as $paymentData) {
44
$payment
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()->create(
45
\
Magento
\Sales\Model\
Order
\Payment::class
46
);
47
$payment
48
->setData($paymentData)
49
->save();
50
}
Magento\Sales\Model\Order
Definition:
Order.php:54
Magento\Sales\Model\Order
$order
$order
Definition:
order.php:55
$payment
$payment
Definition:
order.php:17
Magento
$payments
$payments
Definition:
order_payment_list.php:12
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125