File tree Expand file tree Collapse file tree 6 files changed +239
-0
lines changed
app/code/Magento/Payment/Gateway/Data Expand file tree Collapse file tree 6 files changed +239
-0
lines changed Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \Payment \Gateway \Data ;
7
7
8
+ /**
9
+ * Interface AddressAdapterInterface
10
+ */
8
11
interface AddressAdapterInterface
9
12
{
10
13
/**
@@ -90,4 +93,32 @@ public function getCustomerId();
90
93
* @return string
91
94
*/
92
95
public function getEmail ();
96
+
97
+ /**
98
+ * Returns street
99
+ *
100
+ * @return string
101
+ */
102
+ public function getStreet ();
103
+
104
+ /**
105
+ * Returns region
106
+ *
107
+ * @return string
108
+ */
109
+ public function getRegion ();
110
+
111
+ /**
112
+ * Returns name prefix
113
+ *
114
+ * @return string
115
+ */
116
+ public function getPrefix ();
117
+
118
+ /**
119
+ * Returns name suffix
120
+ *
121
+ * @return string
122
+ */
123
+ public function getSuffix ();
93
124
}
Original file line number Diff line number Diff line change 8
8
use Magento \Payment \Gateway \Data \AddressAdapterInterface ;
9
9
use Magento \Sales \Api \Data \OrderAddressInterface ;
10
10
11
+ /**
12
+ * Class AddressAdapter
13
+ */
11
14
class AddressAdapter implements AddressAdapterInterface
12
15
{
13
16
/**
@@ -144,4 +147,44 @@ public function getEmail()
144
147
{
145
148
return $ this ->address ->getEmail ();
146
149
}
150
+
151
+ /**
152
+ * Returns street
153
+ *
154
+ * @return string[]
155
+ */
156
+ public function getStreet ()
157
+ {
158
+ return $ this ->address ->getStreet ();
159
+ }
160
+
161
+ /**
162
+ * Returns region
163
+ *
164
+ * @return string
165
+ */
166
+ public function getRegion ()
167
+ {
168
+ return $ this ->address ->getRegion ();
169
+ }
170
+
171
+ /**
172
+ * Returns name prefix
173
+ *
174
+ * @return string
175
+ */
176
+ public function getPrefix ()
177
+ {
178
+ return $ this ->address ->getPrefix ();
179
+ }
180
+
181
+ /**
182
+ * Returns name suffix
183
+ *
184
+ * @return string
185
+ */
186
+ public function getSuffix ()
187
+ {
188
+ return $ this ->address ->getSuffix ();
189
+ }
147
190
}
Original file line number Diff line number Diff line change 9
9
use Magento \Payment \Gateway \Data \OrderAdapterInterface ;
10
10
use Magento \Sales \Api \Data \OrderInterface ;
11
11
12
+ /**
13
+ * Class OrderAdapter
14
+ */
12
15
class OrderAdapter implements OrderAdapterInterface
13
16
{
14
17
/**
@@ -106,4 +109,45 @@ public function getId()
106
109
{
107
110
return $ this ->order ->getEntityId ();
108
111
}
112
+
113
+ /**
114
+ * Returns order increment id
115
+ *
116
+ * @return string
117
+ *
118
+ */
119
+ public function getIncrementId ()
120
+ {
121
+ return $ this ->order ->getIncrementId ();
122
+ }
123
+
124
+ /**
125
+ * Returns quote id
126
+ *
127
+ * @return int
128
+ */
129
+ public function getQuoteId ()
130
+ {
131
+ return $ this ->order ->getQuoteId ();
132
+ }
133
+
134
+ /**
135
+ * Returns order grand total
136
+ *
137
+ * @return float
138
+ */
139
+ public function getGrandTotal ()
140
+ {
141
+ return $ this ->order ->getGrandTotal ();
142
+ }
143
+
144
+ /**
145
+ * Returns base currency code
146
+ *
147
+ * @return string
148
+ */
149
+ public function getBaseCurrencyCode ()
150
+ {
151
+ return $ this ->order ->getBaseCurrencyCode ();
152
+ }
109
153
}
Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \Payment \Gateway \Data ;
7
7
8
+ /**
9
+ * Interface OrderAdapterInterface
10
+ */
8
11
interface OrderAdapterInterface
9
12
{
10
13
/**
@@ -55,4 +58,33 @@ public function getStoreId();
55
58
* @return int
56
59
*/
57
60
public function getId ();
61
+
62
+ /**
63
+ * Returns order increment id
64
+ *
65
+ * @return string
66
+ *
67
+ */
68
+ public function getIncrementId ();
69
+
70
+ /**
71
+ * Returns quote id
72
+ *
73
+ * @return int
74
+ */
75
+ public function getQuoteId ();
76
+
77
+ /**
78
+ * Returns order grand total
79
+ *
80
+ * @return float
81
+ */
82
+ public function getGrandTotal ();
83
+
84
+ /**
85
+ * Returns base currency code
86
+ *
87
+ * @return string
88
+ */
89
+ public function getBaseCurrencyCode ();
58
90
}
Original file line number Diff line number Diff line change 8
8
use Magento \Payment \Gateway \Data \AddressAdapterInterface ;
9
9
use Magento \Quote \Api \Data \AddressInterface ;
10
10
11
+ /**
12
+ * Class AddressAdapter
13
+ */
11
14
class AddressAdapter implements AddressAdapterInterface
12
15
{
13
16
/**
@@ -144,4 +147,44 @@ public function getEmail()
144
147
{
145
148
return $ this ->address ->getEmail ();
146
149
}
150
+
151
+ /**
152
+ * Returns street
153
+ *
154
+ * @return string[]
155
+ */
156
+ public function getStreet ()
157
+ {
158
+ return $ this ->address ->getStreet ();
159
+ }
160
+
161
+ /**
162
+ * Returns region
163
+ *
164
+ * @return string
165
+ */
166
+ public function getRegion ()
167
+ {
168
+ return $ this ->address ->getRegion ();
169
+ }
170
+
171
+ /**
172
+ * Returns name prefix
173
+ *
174
+ * @return string
175
+ */
176
+ public function getPrefix ()
177
+ {
178
+ return $ this ->address ->getPrefix ();
179
+ }
180
+
181
+ /**
182
+ * Returns name suffix
183
+ *
184
+ * @return string
185
+ */
186
+ public function getSuffix ()
187
+ {
188
+ return $ this ->address ->getSuffix ();
189
+ }
147
190
}
Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \Payment \Gateway \Data \Quote ;
7
7
8
+ use Magento \Framework \Exception \LocalizedException ;
8
9
use Magento \Payment \Gateway \Data \OrderAdapterInterface ;
9
10
use Magento \Quote \Api \Data \CartInterface ;
10
11
use Magento \Payment \Gateway \Data \AddressAdapterInterface ;
11
12
13
+ /**
14
+ * Class QuoteAdapter
15
+ */
12
16
class QuoteAdapter implements OrderAdapterInterface
13
17
{
14
18
/**
@@ -106,4 +110,46 @@ public function getId()
106
110
{
107
111
return $ this ->quote ->getId ();
108
112
}
113
+
114
+ /**
115
+ * Returns order increment id
116
+ *
117
+ * @return string
118
+ *
119
+ */
120
+ public function getIncrementId ()
121
+ {
122
+ return $ this ->quote ->getReservedOrderId ();
123
+ }
124
+
125
+ /**
126
+ * Returns quote id
127
+ *
128
+ * @return int
129
+ */
130
+ public function getQuoteId ()
131
+ {
132
+ return $ this ->quote ->getId ();
133
+ }
134
+
135
+ /**
136
+ * Returns order grand total
137
+ *
138
+ * @return float
139
+ * @throws LocalizedException
140
+ */
141
+ public function getGrandTotal ()
142
+ {
143
+ throw new LocalizedException (__ ('This method cannot be implemented in this class " ' . __CLASS__ . '" ' ));
144
+ }
145
+
146
+ /**
147
+ * Returns base currency code
148
+ *
149
+ * @return string
150
+ */
151
+ public function getBaseCurrencyCode ()
152
+ {
153
+ return $ this ->quote ->getCurrency ()->getBaseCurrencyCode ();
154
+ }
109
155
}
You can’t perform that action at this time.
0 commit comments