Skip to content

Commit 2ff8f63

Browse files
committed
MAGETWO-38902: Create controller for handling success message
- added command of build form data
1 parent 206988a commit 2ff8f63

File tree

6 files changed

+239
-0
lines changed

6 files changed

+239
-0
lines changed

app/code/Magento/Payment/Gateway/Data/AddressAdapterInterface.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
*/
66
namespace Magento\Payment\Gateway\Data;
77

8+
/**
9+
* Interface AddressAdapterInterface
10+
*/
811
interface AddressAdapterInterface
912
{
1013
/**
@@ -90,4 +93,32 @@ public function getCustomerId();
9093
* @return string
9194
*/
9295
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();
93124
}

app/code/Magento/Payment/Gateway/Data/Order/AddressAdapter.php

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
use Magento\Payment\Gateway\Data\AddressAdapterInterface;
99
use Magento\Sales\Api\Data\OrderAddressInterface;
1010

11+
/**
12+
* Class AddressAdapter
13+
*/
1114
class AddressAdapter implements AddressAdapterInterface
1215
{
1316
/**
@@ -144,4 +147,44 @@ public function getEmail()
144147
{
145148
return $this->address->getEmail();
146149
}
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+
}
147190
}

app/code/Magento/Payment/Gateway/Data/Order/OrderAdapter.php

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
use Magento\Payment\Gateway\Data\OrderAdapterInterface;
1010
use Magento\Sales\Api\Data\OrderInterface;
1111

12+
/**
13+
* Class OrderAdapter
14+
*/
1215
class OrderAdapter implements OrderAdapterInterface
1316
{
1417
/**
@@ -106,4 +109,45 @@ public function getId()
106109
{
107110
return $this->order->getEntityId();
108111
}
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+
}
109153
}

app/code/Magento/Payment/Gateway/Data/OrderAdapterInterface.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
*/
66
namespace Magento\Payment\Gateway\Data;
77

8+
/**
9+
* Interface OrderAdapterInterface
10+
*/
811
interface OrderAdapterInterface
912
{
1013
/**
@@ -55,4 +58,33 @@ public function getStoreId();
5558
* @return int
5659
*/
5760
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();
5890
}

app/code/Magento/Payment/Gateway/Data/Quote/AddressAdapter.php

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
use Magento\Payment\Gateway\Data\AddressAdapterInterface;
99
use Magento\Quote\Api\Data\AddressInterface;
1010

11+
/**
12+
* Class AddressAdapter
13+
*/
1114
class AddressAdapter implements AddressAdapterInterface
1215
{
1316
/**
@@ -144,4 +147,44 @@ public function getEmail()
144147
{
145148
return $this->address->getEmail();
146149
}
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+
}
147190
}

app/code/Magento/Payment/Gateway/Data/Quote/QuoteAdapter.php

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@
55
*/
66
namespace Magento\Payment\Gateway\Data\Quote;
77

8+
use Magento\Framework\Exception\LocalizedException;
89
use Magento\Payment\Gateway\Data\OrderAdapterInterface;
910
use Magento\Quote\Api\Data\CartInterface;
1011
use Magento\Payment\Gateway\Data\AddressAdapterInterface;
1112

13+
/**
14+
* Class QuoteAdapter
15+
*/
1216
class QuoteAdapter implements OrderAdapterInterface
1317
{
1418
/**
@@ -106,4 +110,46 @@ public function getId()
106110
{
107111
return $this->quote->getId();
108112
}
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+
}
109155
}

0 commit comments

Comments
 (0)