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 MerchantPosIdStrategy implements AutocompleteStrategyInterface
11 {
12 13 14 15 16
17 public function supports(OrderInterface $order)
18 {
19 return null === $order->getMerchantPosId();
20 }
21
22 23 24 25
26 public function autocomplete(
27 OrderInterface $order,
28 ConfigurationInterface $configuration
29 ) {
30 $order->setMerchantPosId(
31 $configuration->getCredentials()->getMerchantPosId()
32 );
33 }
34 }
35