Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
FetchReports.php
Go to the documentation of this file.
1 <?php
7 
9 {
14 
20  public function __construct(
21  \Magento\Paypal\Model\Report\SettlementFactory $settlementFactory
22  ) {
23  $this->_settlementFactory = $settlementFactory;
24  }
25 
32  public function execute()
33  {
35  $reports = $this->_settlementFactory->create();
36  /* @var $reports \Magento\Paypal\Model\Report\Settlement */
37  $credentials = $reports->getSftpCredentials(true);
38  foreach ($credentials as $config) {
39  $reports->fetchAndSave(\Magento\Paypal\Model\Report\Settlement::createConnection($config));
40  }
41  }
42 }
$config
Definition: fraud_order.php:17
__construct(\Magento\Paypal\Model\Report\SettlementFactory $settlementFactory)