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 )