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以外にさらにいくつかの銀行APIを構築します。その後、すべてを支配する1つの統一APIを作成できるかどうかを確認し、暗闇の中でそれらを結合します。
GNU General Public License v3.0 -Copyright(c)2018 Bruno Dos Santos Carvalhal( LICENSE.md参照)