talks/ifsc/releases/0.2.a.md

46 lines
1.4 KiB
Markdown
Raw Normal View History

2020-02-05 13:52:20 +00:00
0.2.10
## Updates
- No metadata changes
- Adds the new `IFSC\Client` class for lookups on the IFSC API (runnning at ifsc.razorpay.com).
## Installation
You will need to have a valid package that provides `php-http/client-implementation`. A complete list of such packages is available at [packagist](https://packagist.org/providers/php-http/client-implementation).
The tl;dr version of it is:
`composer require php-http/curl-client guzzlehttp/psr7 php-http/message`
You can read more about how it works at http://docs.php-http.org/en/latest/httplug/users.html
## API Documentation
```php
use Razorpay\IFSC\Client;
$client = new Client();
$res = $client->lookupIFSC('KKBK0000261');
echo $res->bank; // 'KOTAK MAHINDRA BANK LIMITED'
echo $res->branch; // 'GURGAON'
echo $res->address; // 'JMD REGENT SQUARE,MEHRAULI GURGAON ROAD,OPPOSITE BRISTOL HOTEL,'
echo $res->contact; // '4131000'
echo $res->city; // 'GURGAON'
echo $res->district; // 'GURGAON'
echo $res->state; // 'HARYANA'
echo $res->getBankCode(); // KKBK
echo $res->getBankName(); // 'Kotak Mahindra Bank'
// lookupIFSC may throw `Razorpay\IFSC\Exception\ServerError`
// in case of server not responding in time
// or Razorpay\IFSC\Exception\InvalidCode in case
// the IFSC code is invalid
```
Here is a siamese cat:
![siamese-468814_640](https://cloud.githubusercontent.com/assets/584253/23647044/c6244582-0339-11e7-8a09-d5e80b0587e7.jpg)