Skip to content

Commit

Permalink
Merge pull request #244 from razorpay/release/2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemo authored Aug 31, 2021
2 parents 4b36689 + eef3c8b commit c940f0c
Show file tree
Hide file tree
Showing 23 changed files with 111 additions and 49 deletions.
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ insert_final_newline = true
indent_style = space
indent_size = 4

[**.js, *.json]
[**.js, *.json, **.rb]
indent_style = space
indent_size = 2

[*.go]
indent_style = tab
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.go @gyanesh-m
.rb @captn3m0
6 changes: 0 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ updates:
interval: weekly
time: "04:00"
timezone: Asia/Calcutta
- package-ecosystem: mix
directory: "/"
schedule:
interval: weekly
time: "04:00"
timezone: Asia/Calcutta
- package-ecosystem: composer
directory: "/"
schedule:
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/scraper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,30 @@ jobs:
with:
name: release-artifact
path: scraper/scripts/data
- name: Extract artifact
run: gunzip by-bank.tar.gz
working-directory: scraper/scripts/data
- run: phpunit -d memory_limit=-1
env:
RUN_DATASET_TESTS: true
release-notes:
needs: scraper
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: shivammathur/setup-php@v2
with:
php-version: 8.0
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: release-artifact
path: scraper/scripts/data
- name: Run release script
run: bash release.sh
working-directory: scraper/scripts
- name: Save Release Notes
uses: actions/upload-artifact@v2
with:
name: release-notes.md
path: scraper/scripts/release.md
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,17 @@ mix.lock
.yardoc
Gemfile.lock
InstalledFiles
.wercker

# One-off scripts
*.php
tmp/

# Code coverage reports
*.cov

