-
Notifications
You must be signed in to change notification settings - Fork 138
PHP Client
Nemo edited this page Feb 28, 2017
·
1 revision
<?php
use Razorpay\IFSC\IFSC;
use Razorpay\IFSC\Bank;
use Razorpay\IFSC\Client;
IFSC::validate('KKBK0000261'); // Returns true
IFSC::validate('BOTM0XEEMRA'); // Returns false
IFSC::validateBankCode('PUNB'); // Returns true
IFSC::validateBankCode('ABCD'); // Returns false
IFSC::getBankName('PUNB'); // Returns 'Punjab National Bank'
IFSC::getBankName('ABCD'); // Returns null
IFSC::getBankName(Bank::PUNB); //Returns Punjab National Bank
// We also provide a HTTP Client that talks to the API at ifsc.razorpay.com
$client = new Client;
$ifsc = client->lookupIFSC('KKBK0000261');
$ifsc->getBankName(); // "Kotak Mahindra Bank"
$ifsc->getBankCode(); // KKBK
$ifsc->bank; //
$ifsc->branch; // GURGAON
$ifsc->address; // "JMD REGENT SQUARE,MEHRAULI GURGAON ROAD,OPPOSITE BRISTOL HOTEL,"
$ifsc->contact; // "4131000"
$ifsc->city; // "GURGAON"
$ifsc->district; //"GURGAON"
$ifsc->state; // "HARYANA"
$ifsc
will be an instance of the Razorpay\IFSC\Entity class.