From c47f23b1305d65a381784031e0418329f943ba2a Mon Sep 17 00:00:00 2001 From: priyankamarabill Date: Wed, 6 Nov 2024 13:00:44 +0530 Subject: [PATCH] XNSE ifsc added --- src/banks.json | 7 ++++++- tests/node/client_test.js | 25 +++++++++++++++++++++++++ tests/php/BankNameTest.php | 9 +++++++++ tests/php/SubletTest.php | 7 +++++++ tests/ruby/bank_spec.rb | 9 +++++++++ tests/ruby/ifsc_spec.rb | 1 + 6 files changed, 57 insertions(+), 1 deletion(-) diff --git a/src/banks.json b/src/banks.json index 059901b0..ca0b33c9 100644 --- a/src/banks.json +++ b/src/banks.json @@ -14804,6 +14804,11 @@ "type": "RRB", "upi": true }, + "XNSE": { + "code": "XNSE", + "ifsc": "XNSE0000001", + "micr": null + }, "YADX": { "code": "YADX", "ifsc": "YESB0YDC001", @@ -15115,4 +15120,4 @@ "nach_debit": false, "type": "DCCB" } -} \ No newline at end of file +} diff --git a/tests/node/client_test.js b/tests/node/client_test.js index 85957ce7..9deea216 100644 --- a/tests/node/client_test.js +++ b/tests/node/client_test.js @@ -37,3 +37,28 @@ ifsc.fetchDetails('HDFC0CAGSBK') console.error(err); process.exit(1); }) + +ifsc + .fetchDetails('XNSE0000001') + .then(function(res) { + assert.equal('EXCHANGE PLAZA,PLOT NO C/1, G BLOCK,BANDRA-KURLA COMPLEX,BANDRA (E), MUMBAI 400051',res['ADDRESS']) + assert.equal('NSE Clearing Limited',res['BANK']) + assert.equal('XNSE',res['BANKCODE']) + assert.equal('MUMBAI',res['BRANCH']) + assert.equal('MUMBAI',res['CENTRE']) + assert.equal('MUMBAI',res['CITY']) + assert.equal('MUMBAI',res['DISTRICT']) + assert.equal('XNSE0000001',res['IFSC']) + assert.equal('MAHARASHTRA',res['STATE']) + assert.equal(null,res['MICR']) + assert.equal(false,res['UPI']) + assert.equal(false,res['NEFT']) + assert.equal(false,res['IMPS']) + assert.equal(true,res['RTGS']) + assert.equal(null,res['SWIFT']) + assert.equal("IN-MH",res['ISO3166']) + }) + .catch(err => { + console.error(err); + process.exit(1); + }) diff --git a/tests/php/BankNameTest.php b/tests/php/BankNameTest.php index 6a49d4bb..d9f37cb7 100644 --- a/tests/php/BankNameTest.php +++ b/tests/php/BankNameTest.php @@ -9,6 +9,7 @@ class Name extends TestCase public function testDefined() { $this->assertEquals('PUNB', constant('Razorpay\IFSC\Bank::PUNB')); $this->assertEquals('BDBL', constant('Razorpay\IFSC\Bank::BDBL')); + $this->assertEquals('XNSE', constant('Razorpay\IFSC\Bank::XNSE')); $this->assertEquals('BDBL', Bank::BDBL); } @@ -43,5 +44,13 @@ public function testBankDetails() { 'name' => 'Fino Payments Bank', 'bank_code' => '099' ], Bank::getDetails('FINO')); + + $this->assertEqualsCanonicalizing([ + 'code' => 'XNSE', + 'ifsc' => 'XNSE0000001', + 'micr' => null, + 'name' => 'NSE Clearing Limited', + 'bank_code' => null + ], Bank::getDetails('XNSE')); } } diff --git a/tests/php/SubletTest.php b/tests/php/SubletTest.php index 21cf3e43..087ca835 100644 --- a/tests/php/SubletTest.php +++ b/tests/php/SubletTest.php @@ -22,6 +22,13 @@ public function testBasicNames() $this->assertEquals("Darjeeling District Central Co-operative Bank", $name); } + public function testXNSE() + { + $name = IFSC::getBankName('XNSE0000001'); + + $this->assertEquals("NSE Clearing Limited", $name); + } + /** * Ensure that the sublet list only * includes genuine subleases diff --git a/tests/ruby/bank_spec.rb b/tests/ruby/bank_spec.rb index 0ac6dbca..cf1290ce 100644 --- a/tests/ruby/bank_spec.rb +++ b/tests/ruby/bank_spec.rb @@ -19,6 +19,15 @@ ach_debit: true, nach_debit: true) end + it 'should return details from the bank code' do + expect(described_class.get_details(:XNSE)).to eq(code: 'XNSE', + type: 'XNSE', + upi: true, + ifsc: 'XNSE0000001', + micr: null, + bank_code: null, + ) + end it 'should match all constants defined in banknames.json' do JSON.parse(File.read('src/banknames.json')).keys.each do |c| diff --git a/tests/ruby/ifsc_spec.rb b/tests/ruby/ifsc_spec.rb index 2d443f93..ac0cabb8 100644 --- a/tests/ruby/ifsc_spec.rb +++ b/tests/ruby/ifsc_spec.rb @@ -78,6 +78,7 @@ expect(described_class.bank_name_for('KSCB0006001')).to eq 'Tumkur District Central Bank' expect(described_class.bank_name_for('WBSC0KPCB01')).to eq 'Kolkata Police Co-operative Bank' expect(described_class.bank_name_for('YESB0ADB002')).to eq 'Amravati District Central Co-operative Bank' + expect(described_class.bank_name_for('XNSE0000001')).to eq 'NSE Clearing Limited' end end