mirror of
https://github.com/captn3m0/talks.git
synced 2024-09-28 22:22:56 +00:00
1.4 KiB
1.4 KiB
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.
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
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: