5
5
*/
6
6
namespace Magento \Payment \Ui \Component \Listing \Column \Method ;
7
7
8
- use Magento \Payment \Api \PaymentMethodListInterface ;
9
- use Magento \Store \Model \StoreManagerInterface ;
10
-
11
8
/**
12
9
* Class Options
13
10
*/
@@ -23,29 +20,15 @@ class Options implements \Magento\Framework\Data\OptionSourceInterface
23
20
*/
24
21
protected $ paymentHelper ;
25
22
26
- /**
27
- * @var PaymentMethodListInterface
28
- */
29
- private $ paymentMethodList ;
30
-
31
- /**
32
- * @var StoreManagerInterface
33
- */
34
- private $ storeManager ;
35
-
36
23
/**
37
24
* Constructor
38
25
*
39
26
* @param \Magento\Payment\Helper\Data $paymentHelper
40
27
*/
41
28
public function __construct (
42
- \Magento \Payment \Helper \Data $ paymentHelper ,
43
- \Magento \Payment \Api \PaymentMethodListInterface $ paymentMethodList ,
44
- \Magento \Store \Model \StoreManagerInterface $ storeManager
29
+ \Magento \Payment \Helper \Data $ paymentHelper
45
30
) {
46
31
$ this ->paymentHelper = $ paymentHelper ;
47
- $ this ->paymentMethodList = $ paymentMethodList ;
48
- $ this ->storeManager = $ storeManager ;
49
32
}
50
33
51
34
/**
@@ -56,23 +39,8 @@ public function __construct(
56
39
public function toOptionArray ()
57
40
{
58
41
if ($ this ->options === null ) {
59
- $ this ->options = $ this ->getPaymentOptions ();
60
- // $this->options = $this->paymentHelper->getPaymentMethodList(true, true);
42
+ $ this ->options = $ this ->paymentHelper ->getPaymentMethodList (true , true );
61
43
}
62
44
return $ this ->options ;
63
45
}
64
-
65
- /**
66
- * @return array
67
- * @throws \Magento\Framework\Exception\NoSuchEntityException
68
- */
69
- private function getPaymentOptions ()
70
- {
71
- $ options = [];
72
- foreach ($ this ->paymentMethodList ->getList ($ this ->storeManager ->getStore ()->getId ()) as $ option ) {
73
- $ options [$ option ->getCode ()] = ['value ' => $ option ->getCode (), 'label ' => $ option ->getTitle ()];
74
- }
75
- asort ($ options );
76
- return $ options ;
77
- }
78
46
}
0 commit comments