Skip to content

Commit 8fad5fc

Browse files
authored
Merge branch 'master' into bugfix/fixed-timezone-scheduled-promotions
2 parents 0a9a40c + fa184c5 commit 8fad5fc

14 files changed

+117
-171
lines changed

Api/CustomerCreateManagementInterface.php

-14
This file was deleted.

Concrete/integrityData

+1-1
Large diffs are not rendered by default.

Controller/Adminhtml/Plans/Create.php

100644100755
+3-30
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,12 @@
22

33
namespace MundiPagg\MundiPagg\Controller\Adminhtml\Plans;
44

5-
use Magento\Backend\App\Action;
6-
use Magento\Backend\App\Action\Context;
7-
use Magento\Framework\Registry;
8-
use Magento\Framework\View\Result\PageFactory;
5+
use MundiPagg\MundiPagg\Controller\Adminhtml\Plans\PlanAction;
96
use Mundipagg\Core\Recurrence\Aggregates\Plan;
10-
use Mundipagg\Core\Recurrence\Repositories\PlanRepository;
117
use Mundipagg\Core\Recurrence\Services\PlanService;
128

13-
class Create extends Action
9+
class Create extends PlanAction
1410
{
15-
protected $resultPageFactory = false;
16-
/**
17-
* @var ProductsPlanFactory
18-
*/
19-
private $productsPlanFactory;
20-
21-
/**
22-
* Constructor
23-
*
24-
* @param Context $context
25-
* @param PageFactory $resultPageFactory
26-
* @param Registry $coreRegistry
27-
*/
28-
public function __construct(
29-
Context $context,
30-
PageFactory $resultPageFactory,
31-
Registry $coreRegistry
32-
) {
33-
parent::__construct($context);
34-
$this->resultPageFactory = $resultPageFactory;
35-
$this->coreRegistry = $coreRegistry;
36-
}
37-
3811
/**
3912
* Index action
4013
*
@@ -43,7 +16,7 @@ public function __construct(
4316
public function execute()
4417
{
4518
$planId = (int) $this->getRequest()->getParam('id');
46-
if($planId) {
19+
if ($planId) {
4720
//@todo this should be a product plan core object
4821
$planService = new PlanService();
4922
$planData = $planService->findById($planId);

Controller/Adminhtml/Plans/Delete.php

100644100755
+2-38
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,11 @@
22

33
namespace MundiPagg\MundiPagg\Controller\Adminhtml\Plans;
44

5-
use Magento\Backend\App\Action;
6-
use Magento\Backend\App\Action\Context;
7-
use Magento\Framework\Message\Factory;
8-
use Magento\Framework\Registry;
9-
use Magento\Framework\View\Result\PageFactory;
5+
use MundiPagg\MundiPagg\Controller\Adminhtml\Plans\PlanAction;
106
use Mundipagg\Core\Recurrence\Services\PlanService;
11-
use Mundipagg\Core\Recurrence\Services\ProductSubscriptionService;
12-
use MundiPagg\MundiPagg\Concrete\Magento2CoreSetup;
13-
use MundiPagg\MundiPagg\Model\ProductsSubscriptionFactory;
147

15-
class Delete extends Action
8+
class Delete extends PlanAction
169
{
17-
protected $resultPageFactory;
18-
19-
/**
20-
* @var Registry
21-
*/
22-
protected $coreRegistry;
23-
24-
/**
25-
* Constructor
26-
*
27-
* @param \Magento\Backend\App\Action\Context $context
28-
* @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
29-
* @throws \Exception
30-
*/
31-
public function __construct(
32-
\Magento\Backend\App\Action\Context $context,
33-
\Magento\Framework\View\Result\PageFactory $resultPageFactory,
34-
Registry $coreRegistry,
35-
Factory $messageFactory
36-
)
37-
{
38-
$this->resultPageFactory = $resultPageFactory;
39-
$this->coreRegistry = $coreRegistry;
40-
$this->messageFactory = $messageFactory;
41-
Magento2CoreSetup::bootstrap();
42-
43-
parent::__construct($context);
44-
}
45-
4610
/**
4711
* Index action
4812
*

Controller/Adminhtml/Plans/Index.php

100644100755
+3-21
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,10 @@
22

33
namespace MundiPagg\MundiPagg\Controller\Adminhtml\Plans;
44

5-
use Magento\Backend\App\Action;
6-
use Magento\Backend\App\Action\Context;
7-
use Magento\Framework\View\Result\PageFactory;
5+
use MundiPagg\MundiPagg\Controller\Adminhtml\Plans\PlanAction;
86

9-
class Index extends Action
7+
class Index extends PlanAction
108
{
11-
protected $resultPageFactory = false;
12-
13-
/**
14-
* Constructor
15-
*
16-
* @param Context $context
17-
* @param PageFactory $resultPageFactory
18-
*/
19-
public function __construct(
20-
Context $context,
21-
PageFactory $resultPageFactory
22-
) {
23-
$this->resultPageFactory = $resultPageFactory;
24-
parent::__construct($context);
25-
}
26-
279
/**
2810
* Index action
2911
*
@@ -33,7 +15,7 @@ public function execute()
3315
{
3416
$resultPage = $this->resultPageFactory->create();
3517
$resultPage->getConfig()->getTitle()->prepend(__("Plans"));
36-
18+
3719
return $resultPage;
3820
}
3921
}
+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?php
2+
3+
namespace MundiPagg\MundiPagg\Controller\Adminhtml\Plans;
4+
5+
use Magento\Backend\App\Action;
6+
use Magento\Backend\App\Action\Context;
7+
use Magento\Framework\Registry;
8+
use Magento\Framework\View\Result\PageFactory;
9+
use Magento\Framework\Controller\Result\JsonFactory;
10+
use MundiPagg\MundiPagg\Concrete\Magento2CoreSetup;
11+
use Magento\Framework\Message\Factory;
12+
use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory;
13+
use MundiPagg\MundiPagg\Helper\ProductHelper;
14+
use Magento\Store\Model\StoreManagerInterface;
15+
16+
class PlanAction extends Action
17+
{
18+
19+
protected $resultPageFactory = false;
20+
/**
21+
* @var CollectionFactory
22+
*/
23+
protected $productCollectionFactory;
24+
/**
25+
* @var JsonFactory
26+
*/
27+
protected $resultJsonFactory;
28+
/**
29+
* @var ProductHelper
30+
*/
31+
protected $productHelper;
32+
/**
33+
* @var Registry
34+
*/
35+
protected $coreRegistry;
36+
/**
37+
* @var Factory
38+
*/
39+
protected $messageFactory;
40+
41+
42+
/**
43+
* Constructor
44+
*
45+
* @param Context $context
46+
* @param PageFactory $resultPageFactory
47+
* @param Registry $coreRegistry
48+
*/
49+
public function __construct(
50+
Context $context,
51+
PageFactory $resultPageFactory,
52+
Registry $coreRegistry,
53+
Factory $messageFactory,
54+
CollectionFactory $productCollectionFactory,
55+
JsonFactory $resultJsonFactory,
56+
ProductHelper $productHelper,
57+
StoreManagerInterface $storeManager
58+
) {
59+
parent::__construct($context);
60+
61+
$this->resultPageFactory = $resultPageFactory;
62+
$this->coreRegistry = $coreRegistry;
63+
$this->messageFactory = $messageFactory;
64+
$this->productHelper = $productHelper;
65+
$this->productCollectionFactory = $productCollectionFactory;
66+
$this->resultJsonFactory = $resultJsonFactory;
67+
$this->storeManager = $storeManager;
68+
69+
$this->bootstrapDefaultStoreConfigurations();
70+
}
71+
72+
/**
73+
* @return \Magento\Framework\Controller\ResultInterface
74+
*/
75+
public function execute()
76+
{
77+
}
78+
79+
private function bootstrapDefaultStoreConfigurations()
80+
{
81+
$defaultStoreId = Magento2CoreSetup::getDefaultStoreId();
82+
$this->storeManager->setCurrentStore($defaultStoreId);
83+
84+
Magento2CoreSetup::bootstrap();
85+
}
86+
}

