Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hydrogen-dev/electron-sdk-php
https://github.com/hydrogen-dev/electron-sdk-php
Last synced: 18 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/hydrogen-dev/electron-sdk-php
- Owner: hydrogen-dev
- Created: 2021-12-30T13:53:01.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-17T13:41:02.000Z (almost 3 years ago)
- Last Synced: 2023-07-15T02:36:16.832Z (over 1 year ago)
- Language: PHP
- Size: 31.3 KB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hydrogen Electron API
The Hydrogen Electron API
- API version: 1.3.1
- Build date: 27-12-2021For more information, please visit [https://www.hydrogenplatform.com/apis](https://www.hydrogenplatform.com/apis)
## Documentation
https://www.hydrogenplatform.com/docs/electron/v1
## Requirements
PHP 5.5 and later
## Installation
### Install via Composer
Please run `composer require hydrogenplatform/hydrogen-electron-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\electron\AuthApiClient::
getDefaultConfiguration(\com\hydrogen\electron\Environment::SANDBOX)
**Production URL**\com\hydrogen\electron\AuthApiClient::
getDefaultConfiguration(\com\hydrogen\electron\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\electron\AuthApiClient::
getDefaultConfiguration(\com\hydrogen\electron\Environment::PRODUCTION)->createPasswordCredential("MYCLIENTID","MYCLIENTSECRET"
,"MYUSERNAME", "MYPASSWORD");
// 3) Generate Token for client_token
$config = \com\hydrogen\electron\AuthApiClient::getDefaultConfiguration(\com\hydrogen\electron\Environment::PRODUCTION)
->createClientTokenCredential("MYCLIENTID","MYCLIENTSECRET", "CLIENT_TOKEN");
} catch (\com\hydrogen\electron\ApiException $e) {
print_r($e);
}
$apiInstance = new com\hydrogen\electron\Api\ACHApi(
// 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
);
$ach_card_request_co = new \com\hydrogen\electron\Model\AchCardRequestCO(); // \com\hydrogen\electron\Model\AchCardRequestCO | achCardRequestCOtry {
$result = $apiInstance->fundCardUsingPost($ach_card_request_co);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ACHApi->fundCardUsingPost: ', $e->getMessage(), PHP_EOL;
}?>
```## Author
The Hydrogen Technology Corporationhttps://www.hydrogenplatform.com
*Generated using [Swagger Codegen](https://github.com/swagger-api/swagger-codegen)*