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(