public function registerPayment(SalesInvoicePayment $salesInvoicePayment)
    {
        if (! isset($salesInvoicePayment->payment_date)) {
            throw new ApiException('Required [payment_date] is missing');
        }

        if (! isset($salesInvoicePayment->price)) {
            throw new ApiException('Required [price] is missing');
        }

        $this->connection()->post($this->endpoint . '/' . $this->id . '/payments',
            $salesInvoicePayment->jsonWithNamespace()
        );

        return $this;
    }
public function registerPayment(SalesInvoicePayment $salesInvoicePayment)
    {
        if (! isset($salesInvoicePayment->payment_date)) {
            throw new ApiException('Required [payment_date] is missing');
        }

        if (! isset($salesInvoicePayment->price)) {
            throw new ApiException('Required [price] is missing');
        }

        $this->connection()->post($this->endpoint . '/' . $this->id . '/payments',
            $salesInvoicePayment->jsonWithNamespace()
        );

        return $this;
    }
public function registerPayment ( SalesInvoicePayment $ salesInvoicePayment ) { if ( ! isset ( $ salesInvoicePayment -> payment_date ) ) { throw new ApiException ( 'Required [payment_date] is missing' ) ; } if ( ! isset ( $ salesInvoicePayment -> price ) ) { throw new ApiException ( 'Required [price] is missing' ) ; } $ this -> connection ( ) -> post ( $ this -> endpoint . '/' . $ this -> id . '/payments' , $ salesInvoicePayment -> jsonWithNamespace ( ) ) ; return $ this ; }
Register a payment for the current invoice.

@param SalesInvoicePayment $salesInvoicePayment (payment_date and price are required)
@return $this
@throws ApiException
Register a payment for the current invoice .