mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
qvalia
This commit is contained in:
parent
fb46889bb4
commit
50faf3261b
22
app/Enum/HttpVerb.php
Normal file
22
app/Enum/HttpVerb.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Invoice Ninja (https://invoiceninja.com).
|
||||||
|
*
|
||||||
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
|
*
|
||||||
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\Enum;
|
||||||
|
|
||||||
|
enum HttpVerb: string
|
||||||
|
{
|
||||||
|
case POST = 'post';
|
||||||
|
case PUT = 'put';
|
||||||
|
case GET = 'get';
|
||||||
|
case PATCH = 'patch';
|
||||||
|
case DELETE = 'delete';
|
||||||
|
}
|
@ -18,7 +18,41 @@ class Invoice
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
|
/**
|
||||||
|
* status
|
||||||
|
*
|
||||||
|
* @param string $legal_entity_id
|
||||||
|
* @param string $integration_id
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
|
||||||
|
// {
|
||||||
|
// "status": "",
|
||||||
|
// "data": {
|
||||||
|
// "message": "",
|
||||||
|
// "status": {
|
||||||
|
// "document_id": "",
|
||||||
|
// "order_number": "",
|
||||||
|
// "payment_reference": "",
|
||||||
|
// "credit_note": "",
|
||||||
|
// "reminder": "",
|
||||||
|
// "status": "",
|
||||||
|
// "sent_at": "",
|
||||||
|
// "paid_at": "",
|
||||||
|
// "cancelled_at": "",
|
||||||
|
// "send_method": ""
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* status
|
||||||
|
*
|
||||||
|
* @param string $legal_entity_id
|
||||||
|
* @param string $integration_id
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
public function status(string $legal_entity_id, string $integration_id)
|
public function status(string $legal_entity_id, string $integration_id)
|
||||||
{
|
{
|
||||||
$uri = "/account/{$legal_entity_id}/action/invoice/outgoing/status/{$integration_id}";
|
$uri = "/account/{$legal_entity_id}/action/invoice/outgoing/status/{$integration_id}";
|
||||||
@ -28,4 +62,33 @@ class Invoice
|
|||||||
return $r->object();
|
return $r->object();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* send
|
||||||
|
*
|
||||||
|
* @param string $legal_entity_id
|
||||||
|
* @param string $document
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function send(string $legal_entity_id, string $document)
|
||||||
|
{
|
||||||
|
// Set Headers
|
||||||
|
// Either "application/json" (default) or "application/xml"
|
||||||
|
|
||||||
|
$headers = [
|
||||||
|
'Content-Type' => 'application/json',
|
||||||
|
'Accept' => 'application/json',
|
||||||
|
// 'Content-Type' => 'application/xml',
|
||||||
|
];
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'Invoice' => $document
|
||||||
|
];
|
||||||
|
|
||||||
|
$uri = "/transaction/{$legal_entity_id}/invoices/outgoing";
|
||||||
|
|
||||||
|
$r = $this->qvalia->httpClient($uri, (\App\Enum\HttpVerb::POST)->value, $data, $headers);
|
||||||
|
|
||||||
|
return $r->object();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user