| @@ 5-34 (lines=30) @@ | ||
| 2 | ||
| 3 | namespace Sausin\Signere; |
|
| 4 | ||
| 5 | class DocumentConvert extends BaseClass |
|
| 6 | { |
|
| 7 | /** The URI of the action */ |
|
| 8 | const URI = 'https://api.signere.no/api/DocumentConvert'; |
|
| 9 | ||
| 10 | /** |
|
| 11 | * Convert format of the document to PDF. |
|
| 12 | * |
|
| 13 | * @param array $body |
|
| 14 | * @return object |
|
| 15 | * @todo fix it for proper setup with file |
|
| 16 | */ |
|
| 17 | public function convert(array $body) |
|
| 18 | { |
|
| 19 | // make the URL for this request |
|
| 20 | $url = $this->transformUrl(self::URI); |
|
| 21 | ||
| 22 | // get the headers for this request |
|
| 23 | $headers = $this->headers->make('POST', $url, $body); |
|
| 24 | ||
| 25 | // get the response |
|
| 26 | $response = $this->client->post($url, [ |
|
| 27 | 'headers' => $headers, |
|
| 28 | 'json' => $body, |
|
| 29 | ]); |
|
| 30 | ||
| 31 | // return the response |
|
| 32 | return $response; |
|
| 33 | } |
|
| 34 | } |
|
| 35 | ||
| @@ 5-31 (lines=27) @@ | ||
| 2 | ||
| 3 | namespace Sausin\Signere; |
|
| 4 | ||
| 5 | class Events extends BaseClass |
|
| 6 | { |
|
| 7 | /** The URI of the action */ |
|
| 8 | const URI = 'https://api.signere.no/api/events/encryptionkey'; |
|
| 9 | ||
| 10 | /** |
|
| 11 | * Returns the EventsQueue encryptionKey as a base64 encoded string. |
|
| 12 | * |
|
| 13 | * @return object |
|
| 14 | */ |
|
| 15 | public function getEncryptionKey() |
|
| 16 | { |
|
| 17 | // make the URL for this request |
|
| 18 | $url = $this->transformUrl(self::URI); |
|
| 19 | ||
| 20 | // get the headers for this request |
|
| 21 | $headers = $this->headers->make('GET', $url); |
|
| 22 | ||
| 23 | // get the response |
|
| 24 | $response = $this->client->get($url, [ |
|
| 25 | 'headers' => $headers, |
|
| 26 | ]); |
|
| 27 | ||
| 28 | // return the response |
|
| 29 | return $response; |
|
| 30 | } |
|
| 31 | } |
|
| 32 | ||