Download the PHP package ivashchukk/pkbp-rates without Composer

On this page you can find all versions of the php package ivashchukk/pkbp-rates. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pkbp-rates

PKO BP Rates

Tests Latest Version on Packagist Buy Me a Coffee

Small PHP client for PKO BP exchange rates.

It is built for application code that needs conversions like DKK to EUR or EUR to PLN. Amounts are passed around as integer minor units, so 100_00 means 100.00 for currencies with two decimal places.

Install

Convert Money

The result is rounded to the target currency minor unit with half-up rounding.

Use Decimal Input

If you receive human-readable amounts from forms or imports, use Money:

Money::ofMinor(10000, Currency::EUR) and Money::ofDecimal('100.00', Currency::EUR) represent the same amount.

PLN Examples

PLN works like any other currency in the public API.

Rates

For direct PKO BP PLN multipliers:

The default is PKO BP sale_foreign. PKO values quoted for units like 100 HUF or 100 JPY are normalized to a per-unit rate.

Strings Are Accepted

Typed currency constants are usually nicer:

Strings are useful when the code comes from a request, database, or config:

Dates

Passing null as the date means today in Europe/Warsaw. If PKO BP has no table for that day, the client looks back up to 10 calendar days.

Error Handling

Package exceptions:

HTTP Client

PkbpRatesClient::create() uses Guzzle. To inject your own HTTP stack, pass PSR-18 and PSR-17 implementations:

Development

Generate a local coverage file:

Live tests are skipped unless enabled:


All versions of pkbp-rates with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
brick/math Version ^0.18
guzzlehttp/guzzle Version ^7.10
psr/http-client Version ^1.0
psr/http-factory Version ^1.1
psr/http-message Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ivashchukk/pkbp-rates contains the following files

Loading the files please wait ...