# IDE files
.idea/*

# Temp files
.*~

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ All notable changes to this project will be documented in this file. The format
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [UNRELEASED][unreleased]

## [2.0.0][2.0.0]
### Removed
- Removed support for Elixir package
### Changed
- Builds are now powered by GitHub Actions, instead of Wercker
### Added
- There is a supported golang SDK. See the README for instructions on how to use it.
- 1 New Bank: `"AHDC": "Ahmednagar District Central Co-operative Bank"`

## [1.6.1][1.6.1]
### Added
Expand Down
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,21 @@ The minimum [PHP version supported is 7.2](https://endoflife.date/php).

## Go

`$ go get -u github.com/razorpay/ifsc`
This package is compatible with modern Go releases in module mode, with Go installed:

To use the go pkg, the import path should be:
`go get github.com/razorpay/ifsc/v2`

```go
import "github.com/razorpay/ifsc/src/go"
```
will resolve and add the package to the current development module, along with its dependencies.

Alternatively the same can be achieved if you use import in a package:

`import "github.com/razorpay/ifsc/v2/src/go"`

and run go get without parameters.

Finally, to use the top-of-trunk version of this repo, use the following command:

`go get github.com/razorpay/ifsc/v2@master`

## Support Matrix

Expand Down Expand Up @@ -353,7 +361,6 @@ func main() {

```

>>>>>>> 5ff434d (update readme & make bank code constants.)
### Code Notes

Both the packages ship with a 300kb JSON file, that
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/razorpay/ifsc
module github.com/razorpay/ifsc/v2

go 1.15
go 1.16

require github.com/stretchr/testify v1.7.0
4 changes: 2 additions & 2 deletions ifsc.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

Gem::Specification.new do |s|
s.name = 'ifsc'
s.version = '1.6.1'
s.date = '2021-07-09'
s.version = '2.0.0'
s.date = '2021-08-12'
s.summary = 'IFSC code database to help you validate IFSC codes'
s.description = 'A simple gem by @razorpay to help you validate your IFSC codes. IFSC codes are bank codes within India'
s.authors = ['Abhay Rana', 'Nihal Gonsalves']
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ifsc",
"version": "1.6.1",
"version": "2.0.0",
"description": "This is part of the IFSC toolset released by Razorpay. You can find more details about the entire release at [ifsc.razorpay.com](https://ifsc.razorpay.com). Includes only a validation library as of now.",
"main": "src/node/index.js",
"directories": {
Expand Down
10 changes: 5 additions & 5 deletions scraper/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ GEM
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2021.0704)
mini_portile2 (2.5.3)
mini_portile2 (2.6.1)
multi_xml (0.6.0)
nokogiri (1.11.7)
mini_portile2 (~> 2.5.0)
nokogiri (1.12.4)
mini_portile2 (~> 2.6.1)
racc (~> 1.4)
racc (1.5.2)
ruby-ole (1.2.12.2)
rubyXL (3.4.17)
rubyXL (3.4.18)
nokogiri (>= 1.10.8)
rubyzip (>= 1.3.0)
rubyzip (2.3.2)
Expand All @@ -31,4 +31,4 @@ DEPENDENCIES
spreadsheet

BUNDLED WITH
2.2.22
2.2.26
5 changes: 3 additions & 2 deletions scraper/scripts/methods_nach.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ def bank_data(bank_code, data, _ifsc)

def parse_upi
doc = Nokogiri::HTML(open('upi.html'))
header_cleared = false
count = doc.css('table>tbody')[0].css('tr').size
# We count the unique number of banks mentioned in the table
# Since sometimes NPCI will repeat banks
count = doc.css('table>tbody')[0].css('tr').map{|e| e.css('td')[1].text.strip}.uniq.size

upi_patch_filename = '../../src/patches/banks/upi-enabled-banks.yml'
# Count the number of banks we have in our UPI patch file:
Expand Down
2 changes: 1 addition & 1 deletion src/IFSC.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/banknames.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"AGSX": "Agrasen Nagari Sahakari Bank",
"AGUX": "Agartala Co-operative Urban Bank",
"AGVX": "Assam Gramin Vikash Bank",
"AHDC": "Ahmednagar District Central Co-operative Bank",
"AHMX": "Ahmednagar District Central Co-operative Bank",
"AHUX": "Ahilyadevi Urban Co-operative Bank Limited Solapur",
"AIRP": "Airtel Payments Bank",
Expand Down Expand Up @@ -1266,6 +1267,7 @@
"TKUX": "Karan Urban Co-operative Bank",
"TLPX": "Lunawada Peoples Co-operative Bank",
"TMAX": "Madanapalle Co-operative Town Bank",
"TBMC": "Banaskantha Mercantile Co-operative Bank",
"TMBL": "Tamilnadu Mercantile Bank",
"TMBX": "Mangalore Catholic Co-operative Bank",
"TMCX": "Motihari Central Co-operative Bank",
Expand Down
33 changes: 19 additions & 14 deletions src/banks.json
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,8 @@
"apbs": true,
"ach_credit": true,
"ach_debit": false,
"nach_debit": false
"nach_debit": false,
"upi": true
},
"BDIX": {
"code": "BDIX",
Expand Down Expand Up @@ -1645,8 +1646,7 @@
"apbs": true,
"ach_credit": true,
"ach_debit": true,
"nach_debit": false,
"upi": true
"nach_debit": false
},
"BKDX": {
"code": "BKDX",
Expand Down Expand Up @@ -3069,7 +3069,8 @@
"apbs": false,
"ach_credit": true,
"ach_debit": false,
"nach_debit": false
"nach_debit": false,
"upi": true
},
"DIBX": {
"code": "DIBX",
Expand Down Expand Up @@ -4036,7 +4037,8 @@
"apbs": true,
"ach_credit": true,
"ach_debit": true,
"nach_debit": false
"nach_debit": false,
"upi": true
},
"HCBX": {
"code": "HCBX",
Expand Down Expand Up @@ -7084,7 +7086,8 @@
"apbs": true,
"ach_credit": true,
"ach_debit": true,
"nach_debit": false
"nach_debit": false,
"upi": true
},
"MBLX": {
"code": "MBLX",
Expand Down Expand Up @@ -8432,7 +8435,8 @@
"apbs": true,
"ach_credit": true,
"ach_debit": true,
"nach_debit": false
"nach_debit": false,
"upi": true
},
"NNCX": {
"code": "NNCX",
Expand Down Expand Up @@ -11308,7 +11312,8 @@
"apbs": true,
"ach_credit": true,
"ach_debit": true,
"nach_debit": false
"nach_debit": false,
"upi": true
},
"SNCX": {
"code": "SNCX",
Expand Down Expand Up @@ -11486,7 +11491,8 @@
"apbs": true,
"ach_credit": true,
"ach_debit": true,
"nach_debit": false
"nach_debit": false,
"upi": true
},
"SPSX": {
"code": "SPSX",
Expand Down Expand Up @@ -12018,8 +12024,7 @@
"apbs": true,
"ach_credit": true,
"ach_debit": true,
"nach_debit": true,
"upi": true
"nach_debit": true
},
"TACX": {
"code": "TACX",
Expand Down Expand Up @@ -12641,7 +12646,8 @@
"apbs": false,
"ach_credit": true,
"ach_debit": true,
"nach_debit": false
"nach_debit": false,
"upi": true
},
"TKDX": {
"code": "TKDX",
Expand Down Expand Up @@ -13911,8 +13917,7 @@
"apbs": true,
"ach_credit": true,
"ach_debit": true,
"nach_debit": false,
"upi": true
"nach_debit": false
},
"VHDX": {
"code": "VHDX",
Expand Down
2 changes: 1 addition & 1 deletion src/go/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/http"
"testing"

"github.com/razorpay/ifsc/src/go/mocks"
"github.com/razorpay/ifsc/v2/src/go/mocks"
"github.com/stretchr/testify/assert"
)

Expand Down
4 changes: 4 additions & 0 deletions src/go/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const (
AGSX = "AGSX"
AGUX = "AGUX"
AGVX = "AGVX"
AHDC = "AHDC"
AHMX = "AHMX"
AHUX = "AHUX"
AIRP = "AIRP"
Expand Down Expand Up @@ -1217,6 +1218,7 @@ const (
TBCX = "TBCX"
TBDX = "TBDX"
TBHX = "TBHX"
TBMC = "TBMC"
TBMX = "TBMX"
TBNS = "TBNS"
TBPX = "TBPX"
Expand Down Expand Up @@ -1494,6 +1496,7 @@ var bankCodes = map[string]bool{
"AGSX" : true,
"AGUX" : true,
"AGVX" : true,
"AHDC" : true,
"AHMX" : true,
"AHUX" : true,
"AIRP" : true,
Expand Down Expand Up @@ -2678,6 +2681,7 @@ var bankCodes = map[string]bool{
"TBCX" : true,
"TBDX" : true,
"TBHX" : true,
"TBMC" : true,
"TBMX" : true,
"TBNS" : true,
"TBPX" : true,
Expand Down
2 changes: 2 additions & 0 deletions src/node/bank.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module.exports = Object.freeze({
AGSX: 'AGSX',
AGUX: 'AGUX',
AGVX: 'AGVX',
AHDC: 'AHDC',
AHMX: 'AHMX',
AHUX: 'AHUX',
AIRP: 'AIRP',
Expand Down Expand Up @@ -1212,6 +1213,7 @@ module.exports = Object.freeze({
TBCX: 'TBCX',
TBDX: 'TBDX',
TBHX: 'TBHX',
TBMC: 'TBMC',
TBMX: 'TBMX',
TBNS: 'TBNS',
TBPX: 'TBPX',
Expand Down
Loading

0 comments on commit c940f0c

Please sign in to comment.