Controller/Adminhtml/Plans/SearchProduct.php

100644100755
+5-47
Original file line numberDiff line numberDiff line change
@@ -2,59 +2,17 @@
22

33
namespace MundiPagg\MundiPagg\Controller\Adminhtml\Plans;
44

5-
use Magento\Backend\App\Action;
6-
use Magento\Backend\App\Action\Context;
7-
use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory;
5+
6+
use MundiPagg\MundiPagg\Controller\Adminhtml\Plans\PlanAction;
87
use Magento\Framework\App\ObjectManager;
9-
use Magento\Framework\Controller\Result\JsonFactory;
10-
use Magento\Framework\View\Result\PageFactory;
118
use Mundipagg\Core\Kernel\Services\MoneyService;
129
use Mundipagg\Core\Recurrence\Aggregates\Plan;
1310
use Mundipagg\Core\Recurrence\Aggregates\ProductSubscription;
1411
use Mundipagg\Core\Recurrence\Services\PlanService;
1512
use Mundipagg\Core\Recurrence\Services\ProductSubscriptionService;
16-
use MundiPagg\MundiPagg\Concrete\Magento2CoreSetup;
17-
use MundiPagg\MundiPagg\Helper\ProductHelper;
1813

19-
class SearchProduct extends Action
14+
class SearchProduct extends PlanAction
2015
{
21-
protected $resultPageFactory = false;
22-
/**
23-
* @var CollectionFactory
24-
*/
25-
protected $productCollectionFactory;
26-
/**
27-
* @var JsonFactory
28-
*/
29-
protected $resultJsonFactory;
30-
/**
31-
* @var ProductHelper
32-
*/
33-
protected $productHelper;
34-
35-
/**
36-
* Constructor
37-
*
38-
* @param Context $context
39-
* @param PageFactory $resultPageFactory
40-
* @param CollectionFactory $productCollectionFactory
41-
* @param JsonFactory $resultJsonFactory
42-
*/
43-
public function __construct(
44-
Context $context,
45-
PageFactory $resultPageFactory,
46-
CollectionFactory $productCollectionFactory,
47-
JsonFactory $resultJsonFactory,
48-
ProductHelper $productHelper
49-
) {
50-
parent::__construct($context);
51-
$this->resultPageFactory = $resultPageFactory;
52-
$this->productCollectionFactory = $productCollectionFactory;
53-
$this->resultJsonFactory = $resultJsonFactory;
54-
$this->productHelper = $productHelper;
55-
Magento2CoreSetup::bootstrap();
56-
}
57-
5816
/**
5917
* Index action
6018
*
@@ -72,7 +30,7 @@ public function execute()
7230
$product = $objectManager->get('\Magento\Catalog\Model\Product')
7331
->load($productId);
7432

75-
if (empty($product) ) {
33+
if (empty($product)) {
7634
return;
7735
}
7836

@@ -229,4 +187,4 @@ public function getRecurrenceService($recurrenceType)
229187
}
230188
return new ProductSubscriptionService();
231189
}
232-
}
190+
}

Model/Api/ProductsPlan.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ class ProductsPlan implements ProductPlanApiInterface
2727

2828
public function __construct(Request $request)
2929
{
30+
Magento2CoreSetup::bootstrap();
3031
$this->request = $request;
3132
$this->planService = new PlanService();
32-
Magento2CoreSetup::bootstrap();
3333
}
3434

3535
/**

Observer/AdminCustomerBeforeSave.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function execute(EventObserver $observer)
5151
$customerService->updateCustomerAtMundipagg($platformCustomer);
5252
} catch (\Exception $exception) {
5353
$log = new LogService('CustomerService');
54-
$log->info($exception->getMessage());
54+
$log->info($exception->getResponseBody());
5555

5656
if ($exception->getCode() == 404) {
5757
$log->info(

README.md

+12-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
[![CircleCI](https://circleci.com/gh/mundipagg/magento2/tree/master.svg?style=shield)](https://circleci.com/gh/mundipagg/magento2/tree/master)
2-
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/2213fc1ce8f14e7bb0861f232a310233)](https://www.codacy.com/app/mundipagg/magento2?utm_source=github.com&utm_medium=referral&utm_content=mundipagg/magento2&utm_campaign=badger)
3-
[![Maintainability](https://api.codeclimate.com/v1/badges/e279af4b87b47e56723a/maintainability)](https://codeclimate.com/github/mundipagg/magento2/maintainability)
4-
[![Latest Stable Version](https://poser.pugx.org/mundipagg/mundipagg-magento2-module/v/stable)](https://packagist.org/packages/mundipagg/mundipagg-magento2-module)
5-
[![Total Downloads](https://poser.pugx.org/mundipagg/mundipagg-magento2-module/downloads)](https://packagist.org/packages/mundipagg/mundipagg-magento2-module)
1+
### DEPRECATED | CHECK NEW VERSION > https://github.com/pagarme/magento2
2+
3+
# Mundipagg agora é Pagar.me
4+
5+
Buscando trazer a melhor experiência para os nossos clientes, a Mundipagg agora é parte do Pagar.me.
6+
7+
Somamos nossas funcionalidades e agora você tem acesso a uma plataforma financeira completa, que oferece o melhor das duas soluções em uma experiência unificada.
8+
9+
Você pode customizar nossos produtos e serviços da forma que for melhor para o seu e-commerce. Ficou curioso para saber o que muda? Preparamos um FAQ completo explicando tudo.
10+
11+
[Saiba mais](https://mundipagg.zendesk.com/hc/pt-br/categories/4404432249876-Incorpora%C3%A7%C3%A3o-Mundipagg-pelo-Pagar-me)
12+
613

714
# Magento2/Mundipagg Integration module
815
This is the official Magento2 module for Mundipagg integration

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "mundipagg/mundipagg-magento2-module",
33
"license": "MIT",
4-
"version": "2.11.0",
4+
"version": "2.11.4",
55
"type": "magento2-module",
66
"description": "Magento 2 Module Mundipagg",
77
"require": {
88
"php": ">=5.6.0",
99
"mundipagg/mundiapi": "^3.0",
10-
"mundipagg/ecommerce-module-core": "2.8.5"
10+
"mundipagg/ecommerce-module-core": "2.8.7"
1111
},
1212
"require-dev": {
1313
"phpunit/phpunit": "4.1.0",

etc/di.xml

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
<preference for="MundiPagg\MundiPagg\Api\WebhookManagementInterface" type="MundiPagg\MundiPagg\Model\WebhookManagement"/>
2828
<preference for="MundiPagg\MundiPagg\Api\InstallmentsByBrandManagementInterface" type="MundiPagg\MundiPagg\Model\InstallmentsByBrandManagement"/>
2929
<preference for="MundiPagg\MundiPagg\Api\InstallmentsByBrandAndAmountManagementInterface" type="MundiPagg\MundiPagg\Model\InstallmentsByBrandAndAmountManagement"/>
30-
<preference for="MundiPagg\MundiPagg\Api\CustomerCreateManagementInterface" type="MundiPagg\MundiPagg\Model\CustomerCreateManagement" />
3130

3231
<preference for="MundiPagg\MundiPagg\Api\MaintenanceInterface"
3332
type="MundiPagg\MundiPagg\Model\Maintenance"/>

etc/module.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010
-->
1111
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
12-
<module name="MundiPagg_MundiPagg" setup_version="2.11.0">
12+
<module name="MundiPagg_MundiPagg" setup_version="2.11.4">
1313
<sequence>
1414
<module name="Magento_Sales" />
1515
<module name="Magento_Payment" />

0 commit comments

Comments
 (0)