Overview

Packages

  • blesta
    • app
      • controllers
      • models
    • components
      • auth
        • ldap
        • motp
        • oath
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • events
      • exchange
        • rates
          • currency
            • layer
          • fixer
          • open
            • exchange
              • rates
          • x
            • rates
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
          • perforated
            • invoice
          • quickbooks
            • invoice
          • templates
            • default
      • modules
      • net
        • amazon
          • s3
        • http
        • net
          • geo
            • ip
      • plugins
      • reports
        • aging
          • invoices
        • client
          • data
            • portability
        • custom
          • report
        • invoice
          • creation
        • package
          • revenue
        • tax
          • liability
        • transactions
          • applied
          • received
      • security
      • session
        • cart
      • settingscollection
      • upgrades
        • tasks
      • upload
      • vcard
    • core
      • Automation
        • Tasks
          • Common
          • Task
        • Type
          • Common
          • Cron
      • Pricing
        • ItemComparator
        • MetaItem
        • Modifier
          • Type
            • Description
              • Type
                • Discount
                • Option
                • Service
                • Tax
            • Discount
            • Price
            • Proration
        • Presenter
          • Build
            • Invoice
            • InvoiceData
            • Options
            • Service
            • ServiceChange
            • ServiceData
          • Collection
          • Format
            • Fields
            • Type
              • Discount
              • Item
              • Option
              • Options
              • Package
              • Pricing
              • Service
              • Tax
          • Items
            • Invoice
            • Service
          • Type
      • ServiceProviders
      • Util
        • Captcha
          • Captchas
          • Common
        • Common
          • Traits
        • Events
          • Common
          • Handlers
          • Observers
        • Filters
          • Common
        • GeoIp
        • Input
          • Fields
            • Common
        • Tax
        • Widgets
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
      • widget
        • client
  • minPHP
    • helpers
      • color
      • data
        • structure
  • None
  • PHP

Classes

  • ExchangeRate
  • ExchangeRates
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

Class ExchangeRate

Abstract class that all Currency Exchange Rate Processors must extend

Direct known subclasses

CurrencyLayer, Fixer, OpenExchangeRates, XRates
Abstract
Package: blesta\components\exchange\rates
Copyright: Copyright (c) 2010-2017, Phillips Data, Inc.
License: The Blesta License Agreement
Link: Blesta
Located at components/exchange_rates/exchange_rate.php
Methods summary
abstract public
# __construct( Http $Http )

Initializes the exchange rate processor

Initializes the exchange rate processor

Parameters

$Http
The Http component to more easily facilitate HTTP requests to fetch data
abstract public mixed
# getRate( string $currency_from, string $currency_to, float $amount = 1.0 )

Fetches the exchange rate from currency A to currency B using the given amount

Fetches the exchange rate from currency A to currency B using the given amount

Parameters

$currency_from
The ISO 4217 currency code to convert from
$currency_to
The ISO 4217 currency code to convert to
$amount
The amount to convert

Returns

mixed

(bool) false on error or an array containing the exchange rate information including:

  • rate
  • updated The date/time of the last update in YYYY-MM-DD HH:MM:SS format in UTC time
public boolean
# requiresKey( )

Determines whether an API key is necessary to retrieve exchange rates via the processor

Determines whether an API key is necessary to retrieve exchange rates via the processor

Returns

boolean
True if an API key is required, or false otherwise
public
# setKey( string $key )

Sets the API key necessary to retrieve exchange rates

Sets the API key necessary to retrieve exchange rates

Parameters

$key
The key for the exchange rate processor API
protected array
# convertRates( string $to_currency, array $rates )

Updates all currency rates given to convert the rates relative to the given currency

Updates all currency rates given to convert the rates relative to the given currency

Parameters

$to_currency
The ISO 4217 currency code to convert relative to
$rates
A key/value list of all currencies and their rates. The $to_currency must be in the list

Returns

array
A key/value list of all currency exchange rates
Properties summary
protected string $key

The API key

The API key

#
Blesta API documentation generated by ApiGen