Skip to content

Commit 7b4b054

Browse files
author
Karen Baker
committed
Moved Config.php out to AbstractConfig to make code DRY and help extn development
1 parent 30137aa commit 7b4b054

File tree

9 files changed

+643
-571
lines changed

9 files changed

+643
-571
lines changed
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Fedex\Helper;
7+
use Magento\Shipping\Model\ConfigInterface;
8+
9+
10+
/**
11+
* Configuration data of carrier
12+
*/
13+
class Config extends \Magento\Shipping\Helper\AbstractConfig implements ConfigInterface
14+
{
15+
/**
16+
* Get configuration data of carrier
17+
*
18+
* @return array
19+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
20+
*/
21+
function getCodes()
22+
{
23+
return [
24+
'method' => [
25+
'EUROPE_FIRST_INTERNATIONAL_PRIORITY' => __('Europe First Priority'),
26+
'FEDEX_1_DAY_FREIGHT' => __('1 Day Freight'),
27+
'FEDEX_2_DAY_FREIGHT' => __('2 Day Freight'),
28+
'FEDEX_2_DAY' => __('2 Day'),
29+
'FEDEX_2_DAY_AM' => __('2 Day AM'),
30+
'FEDEX_3_DAY_FREIGHT' => __('3 Day Freight'),
31+
'FEDEX_EXPRESS_SAVER' => __('Express Saver'),
32+
'FEDEX_GROUND' => __('Ground'),
33+
'FIRST_OVERNIGHT' => __('First Overnight'),
34+
'GROUND_HOME_DELIVERY' => __('Home Delivery'),
35+
'INTERNATIONAL_ECONOMY' => __('International Economy'),
36+
'INTERNATIONAL_ECONOMY_FREIGHT' => __('Intl Economy Freight'),
37+
'INTERNATIONAL_FIRST' => __('International First'),
38+
'INTERNATIONAL_GROUND' => __('International Ground'),
39+
'INTERNATIONAL_PRIORITY' => __('International Priority'),
40+
'INTERNATIONAL_PRIORITY_FREIGHT' => __('Intl Priority Freight'),
41+
'PRIORITY_OVERNIGHT' => __('Priority Overnight'),
42+
'SMART_POST' => __('Smart Post'),
43+
'STANDARD_OVERNIGHT' => __('Standard Overnight'),
44+
'FEDEX_FREIGHT' => __('Freight'),
45+
'FEDEX_NATIONAL_FREIGHT' => __('National Freight'),
46+
],
47+
'dropoff' => [
48+
'REGULAR_PICKUP' => __('Regular Pickup'),
49+
'REQUEST_COURIER' => __('Request Courier'),
50+
'DROP_BOX' => __('Drop Box'),
51+
'BUSINESS_SERVICE_CENTER' => __('Business Service Center'),
52+
'STATION' => __('Station'),
53+
],
54+
'packaging' => [
55+
'FEDEX_ENVELOPE' => __('FedEx Envelope'),
56+
'FEDEX_PAK' => __('FedEx Pak'),
57+
'FEDEX_BOX' => __('FedEx Box'),
58+
'FEDEX_TUBE' => __('FedEx Tube'),
59+
'FEDEX_10KG_BOX' => __('FedEx 10kg Box'),
60+
'FEDEX_25KG_BOX' => __('FedEx 25kg Box'),
61+
'YOUR_PACKAGING' => __('Your Packaging'),
62+
],
63+
'containers_filter' => [
64+
[
65+
'containers' => ['FEDEX_ENVELOPE', 'FEDEX_PAK'],
66+
'filters' => [
67+
'within_us' => [
68+
'method' => [
69+
'FEDEX_EXPRESS_SAVER',
70+
'FEDEX_2_DAY',
71+
'FEDEX_2_DAY_AM',
72+
'STANDARD_OVERNIGHT',
73+
'PRIORITY_OVERNIGHT',
74+
'FIRST_OVERNIGHT',
75+
],
76+
],
77+
'from_us' => [
78+
'method' => ['INTERNATIONAL_FIRST', 'INTERNATIONAL_ECONOMY', 'INTERNATIONAL_PRIORITY'],
79+
],
80+
],
81+
],
82+
[
83+
'containers' => ['FEDEX_BOX', 'FEDEX_TUBE'],
84+
'filters' => [
85+
'within_us' => [
86+
'method' => [
87+
'FEDEX_2_DAY',
88+
'FEDEX_2_DAY_AM',
89+
'STANDARD_OVERNIGHT',
90+
'PRIORITY_OVERNIGHT',
91+
'FIRST_OVERNIGHT',
92+
'FEDEX_FREIGHT',
93+
'FEDEX_1_DAY_FREIGHT',
94+
'FEDEX_2_DAY_FREIGHT',
95+
'FEDEX_3_DAY_FREIGHT',
96+
'FEDEX_NATIONAL_FREIGHT',
97+
],
98+
],
99+
'from_us' => [
100+
'method' => ['INTERNATIONAL_FIRST', 'INTERNATIONAL_ECONOMY', 'INTERNATIONAL_PRIORITY'],
101+
],
102+
]
103+
],
104+
[
105+
'containers' => ['FEDEX_10KG_BOX', 'FEDEX_25KG_BOX'],
106+
'filters' => [
107+
'within_us' => [],
108+
'from_us' => ['method' => ['INTERNATIONAL_PRIORITY']],
109+
]
110+
],
111+
[
112+
'containers' => ['YOUR_PACKAGING'],
113+
'filters' => [
114+
'within_us' => [
115+
'method' => [
116+
'FEDEX_GROUND',
117+
'GROUND_HOME_DELIVERY',
118+
'SMART_POST',
119+
'FEDEX_EXPRESS_SAVER',
120+
'FEDEX_2_DAY',
121+
'FEDEX_2_DAY_AM',
122+
'STANDARD_OVERNIGHT',
123+
'PRIORITY_OVERNIGHT',
124+
'FIRST_OVERNIGHT',
125+
'FEDEX_FREIGHT',
126+
'FEDEX_1_DAY_FREIGHT',
127+
'FEDEX_2_DAY_FREIGHT',
128+
'FEDEX_3_DAY_FREIGHT',
129+
'FEDEX_NATIONAL_FREIGHT',
130+
],
131+
],
132+
'from_us' => [
133+
'method' => [
134+
'INTERNATIONAL_FIRST',
135+
'INTERNATIONAL_ECONOMY',
136+
'INTERNATIONAL_PRIORITY',
137+
'INTERNATIONAL_GROUND',
138+
'FEDEX_FREIGHT',
139+
'FEDEX_1_DAY_FREIGHT',
140+
'FEDEX_2_DAY_FREIGHT',
141+
'FEDEX_3_DAY_FREIGHT',
142+
'FEDEX_NATIONAL_FREIGHT',
143+
'INTERNATIONAL_ECONOMY_FREIGHT',
144+
'INTERNATIONAL_PRIORITY_FREIGHT',
145+
],
146+
],
147+
]
148+
],
149+
],
150+
'delivery_confirmation_types' => [
151+
'NO_SIGNATURE_REQUIRED' => __('Not Required'),
152+
'ADULT' => __('Adult'),
153+
'DIRECT' => __('Direct'),
154+
'INDIRECT' => __('Indirect'),
155+
],
156+
'unit_of_measure' => [
157+
'LB' => __('Pounds'),
158+
'KG' => __('Kilograms'),
159+
],
160+
];
161+
}
162+
}

0 commit comments

Comments
 (0)