original_string: public function refund(array $data = null, Payplug\Payplug $payplug = null)
      {
          if (!array_key_exists('id', $this->getAttributes())) {
              throw new Payplug\Exception\InvalidPaymentException("This payment object has no id. It can't be refunded.");
          }
  
          return Refund::create($this->id, $data, $payplug);
      }
code: public function refund(array $data = null, Payplug\Payplug $payplug = null)
      {
          if (!array_key_exists('id', $this->getAttributes())) {
              throw new Payplug\Exception\InvalidPaymentException("This payment object has no id. It can't be refunded.");
          }
  
          return Refund::create($this->id, $data, $payplug);
      }
code_tokens: public function refund ( array $ data = null , Payplug \ Payplug $ payplug = null ) { if ( ! array_key_exists ( 'id' , $ this -> getAttributes ( ) ) ) { throw new Payplug \ Exception \ InvalidPaymentException ( "This payment object has no id. It can't be refunded." ) ; } return Refund :: create ( $ this -> id , $ data , $ payplug ) ; }
docstring: Open a refund on the payment.
  
  @param   array               $data       the refund data
  @param   Payplug\Payplug    $payplug    the client configuration
  
  @return  Refund|null the opened refund instance
  
  @throws  Payplug\Exception\InvalidPaymentException when the id of the payment is invalid
docstring_tokens: Open a refund on the payment .