Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hydrogen-dev/proton-sdk-php
https://github.com/hydrogen-dev/proton-sdk-php
Last synced: 18 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/hydrogen-dev/proton-sdk-php
- Owner: hydrogen-dev
- Created: 2021-02-17T04:54:10.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-08-16T12:43:24.000Z (over 3 years ago)
- Last Synced: 2024-04-16T15:20:03.793Z (8 months ago)
- Language: PHP
- Size: 325 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hydrogen Proton API
Hydrogen Proton API
- API version: 1.9.2
- Build date: 01-07-2021For more information, please visit [https://www.hydrogenplatform.com/apis](https://www.hydrogenplatform.com/apis)
## Documentation
https://www.hydrogenplatform.com/docs/proton/v1
## Requirements
1. PHP 5.5 and later
## Installation
### Install via Composer
Please run `composer require hydrogenplatform/hydrogen-proton-api`
## Getting Started
Please first follow the [installation](#installation) instructions. Then make sure you use the proper base URL:
### Base URL
Create an authentication object(**AuthApiClient**) and pass the **getDefaultConfiguration** method
with environment parameter.
**Sandbox URL**\com\hydrogen\proton\AuthApiClient::getDefaultConfiguration(\com\hydrogen\proton\Environment::SANDBOX)
**Production URL**
\com\hydrogen\proton\AuthApiClient::getDefaultConfiguration(\com\hydrogen\proton\Environment::PRODUCTION)
### Sample Code
Now you are ready to execute the following PHP code:```php
createClientCredential("MYCLIENTID",
"MYCLIENTSECRET");
// 2) Generate Token for password credentials
$config =
\com\hydrogen\proton\AuthApiClient::
getDefaultConfiguration(\com\hydrogen\proton\Environment::PRODUCTION)->createPasswordCredential("MYCLIENTID","MYCLIENTSECRET"
,"MYUSERNAME", "MYPASSWORD");
// 3) Generate Token for client_token
$config = \com\hydrogen\proton\AuthApiClient::
getDefaultConfiguration(\com\hydrogen\proton\Environment::PRODUCTION)
->createClientTokenCredential("MYCLIENTID","MYCLIENTSECRET", "CLIENT_TOKEN");
} catch (\com\hydrogen\proton\ApiException $e) {
print_r($e);
}
$apiInstance = new com\hydrogen\proton\Api\AnnuitiesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$annuity_calculator_accumulation_horizon_request = new \com\hydrogen\proton\Model\AnnuityCalculatorAccumulationHorizonRequest(); // \com\hydrogen\proton\Model\AnnuityCalculatorAccumulationHorizonRequest | Request payload for Annuity Calculator - Accumulation Horizontry {
$result = $apiInstance->annuityCalculatorAccumulationHorizon($annuity_calculator_accumulation_horizon_request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AnnuitiesApi->annuityCalculatorAccumulationHorizon: ', $e->getMessage(), PHP_EOL;
}?>
```## Author
The Hydrogen Technology Corporationhttps://www.hydrogenplatform.com
*Generated using [Swagger Codegen](https://github.com/swagger-api/swagger-codegen)*