diff --git a/app/Enum/HttpVerb.php b/app/Enum/HttpVerb.php new file mode 100644 index 000000000000..ef7572cacc3a --- /dev/null +++ b/app/Enum/HttpVerb.php @@ -0,0 +1,22 @@ +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(); + + } }