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);
    }
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);
    }
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 ) ; }
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
Open a refund on the payment .