cloudmersive / cloudmersive_currency_api_client
1.2.0
2020-09-13 04:40 UTC
Requires
- php: >=5.5
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ~1.12
- phpunit/phpunit: ^4.8
- squizlabs/php_codesniffer: ~2.6
This package is not auto-updated.
Last update: 2024-09-23 23:18:58 UTC
README
货币API可以帮助您轻松检索汇率并转换货币之间的价格。
Cloudmersive Currency API 可以帮助您轻松检索汇率并转换货币之间的价格。
- API版本:v1
- 包版本:1.2.0
要求
PHP 5.5 及以上版本
安装与使用
Composer
要通过 Composer 安装绑定,请将以下内容添加到 composer.json
{
"repositories": [
{
"type": "git",
"url": "https://github.com/cloudmersive/cloudmersive_currency_api_client.git"
}
],
"require": {
"cloudmersive/cloudmersive_currency_api_client": "*@dev"
}
}
然后运行 composer install
手动安装
下载文件并包含 autoload.php
require_once('/path/to/cloudmersive_currency_api_client/vendor/autoload.php');
测试
要运行单元测试
composer install
./vendor/bin/phpunit
入门指南
请按照 安装程序 进行操作,然后运行以下命令
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: Apikey $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Apikey', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Apikey', 'Bearer'); $apiInstance = new Swagger\Client\Api\CurrencyExchangeApi( // 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 ); $source = "source_example"; // string | Source currency three-digit code (ISO 4217), e.g. USD, EUR, etc. $destination = "destination_example"; // string | Destination currency three-digit code (ISO 4217), e.g. USD, EUR, etc. $source_price = 1.2; // double | Input price, such as 19.99 in source currency try { $result = $apiInstance->currencyExchangeConvertCurrency($source, $destination, $source_price); print_r($result); } catch (Exception $e) { echo 'Exception when calling CurrencyExchangeApi->currencyExchangeConvertCurrency: ', $e->getMessage(), PHP_EOL; } ?>
API端点文档
所有URI都相对于 https://api.cloudmersive.com
模型文档
授权文档
Apikey
- 类型:API密钥
- API密钥参数名称:Apikey
- 位置:HTTP头