1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 22:54:25 +01:00
invoiceninja/app/Ninja/Intents/WebApp/CreatePaymentIntent.php

28 lines
694 B
PHP
Raw Normal View History

2017-04-04 16:51:01 +02:00
<?php
namespace App\Ninja\Intents\WebApp;
use App\Ninja\Intents\BaseIntent;
class CreatePaymentIntent extends BaseIntent
{
public function process()
{
2017-04-04 20:08:35 +02:00
$clientPublicId = 0;
$invoicePublicId = 0;
if ($invoice = $this->requestInvoice()) {
$invoicePublicId = $invoice->public_id;
} elseif ($client = $this->requestClient()) {
$clientPublicId = $client->public_id;
}
2017-04-04 16:51:01 +02:00
//$invoiceItems = $this->requestInvoiceItems();
2017-04-04 20:08:35 +02:00
$url = sprintf('/payments/create/%s/%s', $clientPublicId, $invoicePublicId);
2017-04-04 16:51:01 +02:00
//$url .= $this->requestFieldsAsString(Invoice::$requestFields);
return redirect($url);
}
}