Com esta funcionalidade você poderá listar e cancelar transações que ainda estão nos status “Em análise” e “Aguardando Pagamento”. É aconselhável que antes de usar esta funcionalidade você faça a conciliação de suas transações para obter os status mais atuais.
Com esta funcionalidade você poderá listar as transações abandonadas durante o
3 | checkout PagSeguro e disparar, manualmente, um e-mail para seu comprador. Este e-mail
4 | conterá um link que o redirecionará para o fluxo de pagamento, exatamente no ponto onde
5 | ele parou.
Com esta funcionalidade você poderá listar as transações realizadas em um determinado intervalo de datas. Ela pode ser usada periodicamente para verificar se o seu sistema recebeu todas as notificações enviadas pelo PagSeguro e, consequentemente, manter o status de suas transações sempre atualizados.
Com esta funcionalidade você poderá listar as suas transações. Caso não encontre uma transação ou se o status de uma transação estiver desatualizado é aconselhável que você use a conciliação de transações.
3 |
Atenção: Toda transação estornada de forma parcial não tem seu status alterado. Por isso, ao filtrar por "Estornada Parcialmente" o pedido exibirá o seu status original.
4 |
--------------------------------------------------------------------------------
/view/frontend/layout/pagseguro_payment_failure.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/view/frontend/layout/pagseguro_direct_success.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/view/frontend/layout/pagseguro_payment_checkout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Policy
2 |
3 | ## Supported Versions
4 |
5 | Use this section to tell people about which versions of your project are
6 | currently being supported with security updates.
7 |
8 | | Version | Supported |
9 | | ------- | ------------------ |
10 | | 5.1.x | :white_check_mark: |
11 | | 5.0.x | :x: |
12 | | 4.0.x | :white_check_mark: |
13 | | < 4.0 | :x: |
14 |
15 | ## Reporting a Vulnerability
16 |
17 | Use this section to tell people how to report a vulnerability.
18 |
19 | Tell them where to go, how often they can expect to get an update on a
20 | reported vulnerability, what to expect if the vulnerability is accepted or
21 | declined, etc.
22 |
--------------------------------------------------------------------------------
/view/adminhtml/templates/refund/toolbar/buttons.phtml:
--------------------------------------------------------------------------------
1 |
Com esta funcionalidade você poderá estornar os valores de transações que estejam nos status “Paga”, “Disponível” e “Em disputa”. É aconselhável que antes de usar esta funcionalidade você faça a conciliação de suas transações para obter os status mais atuais.
3 |
4 | Atenção: Ao realizar um Estorno total a transação será estornada e terá seu status alterado no PagSeguro para
5 | "Devolvida". Ao realizar um Estorno parcial será estornado o valor inserido, contudo, o status da transação no PagSeguro não será
6 | alterado (a transação manterá o seu último status).
7 |
23 | Sua compra está em processo de finalização, aguarde um instante.
24 | Caso a página de finalização de pagamento não se inicie automaticamente, Clique Aqui
25 |
28 |
26 | Your order # {{var order.increment_id}} it's {{var order.getStatusLabel()}}, to make payment
27 | {{trans 'click here'}}.
28 |
29 |
30 | {{trans 'If you have questions about your order, you can email us at %store_email' store_email=$store_email |raw}}{{depend store_phone}} {{trans 'or call us at %store_phone' store_phone=$store_phone |raw}}{{/depend}}.
31 | {{depend store_hours}}
32 | {{trans 'Our hours are %store_hours.' store_hours=$store_hours |raw}}
33 | {{/depend}}
34 |
35 |
36 |
37 |
38 |
39 | {{template config_path="design/email/footer_template"}}
40 |
--------------------------------------------------------------------------------
/Helper/Abandoned.php:
--------------------------------------------------------------------------------
1 | _scopeConfig = $scopeConfigInterface;
46 | }
47 |
48 | /**
49 | * Check if is active abandoned service.
50 | *
51 | * @return mixed
52 | */
53 | public function isActive()
54 | {
55 | return $this->_scopeConfig->getValue('payment/pagseguro/abandoned_active');
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/view/frontend/web/js/view/payment/payment.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 2007-2016 [PagSeguro Internet Ltda.]
3 | *
4 | * NOTICE OF LICENSE
5 | *
6 | *Licensed under the Apache License, Version 2.0 (the "License");
7 | *you may not use this file except in compliance with the License.
8 | *You may obtain a copy of the License at
9 | *
10 | *http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | *Unless required by applicable law or agreed to in writing, software
13 | *distributed under the License is distributed on an "AS IS" BASIS,
14 | *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | *See the License for the specific language governing permissions and
16 | *limitations under the License.
17 | *
18 | * @author PagSeguro Internet Ltda.
19 | * @copyright 2016 PagSeguro Internet Ltda.
20 | * @license http://www.apache.org/licenses/LICENSE-2.0
21 | */
22 | /*
23 | * browser:true
24 | * global define
25 | */
26 | define([
27 | 'uiComponent',
28 | 'Magento_Checkout/js/model/payment/renderer-list',
29 | ], function (Component, rendererList) {
30 | 'use strict';
31 | rendererList.push(
32 | {
33 | type: 'pagseguro_default_lightbox',
34 | component:
35 | 'UOL_PagSeguro/js/view/payment/method-renderer/default_lightbox-method',
36 | },
37 | {
38 | type: 'pagseguro_credit_card',
39 | component:
40 | 'UOL_PagSeguro/js/view/payment/method-renderer/credit_card-method',
41 | },
42 | {
43 | type: 'pagseguro_boleto',
44 | component: 'UOL_PagSeguro/js/view/payment/method-renderer/boleto-method',
45 | },
46 | {
47 | type: 'pagseguro_online_debit',
48 | component:
49 | 'UOL_PagSeguro/js/view/payment/method-renderer/online_debit-method',
50 | }
51 | );
52 |
53 | return Component.extend({});
54 | });
55 |
--------------------------------------------------------------------------------
/etc/adminhtml/system/payment_boleto.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | UOL\PagSeguro\Model\System\Config\Yesno
8 | payment/pagseguro_boleto/active
9 |
10 |
11 |
12 | Informe o nome que deve ser apresentado para este meio de pagamento no checkout de sua loja.
13 | payment/pagseguro_boleto/title
14 |
15 | 1
16 |
17 | required-entry
18 |
19 |
20 |
21 | Irá aparecer depois de todos os meios de pagamento configurados na sua loja com valor menor e antes dos de valor maior.
22 | payment/pagseguro_boleto/sort_order
23 | validate-zero-or-greater
24 | 1
25 |
26 | 1
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/etc/adminhtml/system/payment_credit_card.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | UOL\PagSeguro\Model\System\Config\Yesno
8 | payment/pagseguro_credit_card/active
9 |
10 |
11 |
12 | Informe o nome que deve ser apresentado para este meio de pagamento no checkout de sua loja.
13 | payment/pagseguro_credit_card/title
14 |
15 | 1
16 |
17 | required-entry
18 |
19 |
20 |
21 | Irá aparecer depois de todos os meios de pagamento configurados na sua loja com valor menor e antes dos de valor maior.
22 | payment/pagseguro_credit_card/sort_order
23 | validate-zero-or-greater
24 | 1
25 |
26 | 1
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/etc/adminhtml/system/payment_online_debit.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | UOL\PagSeguro\Model\System\Config\Yesno
8 | payment/pagseguro_online_debit/active
9 |
10 |
11 |
12 | Informe o nome que deve ser apresentado para este meio de pagamento no checkout de sua loja.
13 | payment/pagseguro_online_debit/title
14 |
15 | 1
16 |
17 | required-entry
18 |
19 |
20 |
21 | Irá aparecer depois de todos os meios de pagamento configurados na sua loja com valor menor e antes dos de valor maior.
22 | payment/pagseguro_online_debit/sort_order
23 | validate-zero-or-greater
24 | 1
25 |
26 | 1
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/view/adminhtml/layout/pagseguro_abandoned_error.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | PagSeguro
5 |
6 |
7 |
8 |
9 |
10 |
11 |
14 |
15 |
16 |
19 |
20 |
21 |
24 |
25 |
26 |
29 |
30 |
31 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/.github/workflows/codacy-analysis.yml:
--------------------------------------------------------------------------------
1 | # This workflow checks out code, performs a Codacy security scan
2 | # and integrates the results with the
3 | # GitHub Advanced Security code scanning feature. For more information on
4 | # the Codacy security scan action usage and parameters, see
5 | # https://github.com/codacy/codacy-analysis-cli-action.
6 | # For more information on Codacy Analysis CLI in general, see
7 | # https://github.com/codacy/codacy-analysis-cli.
8 |
9 | name: Codacy Security Scan
10 |
11 | on:
12 | push:
13 | branches: [ master ]
14 | pull_request:
15 | branches: [ master ]
16 |
17 | jobs:
18 | codacy-security-scan:
19 | name: Codacy Security Scan
20 | runs-on: ubuntu-latest
21 | steps:
22 | # Checkout the repository to the GitHub Actions runner
23 | - name: Checkout code
24 | uses: actions/checkout@v2
25 |
26 | # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
27 | - name: Run Codacy Analysis CLI
28 | uses: codacy/codacy-analysis-cli-action@1.1.0
29 | with:
30 | # Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
31 | # You can also omit the token and run the tools that support default configurations
32 | project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
33 | verbose: true
34 | output: results.sarif
35 | format: sarif
36 | # Adjust severity of non-security issues
37 | gh-code-scanning-compat: true
38 | # Force 0 exit code to allow SARIF file generation
39 | # This will handover control about PR rejection to the GitHub side
40 | max-allowed-issues: 2147483647
41 |
42 | # Upload the SARIF file generated in the previous step
43 | - name: Upload SARIF results file
44 | uses: github/codeql-action/upload-sarif@v1
45 | with:
46 | sarif_file: results.sarif
--------------------------------------------------------------------------------
/view/adminhtml/ui_component/sales_order_grid.xml:
--------------------------------------------------------------------------------
1 |
2 |
25 |
26 |
27 |
28 |
29 |
30 | text
31 | Transaction Code
32 | 2
33 |
34 |
35 |
36 |
37 |
38 |
39 | text
40 | Environment
41 | 3
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/Controller/Payment/Direct.php:
--------------------------------------------------------------------------------
1 | _resultPageFactory = $resultPageFactory;
48 | }
49 |
50 | /**
51 | * Show payment page
52 | * @return \Magento\Framework\View\Result\PageFactory
53 | */
54 | public function execute()
55 | {
56 | /** @var \Magento\Framework\View\Result\PageFactory $resultPage */
57 | $resultPage = $this->_resultPageFactory->create();
58 | return $resultPage;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/Controller/Adminhtml/Abandoned/Error.php:
--------------------------------------------------------------------------------
1 | _resultPageFactory->create();
53 | $resultPage->getConfig()->getTitle()->prepend(__('Abandonadas'));
54 | return $resultPage;
55 | }
56 |
57 | /**
58 | * Abandoned access rights checking
59 | *
60 | * @return bool
61 | */
62 | protected function _isAllowed()
63 | {
64 | return $this->_authorization->isAllowed('UOL_PagSeguro::Abandoned');
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/Controller/Payment/Failure.php:
--------------------------------------------------------------------------------
1 | _resultPageFactory = $resultPageFactory;
51 | }
52 |
53 | /**
54 | * Show failure page
55 | *
56 | * @return \Magento\Framework\View\Result\PageFactory
57 | */
58 | public function execute()
59 | {
60 | /** @var \Magento\Framework\View\Result\PageFactory $resultPage*/
61 | $resultPage = $this->_resultPageFactory->create();
62 | return $resultPage;
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/Controller/Adminhtml/Credentials/Error.php:
--------------------------------------------------------------------------------
1 | _resultPageFactory->create();
53 | $resultPage->getConfig()->getTitle()->prepend(__('PagSeguro'));
54 | return $resultPage;
55 | }
56 |
57 | /**
58 | * Credentials access rights checking
59 | *
60 | * @return bool
61 | */
62 | protected function _isAllowed()
63 | {
64 | return $this->_authorization->isAllowed('UOL_PagSeguro::Credentials');
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/Model/Orders.php:
--------------------------------------------------------------------------------
1 | _init('UOL\PagSeguro\Model\ResourceModel\Orders');
65 | }
66 |
67 | /**
68 | * Get identities
69 | *
70 | * @return array
71 | */
72 | public function getIdentities()
73 | {
74 | return [self::CACHE_TAG . '_' . $this->getId(), self::CACHE_TAG . '_' . $this->getId()];
75 | }
76 |
77 | /**
78 | * Prepare item's statuses
79 | *
80 | * @return array
81 | */
82 | public function getAvailableStatuses()
83 | {
84 | return [self::STATUS_ENABLED => __('Enabled'), self::STATUS_DISABLED => __('Disabled')];
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | 1.12.0
2 |
3 | - Checkout sem endereço (para produtos do tipo 'virtual' e 'downloadable')
4 | - Habilitar/desabilitar recuperação de carrinho do PagSeguro via admin
5 | - Tela de listar transações no admin, permitindo ver detalhes da transação
6 | - Estorno parcial
7 | - Disconto por meio de pagamento via configuração do módulo (admin) para o checkout padrão/lightbox
8 | - Atualizada versão do pagseguro-php-sdk no composer.json para utilizar as versões 4.+
9 | - Adicionada compatibilidade com endereços de 4 linhas, no formato: 1 rua/endereço, 2 número, 3 complemento, 4 bairro (padrão brasileiro)
10 | - Valida se o telefone do comprador foi configurado antes de tentar usar o telefone do endereço de entrega
11 | - Fix: Corrigido id dos itens do pedido (carrinho) enviados para o PagSeguro
12 |
13 | 1.4.0
14 |
15 | - Alterado o fluxo do checkout transparente (na própria tela de checkout do Magento)
16 | - Alterada a forma de configurar o módulo e os meios de pagamento do PagSeguro, que agora são configurados individualmente.
17 | - Melhorias gerais e correções de bugs: transações do admin, css muito abrangente, remoção de arquivos velhos e desnecessários, refatorações.
18 |
19 | 1.3.0
20 |
21 | - Adicionada validação e mensagens de erro (frontend) nos formulários do checkout transparente
22 |
23 | 1.2.6
24 |
25 | - Melhoria na configuração do log na interface administrativa
26 | - Adicionada seção de atualização do módulo e atualização geral da documentação (README.md)
27 | - Correção de bugs quando o pedido deixava de existir ou a sessão era encerrada
28 | - Correçao para aceitar CVV de 4 digitos
29 | - Melhoria no acesso aos dados do endereço do cliente
30 |
31 | 1.2.1
32 |
33 | - Alterada a biblioteca JavaScript utilizada nas máscaras.
34 |
35 | 1.2.0
36 |
37 | - Adicionada opção para utilizar o Checkout Transparente.
38 |
39 | 1.1.0
40 |
41 | - Possibilidade de consultar e solicitar o cancelamento de transações;
42 | - Possibilidade de consultar e solicitar o estorno de transações;
43 | - Possibilidade de definir descontos com base no meio de pagamento escolhido durante o checkout PagSeguro;
44 |
45 | 1.0.0
46 |
47 | - Adicionando opção para utilização do Checkout Lightbox.
48 | - Integração com API de Notificação.
49 | - Integração com API de Pagamento do PagSeguro.
50 | - Configuração do Setup do módulo.
51 | - Adicionado meio de pagamento ao Magento2
52 | - Versão inicial.
53 |
--------------------------------------------------------------------------------
/.github/workflows/codeql-analysis.yml:
--------------------------------------------------------------------------------
1 | # For most projects, this workflow file will not need changing; you simply need
2 | # to commit it to your repository.
3 | #
4 | # You may wish to alter this file to override the set of languages analyzed,
5 | # or to provide custom queries or build logic.
6 | name: "CodeQL"
7 |
8 | on:
9 | push:
10 | branches: [master]
11 | pull_request:
12 | # The branches below must be a subset of the branches above
13 | branches: [master]
14 | schedule:
15 | - cron: '0 3 * * 4'
16 |
17 | jobs:
18 | analyze:
19 | name: Analyze
20 | runs-on: ubuntu-latest
21 |
22 | strategy:
23 | fail-fast: false
24 | matrix:
25 | # Override automatic language detection by changing the below list
26 | # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
27 | language: ['javascript']
28 | # Learn more...
29 | # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
30 |
31 | steps:
32 | - name: Checkout repository
33 | uses: actions/checkout@v2
34 |
35 | # Initializes the CodeQL tools for scanning.
36 | - name: Initialize CodeQL
37 | uses: github/codeql-action/init@v1
38 | with:
39 | languages: ${{ matrix.language }}
40 | # If you wish to specify custom queries, you can do so here or in a config file.
41 | # By default, queries listed here will override any specified in a config file.
42 | # Prefix the list here with "+" to use these queries and those in the config file.
43 | # queries: ./path/to/local/query, your-org/your-repo/queries@main
44 |
45 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
46 | # If this step fails, then you should remove it and run the build manually (see below)
47 | - name: Autobuild
48 | uses: github/codeql-action/autobuild@v1
49 |
50 | # ℹ️ Command-line programs to run using the OS shell.
51 | # 📚 https://git.io/JvXDl
52 |
53 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
54 | # and modify them (or add more) to build your code if your project
55 | # uses a compiled language
56 |
57 | #- run: |
58 | # make bootstrap
59 | # make release
60 |
61 | - name: Perform CodeQL Analysis
62 | uses: github/codeql-action/analyze@v1
63 |
--------------------------------------------------------------------------------
/etc/adminhtml/menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
25 |
26 |
35 |
36 |
--------------------------------------------------------------------------------
/Controller/Ajaxable.php:
--------------------------------------------------------------------------------
1 | _result = $resultJsonFactory->create();
44 | }
45 |
46 | /**
47 | * Return when success
48 | *
49 | * @param $response
50 | * @return \Magento\Framework\Controller\Result\Json
51 | */
52 | protected function whenSuccess($response)
53 | {
54 | return $this->_result->setData([
55 | 'success' => true,
56 | 'payload' => [
57 | 'data' => $response
58 | ]
59 | ]);
60 | }
61 |
62 | /**
63 | * Return when fails
64 | *
65 | * @param $message
66 | * @return \Magento\Framework\Controller\Result\Json
67 | */
68 | protected function whenError($message)
69 | {
70 | return $this->_result->setData([
71 | 'success' => false,
72 | 'payload' => [
73 | 'error' => $message,
74 | ]
75 | ]);
76 | }
77 | }
--------------------------------------------------------------------------------
/Controller/Pageable.php:
--------------------------------------------------------------------------------
1 | _resultPageFactory = $resultPageFactory;
45 | }
46 |
47 | /**
48 | * Generate Admin Url
49 | *
50 | * @return string
51 | */
52 | protected function getAdminUrl()
53 | {
54 | return sprintf("%s%s",$this->getBaseUrl(), $this->getAdminSuffix());
55 | }
56 |
57 | /**
58 | * Get admin suffix from config
59 | *
60 | * @return string
61 | */
62 | private function getAdminSuffix()
63 | {
64 | $configReader = $this->_objectManager->create('Magento\Framework\App\DeploymentConfig\Reader');
65 | $config = $configReader->load();
66 | return $config['backend']['frontName'];
67 | }
68 |
69 | /**
70 | * Get store base url
71 | *
72 | * @return string
73 | */
74 | private function getBaseUrl()
75 | {
76 | $storeManager = $this->_objectManager->create('Magento\Store\Model\StoreManagerInterface');
77 | return $storeManager->getStore()->getBaseUrl();
78 | }
79 | }
--------------------------------------------------------------------------------
/Helper/Crypt.php:
--------------------------------------------------------------------------------
1 | _scopeConfig = $scopeConfigInterface;
46 | }
47 |
48 | /**
49 | * Encrypt data
50 | *
51 | * @param $password
52 | * @param $data
53 | * @return string
54 | */
55 | public function encrypt($password, $data)
56 | {
57 | $salt = substr(md5(mt_rand(), true), 8);
58 | $key = md5($password . $salt, true);
59 | $iv = md5($key . $password . $salt, true);
60 | $ct = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $data, MCRYPT_MODE_CBC, $iv);
61 | return base64_encode('Salted__' . $salt . $ct);
62 | }
63 |
64 | /**
65 | * Decrypt data
66 | *
67 | * @param $password
68 | * @param $data
69 | * @return string
70 | */
71 | public function decrypt($password, $data)
72 | {
73 | $data = base64_decode($data);
74 | $salt = substr($data, 8, 8);
75 | $ct = substr($data, 16);
76 | $key = md5($password . $salt, true);
77 | $iv = md5($key . $password . $salt, true);
78 | $pt = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, $ct, MCRYPT_MODE_CBC, $iv);
79 | return $pt;
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/Controller/Adminhtml/Refund/Index.php:
--------------------------------------------------------------------------------
1 | _objectManager->create('UOL\PagSeguro\Helper\Auth');
53 |
54 | /** Check for credentials **/
55 | if (!$authHelper->hasCredentials())
56 | return $this->_redirect('pagseguro/credentials/error');
57 |
58 | /** @var \Magento\Backend\Model\View\Result\Page $resultPage */
59 | $resultPage = $this->_resultPageFactory->create();
60 | $resultPage->getConfig()->getTitle()->prepend(__('Estorno'));
61 | $resultPage->getLayout()->getBlock('adminhtml.block.pagseguro.refund.content')->setData('adminurl', $this->getAdminUrl());
62 | return $resultPage;
63 | }
64 |
65 | /**
66 | * Refund access rights checking
67 | *
68 | * @return bool
69 | */
70 | protected function _isAllowed()
71 | {
72 | return $this->_authorization->isAllowed('UOL_PagSeguro::Refund');
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/Controller/Adminhtml/Cancellation/Index.php:
--------------------------------------------------------------------------------
1 | _objectManager->create('UOL\PagSeguro\Helper\Auth');
52 |
53 | /** Check for credentials **/
54 | if (!$authHelper->hasCredentials())
55 | return $this->_redirect('pagseguro/credentials/error');
56 |
57 | /** @var \Magento\Backend\Model\View\Result\Page $resultPage */
58 | $resultPage = $this->_resultPageFactory->create();
59 | $resultPage->getConfig()->getTitle()->prepend(__('Cancelamento'));
60 | $resultPage->getLayout()->getBlock('adminhtml.block.pagseguro.cancellation.content')->setData('adminurl', $this->getAdminUrl());
61 | return $resultPage;
62 | }
63 |
64 | /**
65 | * Cancellation access rights checking
66 | *
67 | * @return bool
68 | */
69 | protected function _isAllowed()
70 | {
71 | return $this->_authorization->isAllowed('UOL_PagSeguro::Cancellation');
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/Controller/Adminhtml/Conciliation/Index.php:
--------------------------------------------------------------------------------
1 | _objectManager->create('UOL\PagSeguro\Helper\Auth');
53 |
54 | /** Check for credentials **/
55 | if (!$authHelper->hasCredentials())
56 | return $this->_redirect('pagseguro/credentials/error');
57 |
58 | /** @var \Magento\Backend\Model\View\Result\Page $resultPage */
59 | $resultPage = $this->_resultPageFactory->create();
60 | $resultPage->getConfig()->getTitle()->prepend(__('Conciliação'));
61 | $resultPage->getLayout()->getBlock('adminhtml.block.pagseguro.conciliation.content')->setData('adminurl', $this->getAdminUrl());
62 | return $resultPage;
63 | }
64 |
65 | /**
66 | * Conciliation access rights checking
67 | *
68 | * @return bool
69 | */
70 | protected function _isAllowed()
71 | {
72 | return $this->_authorization->isAllowed('UOL_PagSeguro::Conciliation');
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/Controller/Adminhtml/Transactions/Index.php:
--------------------------------------------------------------------------------
1 | _objectManager->create('UOL\PagSeguro\Helper\Auth');
52 |
53 | /** Check for credentials **/
54 | if (!$authHelper->hasCredentials())
55 | return $this->_redirect('pagseguro/credentials/error');
56 |
57 | /** @var \Magento\Backend\Model\View\Result\Page $resultPage */
58 | $resultPage = $this->_resultPageFactory->create();
59 | $resultPage->getConfig()->getTitle()->prepend(__('Listar transações'));
60 | $resultPage->getLayout()->getBlock('adminhtml.block.pagseguro.transactions.content')->setData('adminurl', $this->getAdminUrl());
61 | return $resultPage;
62 | }
63 |
64 | /**
65 | * Cancellation access rights checking
66 | *
67 | * @return bool
68 | */
69 | protected function _isAllowed()
70 | {
71 | return $this->_authorization->isAllowed('UOL_PagSeguro::Transactions');
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/Controller/Adminhtml/Transactions/Transaction.php:
--------------------------------------------------------------------------------
1 | transactionsFactory = $transactionsFactory;
48 | parent::__construct($context, $resultJsonFactory);
49 | }
50 |
51 | /**
52 | * @return \Magento\Framework\Controller\Result\Json
53 | */
54 | public function execute()
55 | {
56 | $transactions = $this->transactionsFactory->create();
57 |
58 | try {
59 | return $this->whenSuccess(
60 | $transactions->execute(
61 | $this->getRequest()->getParam('transaction') )
62 | );
63 | } catch (\Exception $exception) {
64 | return $this->whenError($exception->getMessage());
65 | }
66 | }
67 |
68 | /**
69 | * Transactions access rights checking
70 | *
71 | * @return bool
72 | */
73 | protected function _isAllowed()
74 | {
75 | return $this->_authorization->isAllowed('UOL_PagSeguro::Transactions');
76 | }
77 | }
--------------------------------------------------------------------------------
/view/frontend/templates/success.phtml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
14 |