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

Change direct payment flow #88

Merged
merged 29 commits into from
Dec 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9053b28
Add variable resource
May 23, 2017
5b4f511
Add variable resource
May 23, 2017
d4b2638
Merge remote-tracking branch 'upstream/desenvolvimento' into desenvol…
May 23, 2017
7b4e959
Bug fixes in refund, cancellation, abandonment and conciliation
May 23, 2017
6173c03
Delete .idea
May 23, 2017
0c76442
Merge pull request #60 from vlfreitas/desenvolvimento
s2it-moscou May 25, 2017
30cb0db
Correction of methods
May 30, 2017
a885d94
Merge pull request #61 from vlfreitas/desenvolvimento
s2it-moscou May 31, 2017
157dc77
Correction of title problem at the time of payment completion
May 31, 2017
982ee4e
Merge pull request #62 from vlfreitas/desenvolvimento
s2it-moscou Jun 2, 2017
203ce9f
Added status cancellation lightbox
Jun 13, 2017
13e3e42
Add redirect cancel controller
Jun 13, 2017
04db289
Merge pull request #66 from vlfreitas/desenvolvimento
s2it-moscou Jun 16, 2017
a87bdc5
refactor: created, updated and deleted files to change direct payment…
gabriellucius Sep 26, 2017
c3224a9
feature: add sort order value to payment methods
gabriellucius Sep 29, 2017
2d0755c
feature: add pagseguro boleto payment to magento checkout page
gabriellucius Nov 25, 2017
e1f3d82
feature: add pagseguro online debit payment to magento checkout page
gabriellucius Nov 25, 2017
43d2307
add: validation to boleto document field
gabriellucius Nov 25, 2017
f8942dc
add: validation before place order in boleto and online debit payment
gabriellucius Nov 26, 2017
a707d03
refactor: pagseguro default/lightbox payment
gabriellucius Nov 26, 2017
741dd99
added credit card form inputs: credit card (cc) number, cc holder nam…
gabriellucius Nov 30, 2017
0db4532
feature: add pagseguro credit card payment method in magento default …
gabriellucius Nov 30, 2017
e21ca57
refactor: removed unused code from direct payment method forms and ad…
gabriellucius Dec 1, 2017
7c6fbeb
fix: bug when copy and paste a document in direct payment sometimes n…
gabriellucius Dec 10, 2017
b33587c
feature: create pagseguro credit card token only before place order, …
gabriellucius Dec 12, 2017
f87859e
Merge pull request #86 from gabriellucius/direct-payment-new-flow
s2it-moscou Dec 15, 2017
5866f67
fix: admin acl rules
gabriellucius Dec 19, 2017
ea01731
Merge pull request #87 from gabriellucius/desenvolvimento
s2it-moscou Dec 20, 2017
1ab1129
Update README.md
s2it-moscou Dec 26, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Controller/Adminhtml/Cancellation/Cancel.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function execute()
{
$cancellation = new Cancellation(
$this->_objectManager->create('Magento\Framework\App\Config\ScopeConfigInterface'),
$this->_objectManager->create('Magento\Framework\App\ResourceConnection'),
$this->_objectManager->create('\Magento\Framework\App\ResourceConnection'),
$this->_objectManager->create('Magento\Framework\Model\ResourceModel\Db\Context'),
$this->_objectManager->create('Magento\Backend\Model\Session'),
$this->_objectManager->create('Magento\Sales\Model\Order'),
Expand Down
16 changes: 8 additions & 8 deletions Controller/Adminhtml/Cancellation/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ public function __construct(
public function execute()
{
$cancellation = new Cancellation(
$this->_objectManager->create('Magento\Framework\App\Config\ScopeConfigInterface'),
$this->_objectManager->create('Magento\Framework\App\ResourceConnection'),
$this->_objectManager->create('Magento\Framework\Model\ResourceModel\Db\Context'),
$this->_objectManager->create('Magento\Backend\Model\Session'),
$this->_objectManager->create('Magento\Sales\Model\Order'),
$this->_objectManager->create('UOL\PagSeguro\Helper\Library'),
$this->_objectManager->create('UOL\PagSeguro\Helper\Crypt'),
$this->getRequest()->getParam('days')
$this->_objectManager->create('Magento\Framework\App\Config\ScopeConfigInterface'),
$this->_objectManager->create('\Magento\Framework\App\ResourceConnection'),
$this->_objectManager->create('Magento\Framework\Model\ResourceModel\Db\Context'),
$this->_objectManager->create('Magento\Backend\Model\Session'),
$this->_objectManager->create('Magento\Sales\Model\Order'),
$this->_objectManager->create('UOL\PagSeguro\Helper\Library'),
$this->_objectManager->create('UOL\PagSeguro\Helper\Crypt'),
$this->getRequest()->getParam('days')
);

try {
Expand Down
14 changes: 7 additions & 7 deletions Controller/Adminhtml/Conciliation/Conciliate.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ public function __construct(
public function execute()
{
$conciliation = new Conciliation(
$this->_objectManager->create('Magento\Framework\App\Config\ScopeConfigInterface'),
$this->_objectManager->create('Magento\Framework\App\ResourceConnection'),
$this->_objectManager->create('Magento\Framework\Model\ResourceModel\Db\Context'),
$this->_objectManager->create('Magento\Backend\Model\Session'),
$this->_objectManager->create('Magento\Sales\Model\Order'),
$this->_objectManager->create('UOL\PagSeguro\Helper\Library'),
$this->_objectManager->create('UOL\PagSeguro\Helper\Crypt')
$this->_objectManager->create('Magento\Framework\App\Config\ScopeConfigInterface'),
$this->_objectManager->create('\Magento\Framework\App\ResourceConnection'),
$this->_objectManager->create('Magento\Framework\Model\ResourceModel\Db\Context'),
$this->_objectManager->create('Magento\Backend\Model\Session'),
$this->_objectManager->create('Magento\Sales\Model\Order'),
$this->_objectManager->create('UOL\PagSeguro\Helper\Library'),
$this->_objectManager->create('UOL\PagSeguro\Helper\Crypt')
);

try {
Expand Down
16 changes: 8 additions & 8 deletions Controller/Adminhtml/Conciliation/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ public function __construct(
public function execute()
{
$conciliation = new Conciliation(
$this->_objectManager->create('Magento\Framework\App\Config\ScopeConfigInterface'),
$this->_objectManager->create('Magento\Framework\App\ResourceConnection'),
$this->_objectManager->create('Magento\Framework\Model\ResourceModel\Db\Context'),
$this->_objectManager->create('Magento\Backend\Model\Session'),
$this->_objectManager->create('Magento\Sales\Model\Order'),
$this->_objectManager->create('UOL\PagSeguro\Helper\Library'),
$this->_objectManager->create('UOL\PagSeguro\Helper\Crypt'),
$this->getRequest()->getParam('days')
$this->_objectManager->create('Magento\Framework\App\Config\ScopeConfigInterface'),
$this->_objectManager->create('\Magento\Framework\App\ResourceConnection'),
$this->_objectManager->create('Magento\Framework\Model\ResourceModel\Db\Context'),
$this->_objectManager->create('Magento\Backend\Model\Session'),
$this->_objectManager->create('Magento\Sales\Model\Order'),
$this->_objectManager->create('UOL\PagSeguro\Helper\Library'),
$this->_objectManager->create('UOL\PagSeguro\Helper\Crypt'),
$this->getRequest()->getParam('days')
);
try {
return $this->whenSuccess($conciliation->request());
Expand Down
16 changes: 8 additions & 8 deletions Controller/Adminhtml/Refund/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ public function __construct(
public function execute()
{
$refund = new Methods\Refund(
$this->_objectManager->create('Magento\Framework\App\Config\ScopeConfigInterface'),
$this->_objectManager->create('Magento\Framework\App\ResourceConnection'),
$this->_objectManager->create('Magento\Framework\Model\ResourceModel\Db\Context'),
$this->_objectManager->create('Magento\Backend\Model\Session'),
$this->_objectManager->create('Magento\Sales\Model\Order'),
$this->_objectManager->create('UOL\PagSeguro\Helper\Library'),
$this->_objectManager->create('UOL\PagSeguro\Helper\Crypt'),
$this->getRequest()->getParam('days')
$this->_objectManager->create('Magento\Framework\App\Config\ScopeConfigInterface'),
$this->_objectManager->create('Magento\Framework\App\ResourceConnection'),
$this->_objectManager->create('Magento\Framework\Model\ResourceModel\Db\Context'),
$this->_objectManager->create('Magento\Backend\Model\Session'),
$this->_objectManager->create('Magento\Sales\Model\Order'),
$this->_objectManager->create('UOL\PagSeguro\Helper\Library'),
$this->_objectManager->create('UOL\PagSeguro\Helper\Crypt'),
$this->getRequest()->getParam('days')
);

try {
Expand Down
4 changes: 2 additions & 2 deletions Controller/Direct/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
use UOL\PagSeguro\Model\PaymentMethod;

/**
* Class Checkout
* @package UOL\PagSeguro\Controller\Payment
* Class Payment
* @package UOL\PagSeguro\Controller\Direct\Payment
*/
class Payment extends \Magento\Framework\App\Action\Action
{
Expand Down
85 changes: 85 additions & 0 deletions Controller/Payment/Cancel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?php
/**
* 2007-2017 [PagSeguro Internet Ltda.]
*
* NOTICE OF LICENSE
*
*Licensed under the Apache License, Version 2.0 (the "License");
*you may not use this file except in compliance with the License.
*You may obtain a copy of the License at
*
*http://www.apache.org/licenses/LICENSE-2.0
*
*Unless required by applicable law or agreed to in writing, software
*distributed under the License is distributed on an "AS IS" BASIS,
*WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*See the License for the specific language governing permissions and
*limitations under the License.
*
* @author PagSeguro Internet Ltda.
* @copyright 2017 PagSeguro Internet Ltda.
* @license http://www.apache.org/licenses/LICENSE-2.0
*/

namespace UOL\PagSeguro\Controller\Payment;

use UOL\PagSeguro\Model\PaymentMethod;

/**
* Class Checkout
* @package UOL\PagSeguro\Controller\Payment
*/
class Cancel extends \Magento\Framework\App\Action\Action
{
/**
* @var \Magento\Framework\View\Result\PageFactory
*/
protected $_resultPageFactory;

/**
* @var \Magento\Sales\Model\OrderFactory
*/
protected $_orderFactory;
/**
* @var \Magento\Checkout\Model\Session
*/
protected $_checkoutSession;

/**
* Checkout constructor.
*
* @param \Magento\Framework\App\Action\Context $context
* @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
*/
public function __construct(
\Magento\Framework\App\Action\Context $context,
\Magento\Framework\View\Result\PageFactory $resultPageFactory
) {
parent::__construct($context);
/** @var \Magento\Framework\View\Result\PageFactory _resultPageFactory*/
$this->_resultPageFactory = $resultPageFactory;

}
/**
* Show cancel page
*
* @return \Magento\Framework\View\Result\PageFactory
*/
public function execute()
{

$this->_orderFactory = $this->_objectManager->get('\Magento\Sales\Model\OrderFactory');
$this->_checkoutSession = $this->_objectManager->get('\Magento\Checkout\Model\Session');
/** @var \Magento\Sales\Model\Order $order */
$order = $this->_objectManager->create('\Magento\Sales\Model\Order')->load(
$this->_checkoutSession->getLastRealOrderId());

/** change payment status in magento */
$order->addStatusToHistory('pagseguro_cancelada', null, true);
/** save order */
$order->save();

return $this->_redirect('/');

}
}
1 change: 0 additions & 1 deletion Controller/Payment/Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public function __construct(
public function execute()
{
$result = $this->payment->createPaymentRequest();

$resultPage = $this->resultPageFactory->create();
$code = $result->getCode();
$resultPage->getLayout()->getBlock('pagseguro.payment.checkout')
Expand Down
Loading