diff --git a/Controller/Customer/Remove.php b/Controller/Customer/Remove.php index 4e73e208..6574d2e8 100644 --- a/Controller/Customer/Remove.php +++ b/Controller/Customer/Remove.php @@ -163,10 +163,10 @@ private function deleteCoreCard($coreCardId, $baseException) } /** - * @return \MundiAPILib\MundiAPIClient + * @return \PagarmeCoreApiLib\PagarmeCoreApiClient */ private function getApi() { - return new \MundiAPILib\MundiAPIClient($this->config->getSecretKey(), ''); + return new \PagarmeCoreApiLib\PagarmeCoreApiClient($this->config->getSecretKey(), ''); } } diff --git a/Gateway/Transaction/Billet/Command/AuthorizeCommand.php b/Gateway/Transaction/Billet/Command/AuthorizeCommand.php index f62bdc73..5cbe6cc1 100755 --- a/Gateway/Transaction/Billet/Command/AuthorizeCommand.php +++ b/Gateway/Transaction/Billet/Command/AuthorizeCommand.php @@ -14,8 +14,6 @@ use Pagarme\Pagarme\Gateway\Transaction\Base\Command\AbstractApiCommand; -use MundiAPILib\Models\CreateOrderRequest; - class AuthorizeCommand extends AbstractApiCommand { /** diff --git a/Helper/CustomerUpdatePagarmeHelper.php b/Helper/CustomerUpdatePagarmeHelper.php index 321bb6f1..54547688 100644 --- a/Helper/CustomerUpdatePagarmeHelper.php +++ b/Helper/CustomerUpdatePagarmeHelper.php @@ -9,8 +9,8 @@ namespace Pagarme\Pagarme\Helper; use Magento\Customer\Api\CustomerRepositoryInterface; -use MundiAPILib\Controllers; -use MundiAPILib\Models\UpdateCustomerRequest; +use PagarmeCoreApiLib\Controllers; +use PagarmeCoreApiLib\Models\UpdateCustomerRequest; use Pagarme\Pagarme\Gateway\Transaction\Base\Config\Config; class CustomerUpdatePagarmeHelper @@ -70,11 +70,11 @@ public function getCustomers() } /** - * @return \MundiAPILib\MundiAPIClient + * @return \PagarmeCoreApiLib\PagarmeCoreApiClient */ public function getApi() { - return new \MundiAPILib\MundiAPIClient($this->config->getSecretKey(), ''); + return new \PagarmeCoreApiLib\PagarmeCoreApiClient($this->config->getSecretKey(), ''); } } diff --git a/Observer/AdminCustomerBeforeSave.php b/Observer/AdminCustomerBeforeSave.php index 61dbfc60..4725d871 100644 --- a/Observer/AdminCustomerBeforeSave.php +++ b/Observer/AdminCustomerBeforeSave.php @@ -46,12 +46,16 @@ public function execute(EventObserver $observer) $event = $observer->getEvent(); $platformCustomer = new Magento2PlatformCustomerDecorator($event->getCustomer()); + if (empty($platformCustomer->getPagarmeId())) { + return $this; + } + $customerService = new CustomerService(); try { $customerService->updateCustomerAtPagarme($platformCustomer); } catch (\Exception $exception) { $log = new LogService('CustomerService'); - $log->info($exception->getResponseBody()); + $log->info($exception->getMessage()); if ($exception->getCode() == 404) { $log->info( diff --git a/composer.json b/composer.json index 9405aabc..a21e6554 100755 --- a/composer.json +++ b/composer.json @@ -1,13 +1,13 @@ { "name": "pagarme/pagarme-magento2-module", "license": "MIT", - "version": "1.1.7", + "version": "1.2.0", "type": "magento2-module", "description": "Magento 2 Module Pagar.me", "require": { "php": "~7.1", - "mundipagg/mundiapi": "^3.0", - "pagarme/ecommerce-module-core": "~1.1.5" + "pagarme/pagarmecoreapi": "^5.7", + "pagarme/ecommerce-module-core": "~1.2.0" }, "require-dev": { "phpunit/phpunit": "4.1.0",