open psd2
1.0.0
이것은 다양한 은행의 오픈 뱅킹 API를 사용하기위한 도서관입니다. 이 API는 PSD2 규정을 위해 구축되었지만 서로 호환되지 않습니다. 따라서이 패키지를 시작했습니다. PR을 제출 하고이 패키지를 구축하는 데 도움을주십시오!
이 패키지는 여전히 진행중인 작업 입니다! 모든 기고자들은 환영합니다. 질문이 있으시면 PR을 제출하거나 Github에 메시지를 보내주십시오.
다음을 실행하십시오.
npm install
다음과 같이 필요한 은행 API를 가져옵니다.
import { ING } from "open-psd2" ;인증서를 사용하여 새 인스턴스를 만듭니다.
const ing = new ING ( true , fs . readFileSync ( "./secrets/example_client_signing.key" ) , "changeit" , fs . readFileSync ( "./secrets/example_client_tls.cer" ) , fs . readFileSync ( "./secrets/example_client_tls.key" ) , "example_client_id" ) ;그런 다음 내장 기능을 사용하여 데이터를 요청할 수 있습니다. ING API의 경우 액세스 토큰과 고객 액세스 토큰을 모두 요청해야합니다. 이 예에서는 샌드 박스를 사용하고 있으므로 사용자 인증 코드가 필요하지 않습니다.
app . get ( '/accounts' , function ( req , res ) {
ing . requestAccessToken ( "view_balance" ) . then ( access_token => {
ing . requestCustomerAccessToken ( null , access_token ) . then ( ( customer_access_token ) => {
ing . requestAccounts ( customer_access_token ) . then ( accounts => {
res . send ( accounts ) ;
} ) . catch ( ( error ) => { res . send ( "Could not retrieve accounts" ) ; console . log ( error ) ; } ) ;
} ) . catch ( ( error ) => { res . send ( "Could not retrieve customer access token" ) ; console . log ( error ) ; } ) ;
} ) . catch ( ( error ) => { res . send ( "Could not retrieve access token" ) ; console . log ( error ) ; } ) ;
} ) ; 향후 개발을 위해 다음을 계획합니다. 먼저 ING API 외에 Bank API를 더 구축하십시오. 그 후, 우리가 그들 모두를 지배하는 하나의 통일 API를 만들 수 있는지 확인하십시오.
GNU General Public License v3.0 -Copyright (C) 2018 Bruno Dos Santos Carvalhal ( LICENSE.md 참조)