mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 16:14:28 -04:00
commit
765a1484f0
@ -2,6 +2,7 @@
|
||||
|
||||
use App\Ninja\Mailers\ContactMailer;
|
||||
use Auth;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Input;
|
||||
use Utils;
|
||||
use Response;
|
||||
@ -90,12 +91,14 @@ class PaymentApiController extends BaseAPIController
|
||||
{
|
||||
$data = Input::all();
|
||||
$data['public_id'] = $publicId;
|
||||
$invoice = Invoice::scope($data['invoice_id'])->with('client')->first();
|
||||
|
||||
$error = false;
|
||||
$payment = $this->paymentRepo->save($data);
|
||||
if ($error) {
|
||||
return $error;
|
||||
}
|
||||
$invoice = Invoice::scope($payment->invoice_id)->with('client', 'invoice_items', 'invitations')->first();
|
||||
$invoice = Invoice::scope($invoice->public_id)->with('client', 'invoice_items', 'invitations')->first();
|
||||
$transformer = new InvoiceTransformer(\Auth::user()->account, Input::get('serializer'));
|
||||
$data = $this->createItem($invoice, $transformer, 'invoice');
|
||||
return $this->response($data);
|
||||
@ -160,7 +163,10 @@ class PaymentApiController extends BaseAPIController
|
||||
$transformer = new PaymentTransformer(Auth::user()->account, Input::get('serializer'));
|
||||
$data = $this->createItem($payment, $transformer, 'payment');
|
||||
*/
|
||||
$invoice = Invoice::scope($payment->invoice_id)->with('client', 'invoice_items', 'invitations')->first();
|
||||
$invoice = Invoice::scope($invoice->public_id)->with('client', 'invoice_items', 'invitations')->first();
|
||||
|
||||
|
||||
|
||||
$transformer = new InvoiceTransformer(\Auth::user()->account, Input::get('serializer'));
|
||||
$data = $this->createItem($invoice, $transformer, 'invoice');
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user