mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 00:44:31 -04:00
Prevent creating payment for a quote through the API
This commit is contained in:
parent
5e5207973f
commit
cef35a98e1
@ -28,7 +28,9 @@ class CreatePaymentAPIRequest extends PaymentRequest
|
||||
];
|
||||
}
|
||||
|
||||
$invoice = Invoice::scope($this->invoice_id)->firstOrFail();
|
||||
$invoice = Invoice::scope($this->invoice_id)
|
||||
->invoices()
|
||||
->firstOrFail();
|
||||
|
||||
$this->merge([
|
||||
'invoice_id' => $invoice->id,
|
||||
|
@ -22,7 +22,9 @@ class CreatePaymentRequest extends PaymentRequest
|
||||
public function rules()
|
||||
{
|
||||
$input = $this->input();
|
||||
$invoice = Invoice::scope($input['invoice'])->firstOrFail();
|
||||
$invoice = Invoice::scope($input['invoice'])
|
||||
->invoices()
|
||||
->firstOrFail();
|
||||
|
||||
$rules = [
|
||||
'client' => 'required', // TODO: change to client_id once views are updated
|
||||
|
Loading…
x
Reference in New Issue
Block a user