open psd2
1.0.0
这是使用各种银行的开放银行API的图书馆。这些API是针对PSD2法规构建的,但它们彼此不兼容。因此,我已经启动了此软件包。随时提交公关并帮助建立此软件包!
这个软件包仍在进行中!欢迎所有贡献者。如果您有任何疑问,请随时提交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之外,首先建立了更多的银行API。之后,查看我们是否可以创建一个统一的API,将它们全部统治它们并在黑暗中绑定它们。
GNU通用公共许可证v3.0-版权(c)2018 Bruno dos Santos Carvalhal(请参阅LICENSE.md )