$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $paymentHelper = $objectManager->get('Magento\Payment\Helper\Data'); $allPaymentMethods = $paymentHelper->getPaymentMethods(); $allPaymentMethodsArray = $paymentHelper->getPaymentMethodList(); var_dump($allPaymentMethodsArray); var_dump($allPaymentMethods); $paymentConfig = $objectManager->get('Magento\Payment\Model\Config'); $activePaymentMethods = $paymentConfig->getActiveMethods(); var_dump(array_keys($activePaymentMethods)); $orderPaymentCollection = $objectManager->get('\Magento\Sales\Model\ResourceModel\Order\Payment\Collection'); $orderPaymentCollection->getSelect()->group('method'); $paymentMethods[] = array('value' => '', 'label' => 'Any'); foreach ($orderPaymentCollection as $col) { $paymentMethods[] = array('value' => $col->getMethod(), 'label' => $col->getAdditionalInformation()['method_title']); }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter