|
@@ -1,5 +1,6 @@
|
|
|
<?php
|
|
<?php
|
|
|
declare(strict_types=1);
|
|
declare(strict_types=1);
|
|
|
|
|
+
|
|
|
namespace SixShop\Payment\Controller;
|
|
namespace SixShop\Payment\Controller;
|
|
|
|
|
|
|
|
use SixShop\Core\Helper;
|
|
use SixShop\Core\Helper;
|
|
@@ -14,11 +15,11 @@ class PaymentController
|
|
|
{
|
|
{
|
|
|
public function index(PaymentManager $paymentManager, Config $config, Request $request): Response
|
|
public function index(PaymentManager $paymentManager, Config $config, Request $request): Response
|
|
|
{
|
|
{
|
|
|
- $env = $request->header('env', 'release');
|
|
|
|
|
- $payments = array_column($paymentManager->getAllPayment(), null,'id');
|
|
|
|
|
|
|
+ $env = $request->header('env');
|
|
|
|
|
+ $payments = array_column($paymentManager->getAllPayment(), null, 'id');
|
|
|
$result = [];
|
|
$result = [];
|
|
|
foreach ($payments as $id => $payment) {
|
|
foreach ($payments as $id => $payment) {
|
|
|
- if (in_array($env, $config->getConfig('supported_env_'.$id))) {
|
|
|
|
|
|
|
+ if ($env == null || in_array($env, $config->getConfig('supported_env_' . $id, []))) {
|
|
|
$result[] = $payment;
|
|
$result[] = $payment;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|