1 <?php
2 3 4
5 namespace Team3\PayU\Order\Autocomplete\Strategy;
6
7 use Team3\PayU\Configuration\ConfigurationInterface;
8 use Team3\PayU\Order\Model\OrderInterface;
9
10 class CustomerIpStrategy implements AutocompleteStrategyInterface
11 {
12 13 14 15 16
17 public function supports(OrderInterface $order)
18 {
19 return null === $order->getCustomerIp();
20 }
21
22 23 24 25
26 public function autocomplete(
27 OrderInterface $order,
28 ConfigurationInterface $configuration
29 ) {
30 $order->setCustomerIp(
31 getenv('REMOTE_ADDR')
32 );
33 }
34 }
35