Skip to content

Commit dfafcbd

Browse files
committed
chore: SDK update
1 parent 1c59d51 commit dfafcbd

File tree

232 files changed

+60938
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

232 files changed

+60938
-0
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
composer.phar
2+
composer.lock
3+
/vendor/
4+
.php_cs.cache
5+
.php-cs-fixer.cache
6+
.phpunit.result.cache
7+
build/phplint.cache
8+
.idea/

.php-cs-fixer.dist.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
/**
4+
* @generated
5+
* @link https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/HEAD/doc/config.rst
6+
*/
7+
$finder = PhpCsFixer\Finder::create()
8+
->in(__DIR__)
9+
->exclude('vendor')
10+
->exclude('test')
11+
->exclude('tests')
12+
;
13+
14+
$config = new PhpCsFixer\Config();
15+
return $config->setRules([
16+
'@PSR12' => true,
17+
'phpdoc_order' => true,
18+
'array_syntax' => [ 'syntax' => 'short' ],
19+
'strict_comparison' => true,
20+
'strict_param' => true,
21+
'no_trailing_whitespace' => false,
22+
'no_trailing_whitespace_in_comment' => false,
23+
'braces' => false,
24+
'single_blank_line_at_eof' => false,
25+
'blank_line_after_namespace' => false,
26+
'no_leading_import_slash' => false,
27+
])
28+
->setFinder($finder)
29+
;

README.md

Lines changed: 238 additions & 0 deletions
Large diffs are not rendered by default.

composer.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "hostinger/api-php-sdk",
3+
"description": "Hostinger API PHP SDK",
4+
"keywords": [
5+
"hostinger",
6+
"openapi",
7+
"php",
8+
"sdk",
9+
"rest",
10+
"api"
11+
],
12+
"homepage": "https://developers.hostinger.com",
13+
"license": "MIT",
14+
"authors": [
15+
{
16+
"name": "Hostinger",
17+
"homepage": "https://www.hostinger.com"
18+
}
19+
],
20+
"require": {
21+
"php": "^8.1",
22+
"ext-curl": "*",
23+
"ext-json": "*",
24+
"ext-mbstring": "*",
25+
"guzzlehttp/guzzle": "^7.4.5",
26+
"guzzlehttp/psr7": "^2.0"
27+
},
28+
"require-dev": {
29+
"friendsofphp/php-cs-fixer": "^3.5",
30+
"overtrue/phplint": "^9.0",
31+
"phpunit/phpunit": "^9.0"
32+
},
33+
"autoload": {
34+
"psr-4": { "Hostinger\\" : "src/" }
35+
},
36+
"autoload-dev": {
37+
"psr-4": { "Hostinger\\Test\\" : "tests/" }
38+
}
39+
}

