# oxcom/magento2-currency-services

> This is a module that allows to update currency rates from addition external sources.

`composer require oxcom/magento2-currency-services`

Canonical URL: https://packagento.com/oxcom/magento2-currency-services

## At a glance

- **Vendor**: oxcom (https://packagento.com/oxcom.md)
- **Latest version**: 2.1.0 — released 2026-07-15
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/oxcom/magento2-currency-services and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require oxcom/magento2-currency-services:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

This is a module that allows to update currency rates from addition external sources.

## README

[![CI](https://github.com/OxCom/magento2-currency-services/actions/workflows/ci.yml/badge.svg)](https://github.com/OxCom/magento2-currency-services/actions/workflows/ci.yml)

This is a module that allows to update currency rates from addition external sources.

###### List of source services
1. [Finance Google](https://finance.google.com/finance/converter)
2. [European Central Bank](http://www.ecb.europa.eu/stats/policy_and_exchange_rates/euro_reference_exchange_rates/html/index.en.html)
3. [Fixer](http://fixer.io/)

###### Notes
1. **Fixer**
    ```
    [The old, deprecated Fixer API will be discontinued on June 1st, 2018]
    We are happy to announce the complete relaunch of fixer.io into a more 
    stable, more secure, and much more advanced currency & exchange rate 
    conversion API platform. While the core structure of our API remains 
    unchanged, all users of the legacy Fixer API will be required to sign 
    up for a free API access key and perform a few simple changes to their 
    integration. To learn more about the changes that are required.
    ```
    
    Be aware that free access to Fixer API has limited functionality.

    You can setup Access Token for Fixer API in your administration panel 
    for Magento.

2. **Finance Google**

    New changes were introduces by Google and now it's possible only parse 
    HTML to get required information.
    
    Be aware about that Google may change it HTML structure at any time

3. **European Central Bank**

    ```
    The reference rates are usually updated around 16:00 CET on every working 
    day, except on TARGET closing days. They are based on a regular daily 
    concertation procedure between central banks across Europe, which normally 
    takes place at 14:15 CET.
    ```
    
    Be aware about low refresh rate

### Install
```bash
$ composer require oxcom/magento2-currency-services
$ bin/magento module:enable OxCom_MagentoCurrencyServices
$ bin/magento setup:upgrade
$ bin/magento setup:di:compile
```

### CLI commands
Rates can be imported manually per source, without waiting for cron or using
the admin panel:

```bash
$ bin/magento oxcom:importrates:ecb
$ bin/magento oxcom:importrates:fixer
$ bin/magento oxcom:importrates:google
```

Each command fetches rates from the given source and saves them, same as
admin System > Currency Rates > Import Now. Non-zero exit code + error
output if a rate can't be retrieved.

Commands are registered via DI, so after install run `setup:upgrade` (and
`setup:di:compile` in production mode) / flush cache before they show up in
`bin/magento list`.

### Tests
By default, local test runs alternate weekly between real sources (internet
connection required) and local fixtures. Setting the `CI` environment variable
forces fixture (mocked) mode — no network access needed:

```bash
$ composer install
$ CI=1 vendor/bin/phpunit -c Test/phpunit.xml --no-coverage
```

Composer scripts are available for all checks:

```bash
$ composer cs    # phpcs (PSR-12 + Slevomat)
$ composer stan  # phpstan analyse
$ composer test  # phpunit (no coverage)
```

## Recent Versions

| Version | Released |
|---|---|
| 2.1.0 | 2026-07-15 |
| 2.0.1 | 2023-05-08 |
| 2.0.0 | 2021-01-11 |
| 1.1.0 | 2020-07-02 |
| 1.0.6 | 2019-04-04 |
| 1.0.5 | 2018-06-19 |
| 1.0.3 | 2018-05-10 |
| 1.0.2 | 2018-03-22 |
| 1.0.1 | 2017-11-22 |
| 1.0.0 | 2017-10-25 |

## Dependencies

### Require

| Package | Constraint |
|---|---|
| ext-bcmath | * |
| ext-curl | * |
| ext-json | * |
| ext-simplexml | * |
| magento/framework | ^103.0 |
| magento/module-backend | 100.0.*\|100.1.*\|100.2.*\|101.0.*\|102.0.*\|103.0.* |
| magento/module-config | 100.0.*\|100.1.*\|101.0.*\|101.1.*\|101.2.* |
| magento/module-directory | 100.0.*\|100.1.*\|100.2.*\|100.3.*\|100.4.* |
| magento/module-store | 100.0.*\|100.1.*\|100.2.*\|101.0.*\|101.1.* |
| php | >=7.1 |
| psr/log | ^1.1\|^2.0\|^3.0 |

### Require (dev)

| Package | Constraint |
|---|---|
| dealerdirect/phpcodesniffer-composer-installer | ^1.0 |
| phpstan/phpstan | ^2.1 |
| phpunit/phpunit | ^10.5 \|\| ^11.5 |
| slevomat/coding-standard | ^8.16 |
| squizlabs/php_codesniffer | ^3.13 |

## Quality

Latest release (2.1.0) fails the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | Pass |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — a phpcs finding can't make a module incompatible.

#### Static Analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Warning | 30 | 30 warnings (ruleset: Magento2), 24 auto-fixable with phpcbf |
| PHPMD | Warning | 3 | 3 rule violations (UnusedPrivateField:2, MissingImport:1) |
| Cpd | Pass | 0 |  |
| Composer validate | Pass | 0 |  |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | 7 | 7 | – | – |
| 2.4.8 | – | 7 | 7 | – |
| 2.4.9 | – | – | 7 | 7 |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Pass | 0 |  |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["oxcom/magento2-currency-services"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

oxcom is a Magento 2 vendor on Packagento. See https://packagento.com/oxcom.md for their full catalogue.

