Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fourcube/openiban.js
openiban.com javascript client for node and the browser
https://github.com/fourcube/openiban.js
Last synced: about 2 months ago
JSON representation
openiban.com javascript client for node and the browser
- Host: GitHub
- URL: https://github.com/fourcube/openiban.js
- Owner: fourcube
- Fork: true (apilayer/openiban.js)
- Created: 2019-07-31T07:22:10.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2018-07-31T12:02:00.000Z (over 6 years ago)
- Last Synced: 2024-04-23T20:42:41.865Z (9 months ago)
- Language: JavaScript
- Size: 47.9 KB
- Stars: 12
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# openiban.js
## Service Shutdown Notice
The openiban API will cease operation on the 24th of May, 10 p.m. GMT.
You can read more about it at https://openiban.com.
**Important**: I will continue to maintain the `goiban-service` repository.
[![Build Status](https://travis-ci.org/fourcube/openiban.js.svg)](https://travis-ci.org/fourcube/openiban.js) [![npm version](https://img.shields.io/npm/v/openiban.svg)](https://www.npmjs.com/package/openiban)
Official [openiban.com](https://openiban.com) API client for node and the browser. TypeScript typings are included in the repository.
# Getting it
You can install openiban.js through npm or yarn.
`npm i -S openiban`
or
`yarn add openiban`
Or you can include it on your page through a CDN (e.g. unpkg):
```html
```
# Using it
openiban.js provides a Promise API to the openiban.com IBAN validation webservice.
## Node.js
```js
const Openiban = require('openiban');openiban
.validate('DE89370400440532013000')
.then((result) => {
// result.valid should be true
})
.catch((err) => {
// some http error has occurred
});
```## Typescript
openiban.js also publishes Typescript declarations.
```typescript
import * as Openiban from 'openiban';Openiban.validate('DE89370400440532013000')
.then((r: ValidationResult) => {
console.log(r);
// {
// "valid": true,
// "messages": [
// "Bank code valid: 37040044"
// ],
// "iban": "DE89370400440532013000",
// "bankData": {
// "bankCode": "37040044",
// "name": "Commerzbank",
// "zip": "50447",
// "city": "Köln",
// "bic": "COBADEFFXXX"
// },
// "checkResults": {
// "bankCode": true
// }
// }
})
.catch((e) => {
// some http error has occurred
console.error(e);
})
```## Browser
When `openiban.js` is loaded inside your browser, it will be available through the global variable `Openiban`.
```html
Openiban
.validate('DE89370400440532013000')
.then((result) => {
// result.valid should be true
})
.catch((err) => {
// some http error has occurred
});
```