TestEnterpriseExchanger.php in Commerce Exchanger 8
File
tests/modules/commerce_exchanger_test/src/Plugin/Commerce/ExchangerProvider/TestEnterpriseExchanger.php
View source
<?php
namespace Drupal\commerce_exchanger_test\Plugin\Commerce\ExchangerProvider;
use Drupal\commerce_exchanger\Plugin\Commerce\ExchangerProvider\ExchangerProviderRemoteBase;
class TestEnterpriseExchanger extends ExchangerProviderRemoteBase {
public function apiUrl() {
return 'http://example.enterprise';
}
public function getRemoteData($base_currency = NULL) {
$data = [
'HRK' => [
'EUR' => 0.13,
'USD' => 0.16,
'AUD' => 0.22,
],
'EUR' => [
'AUD' => 1.66,
'HRK' => 7.58,
'USD' => 1.19,
],
'USD' => [
'AUD' => 1.4,
'HRK' => 6.39,
'EUR' => 0.84,
],
'AUD' => [
'EUR' => 0.6,
'HRK' => 4.56,
'USD' => 0.71,
],
];
return $data[$base_currency];
}
}