Skip to content

Commit

Permalink
PAOPN-273: Save Customer on Pagarme just on update
Browse files Browse the repository at this point in the history
  • Loading branch information
claudio-pagarme committed Dec 21, 2022
1 parent d7b0e8c commit 8086074
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Observer/AdminCustomerBeforeSave.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ 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);
Expand Down

0 comments on commit 8086074

Please sign in to comment.