Cosa ha questo file di.xml non corretto?
Domanda
Sto implementazione di un gateway di pagamento personalizzato.
Per essere in grado di configurarlo, ho creato un configProvider in questo modo:
<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Desytec\Transbank\Model;
use Magento\Checkout\Model\ConfigProviderInterface;
use Magento\Framework\Escaper;
use Magento\Payment\Helper\Data as PaymentHelper;
class WebpayConfigProvider implements ConfigProviderInterface
{
/**
* @var string[]
*/
protected $methodCode = Webpay::CODE;
/**
* @var Webpay
*/
protected $method;
/**
* @var Escaper
*/
protected $escaper;
/**
* @param PaymentHelper $paymentHelper
* @param Escaper $escaper
*/
public function __construct(
PaymentHelper $paymentHelper,
Escaper $escaper
) {
$this->escaper = $escaper;
$this->method = $paymentHelper->getMethodInstance($this->methodCode);
}
/**
* {@inheritdoc}
*/
public function getConfig()
{
return $this->method->isAvailable() ? [
'payment' => [
'webpay' => [
'image' => $this->getImage(),
'instructions' => $this->getInstructions(),
],
],
] : [];
}
/**
* Get mailing address from config
*
* @return string
*/
protected function getImage()
{
return nl2br($this->escaper->escapeHtml($this->method->getImage()));
}
/**
* Get mailing address from config
*
* @return string
*/
protected function getInstructions()
{
return nl2br($this->escaper->escapeHtml($this->method->getInstructions()));
}
}
.
E questo file di.xml in etc / frontend:
<?xml version="1.0"?>
<!--
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Checkout\Model\CompositeConfigProvider">
<arguments>
<argument name="configProviders" xsi:type="array">
<item name="transbank_webpay_config_provider" xsi:type="object">Desytec\Transbank\Model\WebpayConfigProvider</item>
</argument>
</arguments>
</type>
</config>
.
Quando upload di.xml file su server e prova a caricare il checkout, si verifica un errore 500.Se lo cancello, la pagina viene visualizzata correttamente.
Cosa vedi male in quel file?
Grazie Jaime
Soluzione
Non deve essere il di.xml stesso contenente l'errore.
Una risposta da 500 mezzi soprattutto, che dovresti esaminare il tuo errore dei server Web.Ci dovrebbe essere un'eccezione o un errore in esso contenente un messaggio di errore del capo
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange