code: public function onDelete(ResourceEventInterface $event)
      {
          $payment = $this->getPaymentFromEvent($event);
  
          $this->customerUpdater->handlePaymentDelete($payment);
  
          $sale = $this->getSaleFromPayment($payment);
  
          $sale->removePayment($payment);
  
          $this->scheduleSaleContentChangeEvent($sale);
      }
docs: Delete event handler.
  
  @param ResourceEventInterface $event