Skip to content

Commit

Permalink
Merge pull request #128 from pagarme/bugfix/PAOPN-273/error_when_edit…
Browse files Browse the repository at this point in the history
…ing_customer_in_adm_portal

Bugfix/paopn 273/error when editing customer in adm portal
  • Loading branch information
mauriciohaygert authored Dec 21, 2022
2 parents 062c24e + 8086074 commit ea205bd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Observer/AdminCustomerBeforeSave.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit ea205bd

Please sign in to comment.