docs/Api/BillingCatalogApi.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Hostinger\BillingCatalogApi
2+
3+
All URIs are relative to https://developers.hostinger.com, except if the operation defines another base path.
4+
5+
| Method | HTTP request | Description |
6+
| ------------- | ------------- | ------------- |
7+
| [**getCatalogItemListV1()**](BillingCatalogApi.md#getCatalogItemListV1) | **GET** /api/billing/v1/catalog | Get catalog item list |
8+
9+
10+
## `getCatalogItemListV1()`
11+
12+
```php
13+
getCatalogItemListV1(): \Hostinger\Model\BillingV1CatalogCatalogItemResource[]
14+
```
15+
16+
Get catalog item list
17+
18+
This endpoint retrieves a list of catalog items available for order. Prices in catalog items is displayed as cents (without floating point), e.g: float `17.99` is displayed as integer `1799`.
19+
20+
### Example
21+
22+
```php
23+
<?php
24+
require_once(__DIR__ . '/vendor/autoload.php');
25+
26+
27+
// Configure Bearer authorization: apiToken
28+
$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
29+
30+
31+
$apiInstance = new Hostinger\Api\BillingCatalogApi(
32+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
33+
// This is optional, `GuzzleHttp\Client` will be used as default.
34+
new GuzzleHttp\Client(),
35+
$config
36+
);
37+
38+
try {
39+
$result = $apiInstance->getCatalogItemListV1();
40+
print_r($result);
41+
} catch (Exception $e) {
42+
echo 'Exception when calling BillingCatalogApi->getCatalogItemListV1: ', $e->getMessage(), PHP_EOL;
43+
}
44+
```
45+
46+
### Parameters
47+
48+
This endpoint does not need any parameter.
49+
50+
### Return type
51+
52+
[**\Hostinger\Model\BillingV1CatalogCatalogItemResource[]**](../Model/BillingV1CatalogCatalogItemResource.md)
53+
54+
### Authorization
55+
56+
[apiToken](../../README.md#apiToken)
57+
58+
### HTTP request headers
59+
60+
- **Content-Type**: Not defined
61+
- **Accept**: `application/json`
62+
63+
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
64+
[[Back to Model list]](../../README.md#models)
65+
[[Back to README]](../../README.md)

docs/Api/BillingOrdersApi.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Hostinger\BillingOrdersApi
2+
3+
All URIs are relative to https://developers.hostinger.com, except if the operation defines another base path.
4+
5+
| Method | HTTP request | Description |
6+
| ------------- | ------------- | ------------- |
7+
| [**createNewServiceOrderV1()**](BillingOrdersApi.md#createNewServiceOrderV1) | **POST** /api/billing/v1/orders | Create new service order |
8+
9+
10+
## `createNewServiceOrderV1()`
11+
12+
```php
13+
createNewServiceOrderV1($billing_v1_order_store_request): \Hostinger\Model\BillingV1OrderOrderResource
14+
```
15+
16+
Create new service order
17+
18+
This endpoint creates a new service order. To place order, you need to provide payment method ID and list of price items from the catalog endpoint together with quantity. Coupons also can be provided during order creation. Orders created using this endpoint will be set for automatically renewal.
19+
20+
### Example
21+
22+
```php
23+
<?php
24+
require_once(__DIR__ . '/vendor/autoload.php');
25+
26+
27+
// Configure Bearer authorization: apiToken
28+
$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
29+
30+
31+
$apiInstance = new Hostinger\Api\BillingOrdersApi(
32+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
33+
// This is optional, `GuzzleHttp\Client` will be used as default.
34+
new GuzzleHttp\Client(),
35+
$config
36+
);
37+
$billing_v1_order_store_request = new \Hostinger\Model\BillingV1OrderStoreRequest(); // \Hostinger\Model\BillingV1OrderStoreRequest
38+
39+
try {
40+
$result = $apiInstance->createNewServiceOrderV1($billing_v1_order_store_request);
41+
print_r($result);
42+
} catch (Exception $e) {
43+
echo 'Exception when calling BillingOrdersApi->createNewServiceOrderV1: ', $e->getMessage(), PHP_EOL;
44+
}
45+
```
46+
47+
### Parameters
48+
49+
| Name | Type | Description | Notes |
50+
| ------------- | ------------- | ------------- | ------------- |
51+
| **billing_v1_order_store_request** | [**\Hostinger\Model\BillingV1OrderStoreRequest**](../Model/BillingV1OrderStoreRequest.md)| | |
52+
53+
### Return type
54+
55+
[**\Hostinger\Model\BillingV1OrderOrderResource**](../Model/BillingV1OrderOrderResource.md)
56+
57+
### Authorization
58+
59+
[apiToken](../../README.md#apiToken)
60+
61+
### HTTP request headers
62+
63+
- **Content-Type**: `application/json`
64+
- **Accept**: `application/json`
65+
66+
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
67+
[[Back to Model list]](../../README.md#models)
68+
[[Back to README]](../../README.md)

0 commit comments

Comments
 (0)