mage2pro / moip

Moip integration with Magento 2
https://upwork.com/fl/mage2pro
7 stars 1 forks source link

The GET «https://sandbox.moip.com.br/v2/preferences/notifications» API endpoint is down today (2017-10-19): «502 Proxy Error: The proxy server received an invalid response from an upstream server». We should handle this in a proper way. #21

Closed dmitrii-fediuk closed 6 years ago

dmitrii-fediuk commented 6 years ago

The API endpoint is decribed here: https://dev.moip.com.br/v2.0/reference#listar-todas-preferencias-de-notificacao It had been worked for last months, but today the Moip API server responds:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>502 Proxy Error</title>
</head><body>
<h1>Proxy Error</h1>
<p>The proxy server received an invalid
response from an upstream server.<br />
The proxy server could not handle the request <em><a href="/v2/preferences/notifications">GET&nbsp;/v2/preferences/notifications</a></em>.<p>
Reason: <strong>Error reading from remote server</strong></p></p>
</body></html>

For now, it leads to the following exception in my extension:

#0 \vendor\mage2pro\core\API\Client.php(227): df_error_create('The \xC2\xABpreferenc...')
#1 \vendor\mage2pro\core\API\Client.php(87): Df\API\Client->_p()
#2 \vendor\mage2pro\core\Core\lib\cache.php(103): Df\API\Client->Df\API\{closure}()
#3 \vendor\mage2pro\core\Core\lib\cache.php(296): {closure}('94bfacacce31314...')
#4 \vendor\mage2pro\core\Core\lib\cache.php(107): dfcf(Object(Closure), Array, Array)
#5 \vendor\mage2pro\core\API\Client.php(87): df_cache_get_simple('0=>https://sand...', Object(Closure), Array)
#6 \vendor\mage2pro\core\API\Facade.php(124): Df\API\Client->p()
#7 \vendor\mage2pro\core\API\Facade.php(26): Df\API\Facade->p()
#8 \vendor\mage2pro\moip\API\Facade\Notification.php(40): Df\API\Facade->all()
#9 \vendor\mage2pro\moip\FE\Webhooks.php(65): Dfe\Moip\API\Facade\Notification->targets()
#10 \vendor\mage2pro\core\Framework\Plugin\Data\Form\Element\AbstractElement.php(96): Dfe\Moip\FE\Webhooks->onFormInitialized()
#11 \generated\code\Df\Framework\Plugin\Data\Form\Element\AbstractElement\Interceptor.php(63): Df\Framework\Plugin\Data\Form\Element\AbstractElement->afterSetForm(Object(Dfe\Moip\FE\Webhooks\Interceptor), Object(Dfe\Moip\FE\Webhooks\Interceptor))
dmitrii-fediuk commented 6 years ago

The GET «https://sandbox.moip.com.br/v2/preferences/notifications» API endpoint is down today (2017-10-19): «502 Proxy Error: The proxy server received an invalid response from an upstream server»: https://mage2.pro/t/4721

dmitrii-fediuk commented 6 years ago

I handle this exception since the 1.2.0 version: 03