1 | <?php |
||
37 | class Order extends \Payone\Core\Helper\Base |
||
38 | { |
||
39 | /** |
||
40 | * PAYONE database helper |
||
41 | * |
||
42 | * @var \Payone\Core\Helper\Database |
||
43 | */ |
||
44 | protected $databaseHelper; |
||
45 | |||
46 | /** |
||
47 | * PAYONE customer helper |
||
48 | * |
||
49 | * @var \Payone\Core\Helper\Customer |
||
50 | */ |
||
51 | protected $customerHelper; |
||
52 | |||
53 | /** |
||
54 | * Order factory |
||
55 | * |
||
56 | * @var \Magento\Sales\Model\OrderFactory |
||
57 | */ |
||
58 | protected $orderFactory; |
||
59 | |||
60 | /** |
||
61 | * Totals collector object |
||
62 | * |
||
63 | * @var \Magento\Quote\Model\Quote\TotalsCollector |
||
64 | */ |
||
65 | protected $totalsCollector; |
||
66 | |||
67 | /** |
||
68 | * Constructor |
||
69 | * |
||
70 | * @param \Magento\Framework\App\Helper\Context $context |
||
71 | * @param \Magento\Store\Model\StoreManagerInterface $storeManager |
||
72 | * @param \Payone\Core\Helper\Shop $shopHelper |
||
73 | * @param \Payone\Core\Helper\Database $databaseHelper |
||
74 | * @param \Payone\Core\Helper\Customer $customerHelper |
||
75 | * @param \Magento\Sales\Model\OrderFactory $orderFactory |
||
76 | * @param \Magento\Quote\Model\Quote\TotalsCollector $totalsCollector |
||
77 | */ |
||
78 | public function __construct( |
||
79 | \Magento\Framework\App\Helper\Context $context, |
||
80 | \Magento\Store\Model\StoreManagerInterface $storeManager, |
||
81 | \Payone\Core\Helper\Shop $shopHelper, |
||
82 | \Payone\Core\Helper\Database $databaseHelper, |
||
83 | \Payone\Core\Helper\Customer $customerHelper, |
||
84 | \Magento\Sales\Model\OrderFactory $orderFactory, |
||
85 | \Magento\Quote\Model\Quote\TotalsCollector $totalsCollector |
||
86 | ) { |
||
87 | parent::__construct($context, $storeManager, $shopHelper); |
||
88 | $this->databaseHelper = $databaseHelper; |
||
89 | $this->customerHelper = $customerHelper; |
||
90 | $this->orderFactory = $orderFactory; |
||
91 | $this->totalsCollector = $totalsCollector; |
||
92 | } |
||
93 | |||
94 | /** |
||
95 | * Return the order related to the given TransactionStatus |
||
96 | * |
||
97 | * @param string $sTxid |
||
98 | * @return SalesOrder|null |
||
99 | */ |
||
100 | public function getOrderByTxid($sTxid) |
||
109 | |||
110 | /** |
||
111 | * Determine the cheapest available shipping method |
||
112 | * |
||
113 | * @param Quote $oQuote |
||
114 | * @param Address $oShippingAddress |
||
115 | * @return string|bool |
||
116 | */ |
||
117 | public function getShippingMethod(Quote $oQuote, Address $oShippingAddress) |
||
137 | |||
138 | /** |
||
139 | * Get Shipping method and add it to the shipping-address object |
||
140 | * |
||
141 | * @param Address $oAddress |
||
142 | * @param Quote $oQuote |
||
143 | * @return Address |
||
144 | * @throws LocalizedException |
||
145 | */ |
||
146 | public function setShippingMethod(Address $oAddress, Quote $oQuote) |
||
158 | |||
159 | /** |
||
160 | * Fill billing and shipping addresses with the needed information from the response |
||
161 | * |
||
162 | * @param Address $oAddress |
||
163 | * @param string $sFirstname |
||
164 | * @param string $sLastname |
||
165 | * @param string $sStreet |
||
166 | * @param string $sCity |
||
167 | * @param string $sZip |
||
168 | * @param string $sCountry |
||
169 | * @param string $sState |
||
170 | * @return Address |
||
171 | */ |
||
172 | public function fillSingleAddress(Address $oAddress, $sFirstname, $sLastname, $sStreet, $sCity, $sZip, $sCountry, $sState) |
||
188 | } |
||
189 |