houseofapis/magento2-currencyapi-importer
Composer 安装命令:
composer require houseofapis/magento2-currencyapi-importer
包简介
Magento 2 Currency Exchange Rate Importer for CurrencyApi.net - Real-time currency rates with automatic updates
关键字:
README 文档
README
A Magento 2 extension that integrates with CurrencyApi.net to provide real-time currency exchange rates. A great alternative to Fixer.io.
Features
- Real-time currency exchange rates from CurrencyApi.net
- Easy configuration through Magento admin
- Support for all major currencies
- Automatic rate updates via cron
- Secure API key storage
- Error handling and retry logic
- Comprehensive unit test coverage
- Docker-based development environment
Installation
Method 1: Composer from Packagist (Recommended)
composer require houseofapis/magento2-currencyapi-importer
Method 2: Composer from Magento Marketplace
-
Get your extension information:
- Log in to Commerce Marketplace with your account
- Click Your name > My Profile
- Click My Purchases
- Find the extension and note the component name and version
-
Ensure your
composer.jsonincludes the Magento repository:"repositories": [ { "type": "composer", "url": "https://repo.magento.com/" } ]
-
Install the extension with the specific version:
composer require houseofapis/magento2-currencyapi-importer:1.0.0
-
Enter your authentication keys when prompted (your public key is your username; your private key is your password)
Method 3: Manual Installation
- Download the extension files
- Copy to
app/code/HouseOfApis/CurrencyApi/
Post-Installation Steps
After installing using any method above, run these commands:
# Enable the module php bin/magento module:enable HouseOfApis_CurrencyApi # Update the database schema php bin/magento setup:upgrade # Compile dependency injection php bin/magento setup:di:compile # Verify the module is enabled php bin/magento module:status HouseOfApis_CurrencyApi # Clean the cache php bin/magento cache:clean
Note: If you encounter any issues loading the storefront, run
php bin/magento cache:flushto completely flush all caches.
API Key
You need an API key to use this extension.
Get your API key by creating a free account at CurrencyApi.net:
- Free plan: USD base currency only
- Paid plans: Required to change the base currency (for example to EUR, GBP, etc.)
Configuration
- Go to Stores > Configuration > General > Currency Setup
- Select CurrencyApi.net
- Enter your API key from CurrencyApi.net
- Configure connection timeout if needed
- Save configuration
Importing Currency Rates
- Go to Stores > Currency Rates
- Click Import Service and select CurrencyApi.net
- Click the Import button
- The new rates will now be imported
- Click Save Currency Rates to apply
Requirements
- Magento 2.4.0 or higher
- PHP 8.1 or higher
- Valid CurrencyApi.net API key
- cURL extension enabled
Magento Version Compatibility
| Magento Version | Extension Version | Status |
|---|---|---|
| 2.4.0 - 2.4.7 | 1.0.0 | ✅ Supported |
| 2.4.8+ | 1.0.0 | ✅ Supported |
Currency List
We supply up to 152 fiat currencies, cryptos and precious metals.
By default, Magento does not support cryptos and precious metals and there maybe some old currencies that are available on Magento but not available from our API.
For a full list of the currencies we supply, head over to our currency list page.
Development
Running Tests
This extension includes comprehensive unit tests. You can run them using Docker:
# Run all tests make test # Run tests with verbose output make test-verbose # Run tests with coverage report make test-coverage # Run specific test file make test-specific # Clean up Docker resources make clean
Test Structure
Test/Unit/- Unit tests with mocked dependenciesTest/Fixtures/- JSON fixtures for API responsesTest/Stubs/- Magento interface stubs for testing- Tests cover API integration, error handling, and configuration parsing
Project Structure
├── Model/Currency/Import/
│ └── CurrencyApi.php # Main import service
├── Test/
│ ├── Unit/ # Unit tests
│ ├── Fixtures/ # Test data
│ └── Stubs/ # Magento stubs
├── composer.json # Package definition
├── registration.php # Magento module registration
└── README.md # This file
Troubleshooting
Common Issues
Currency rates not updating:
- Verify your API key is correct
- Check if cron jobs are running
- Ensure your server can reach currencyapi.net
"No API Key was specified" error:
- Go to Stores > Configuration > Currency > Currency Rates
- Select "CurrencyApi.net" as import service
- Enter your API key and save
Test failures:
- Run
make testto verify all tests pass - Check Docker is running if using containerized tests
Support
For support and questions, please contact:
- Email: support@currencyapi.net
- Website: CurrencyApi.net
License
MIT License - see LICENSE file for details.
houseofapis/magento2-currencyapi-importer 适用场景与选型建议
houseofapis/magento2-currencyapi-importer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 14 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 10 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「ecommerce」 「currency」 「magento」 「forex」 「currency-converter」 「exchange-rates」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 houseofapis/magento2-currencyapi-importer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 houseofapis/magento2-currencyapi-importer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 houseofapis/magento2-currencyapi-importer 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Nevogate Payment Gateway SDK
Dealing with payments through the Egyptian payment gateway PayMob
Fixer.io data provider for Peso
TCMB Currenct Converter
Magento 2 Social Login extension is designed for quick login to your Magento 2 store without procesing complex register steps
Magento - Clean up session extension
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 31
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-02


