Download the PHP package byrokrat/banking without Composer

On this page you can find all versions of the php package byrokrat/banking. 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 banking

Banking

Packagist Version Build Status Quality Score

Data types and factories for bank accounts in the swedish banking system, Handelsbanken, ICA-banken, Nordea, SEB, Skandiabanken, Swedbank, PlusGirot, Bankgirot among others.

Introduction

Banking provides a way of parsing and validating bank account numbers from the swedish banking system. It validates clearing numbers, the structure of the account number as well as check digits. It also defines value objects for account numbers, with formatting capabilities and methods for accessing the different parts of the account number and to identify the bank the number belongs to.

Installation

Banking has no user land dependencies.

Usage

The main entry point is the AccountFactory that is used to create AccountNumber objects.

The standard factory does its best to recognize different number formats.

  1. Spaces, hyphens and dots are ignored.
  2. An optional , delimiter between clearing and serial numbers may be used.
  3. Misplaced clearing-serial delimiters are ignored.

The following account numbers are all valid and considered equal to the account number of the previous example.

Making the factory stricter

For a factory that only allows digits and correctly placed clearing-serial delimiters (,) pass an instance of StrictFactory as the first argument to AccountFactory::__construct().

Rewrites

When parsing an account number fails the standard factory attempts rewriting it to see if a valid account number can be produced.

  1. It tries to interpret the first digit of the serial number as a clearing check digit.
  2. It tries to trim left side ceros from the serial number.
  3. It tries to prepend the clearing number 3300 to see if the account number is a valid Nordea personal account number.

If any of the rewrites (or any combination of rewrites) is successful the rewritten number is used. Opt out of this behaviour by passing an empty RewriterContainer as the second argument to AccountFactory::__construct().

Clearing number check digits for Swedbank accounts

Swedbank account numbers with clearing numbers starting with 8 may specify a fifth clearing number check digit. The clearing number check digit is optional, but if present the parser will use it to validate the clearing number.

Please note that if the clearing check digit is 0 and no comma (,) is used to separate the clearing and serial numbers the parser may not understand that the 0 is part of the clearing number, resulting in data loss. For this reason it is a good habit to always use a comma to separate the clearing and serial numbers.

Catching parser errors

When parsing fails an exception is thrown. Inspect the exception message for an in-depth description of the parser stages and where the error occurred.

Outputs something like:

Parsing Bankgiro and PlusGiro accounts

Use BankgiroFactory or PlusgiroFactory to parse bankgiro and plusgiro account numbers. (As of version 2.0 it is no longer possible to parse bankgiro or plusgiro account numbers using the regular AccountFactory.)

Note that the - delimiter is optional when parsing Bankgiro and PlusGiro account numbers. When omitted it may not be possible determine if the raw number is indeed a Bankgiro or PlusGiro account number: 5805-6201 is a valid Bankgiro number and 5805620-1 is a valid PlusGiro number.

Creating a factory that can parse both regular accounts and bankgiro or plusgiro accounts

Use DelegatingFactory the create a factory that incorporates the functionality of one or more factories in a single object.

The AccountNumber API

Created account objects implement the AccountNumber interface, which defines the following api.

getBankName()

Gets the name of the bank a number belongs to (for a list of bank identifiers see BankNames).

getRawNumber()

Gets the raw and unformatted number.

getNumber()

Gets a formatted permutation of account number. Using PHPs magical __tostring() method calls getNumber() internaly.

prettyprint()

Gets a formatted permutation of account number with more eye candy.

get16()

Gets the generic 16 digit format as defined by BGC.

getClearingNumber(), getClearingCheckDigit(), getSerialNumber() and getCheckDigit()

Gets the extracted account number parts.

equals()

Validates that two account objects represents the same number.


All versions of banking with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
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 byrokrat/banking contains the following files

Loading the files please wait ....