Skip to content
This repository was archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
Merge pull request #91 from gabriellucius/fix-errorpage-redirect-payment
Browse files Browse the repository at this point in the history
Fix errorpage redirect payment
  • Loading branch information
s2it-moscou authored May 4, 2018
2 parents 6fae28e + 718a860 commit 5941967
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Changelog
---------
3.16.1
- Fix: redirecionamento para tela de erro caso ocorra algum problema no checkout padrão ou lightbox

3.16.0
- Inserir configuração de Status do PagSeguro por Notificação (admin) em relação ao states do Magento
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Com o módulo instalado e configurado, você pode pode oferecer o PagSeguro como
**[Licença](#licença)**<br>

## Requisitos
- [Magento](https://www.magentocommerce.com/) Community 1.9.0 até 1.9.3.7
- [Magento](https://www.magentocommerce.com/) Community 1.9.0 até 1.9.3.8
- [PHP](http://www.php.net/) 5.4.27+, 5.5.x+, 5.6.x+
- [SPL](http://php.net/manual/en/book.spl.php)
- [cURL](http://php.net/manual/en/book.curl.php)
Expand All @@ -33,7 +33,7 @@ Com o módulo instalado e configurado, você pode pode oferecer o PagSeguro como
- Certifique-se de que não há instalação de outros módulos para o PagSeguro em seu sistema;
- Caso utilize a compilação do Magento, desative-a e limpe-a *(Sistema -> Ferramentas -> Compilação)*;
- Baixe a última versão do módulo **[nesse link](https://github.com/pagseguro/magento/raw/master/UOL_PagSeguro-3.16.0.tgz)** ou então baixe o repositório como arquivo zip através do botão do GitHub;
- Baixe a última versão do módulo **[nesse link](https://github.com/pagseguro/magento/raw/master/UOL_PagSeguro-3.16.1.tgz)** ou então baixe o repositório como arquivo zip através do botão do GitHub;
- Na área administrativa do seu Magento, acesse o menu *Sistema/System -> Magento Connect -> Magento Connect Manager*. Caso tenha uma versão anterior do módulo instalada faça a remoção agora;
- No Magento Connect Manger, dentro da seção Direct package file upload, clique em **Escolher arquivo/Choose file**, selecione o arquivo UOL_PagSeguro-x.x.x.tgz (baixado anteriormente), clique no botão de upload e acompanhe a instalação do módulo no console da página;
- Caso utilize a compilação, volte para a área administrativa do Magento, ative-a e execute-a novamente;
Expand Down
Binary file removed UOL_PagSeguro-3.16.0.tgz
Binary file not shown.
Binary file added UOL_PagSeguro-3.16.1.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion UOL_PagSeguro.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<description>Aceite mais de 25 meios de pagamentos com apenas 1 contrato. Seus clientes podem parcelar no cartão em até 18x e se preferir, você também pode oferecer parcelamento sem acréscimo.</description>
<license>Apache Software License</license>
<license_uri>http://opensource.org/licenses/apachepl.php</license_uri>
<version>3.16.0</version>
<version>3.16.1</version>
<stability>stable</stability>
<notes>- Add PagSeguro status to magento state configuration
- Retry payment page when checkout finishes with error
Expand Down
14 changes: 14 additions & 0 deletions app/code/community/UOL/PagSeguro/controllers/PaymentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,18 @@ public function defaultAction()
* @var \PagSeguro\Domains\Requests\DirectPayment\Boleto|\PagSeguro\Domains\Requests\DirectPayment\CreditCard|\PagSeguro\Domains\Requests\DirectPayment\OnlineDebit $result
*/
$link = $this->payment->paymentRegister($payment);
if ($link == false) {
throw new Exception('Can\'t generate PagSeguro payment url for lightbox checkout.');
}
$order->sendNewOrderEmail();
} catch (Exception $exception) {
\PagSeguro\Resources\Log\Logger::error($exception);
Mage::logException($exception);
$this->canceledStatus($order);
return Mage_Core_Controller_Varien_Action::_redirect(
'pagseguro/payment/error',
['_secure' => false]
);
}

return $this->loadAndRenderLayout([
Expand Down Expand Up @@ -239,11 +246,18 @@ public function lightboxAction()
* @var \PagSeguro\Domains\Requests\DirectPayment\Boleto|\PagSeguro\Domains\Requests\DirectPayment\CreditCard|\PagSeguro\Domains\Requests\DirectPayment\OnlineDebit $result
*/
$code = $this->payment->paymentRegister($payment, true);
if ($code == false) {
throw new Exception('Can\'t generate PagSeguro payment code for lightbox checkout.');
}
$order->sendNewOrderEmail();
} catch (Exception $exception) {
\PagSeguro\Resources\Log\Logger::error($exception);
Mage::logException($exception);
$this->canceledStatus($order);
return Mage_Core_Controller_Varien_Action::_redirect(
'pagseguro/payment/error',
['_secure' => false]
);
}

if ($this->library->getEnvironment() === 'production') {
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/UOL/PagSeguro/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ limitations under the License.
<config>
<modules>
<UOL_PagSeguro>
<version>3.16.0</version>
<version>3.16.1</version>
</UOL_PagSeguro>
</modules>
<global>
Expand Down

0 comments on commit 5941967

Please sign in to comment.