/**
  * Register a payment for the invoice
  * @param Service $service
  * @param AbstractPayment $payment
  * @return self
  * @throws InvalidStateException
  */
 public function registerPayment(Service $service, AbstractPayment $payment)
 {
     if ($this->state == 'draft') {
         throw new InvalidStateException('Send invoice before register payments');
     }
     return $this->reload($service->registerPayment($this, $payment));
 }
 /**
  * Register a payment for the invoice
  * @param Service $service
  * @param AbstractPayment $payment
  * @return self
  */
 public function registerPayment(Service $service, AbstractPayment $payment)
 {
     return $this->reload($service->registerPayment($this, $payment));
 }