@@ -44,7 +44,8 @@ export class PlaidIntegration {
4444 baseOptions : {
4545 headers : {
4646 'PLAID-CLIENT-ID' : this . plaidConfig . credentials . clientId ,
47- 'PLAID-SECRET' : this . plaidConfig . credentials . secret
47+ 'PLAID-SECRET' : this . plaidConfig . credentials . secret ,
48+ 'Plaid-Version' : '2020-09-14' ,
4849 }
4950 }
5051 } )
@@ -80,9 +81,11 @@ export class PlaidIntegration {
8081 let server : http . Server
8182
8283 app . post ( '/get_access_token' , ( req , res ) => {
84+ console . log ( req . body . public_token )
8385 if ( req . body . public_token !== undefined ) {
8486 client . itemPublicTokenExchange ( { public_token : req . body . public_token } ) . then ( res => {
8587 this . savePublicToken ( res . data )
88+ console . log ( res . data )
8689 resolve ( logInfo ( 'Plaid access token saved.' , req . body ) )
8790 } )
8891 } else if ( req . body . exit !== undefined ) {
@@ -135,6 +138,7 @@ export class PlaidIntegration {
135138 const result = await this . client . linkTokenCreate ( options )
136139
137140 res . json ( { link_token : result . data . link_token } )
141+ console . log ( result . data . link_token )
138142 } )
139143 app . post ( '/remove' , async ( req , res ) => {
140144 try {
@@ -210,6 +214,7 @@ export class PlaidIntegration {
210214 }
211215 return resolve ( { accounts : response . data . accounts , transactions : transactions } )
212216 } catch ( e ) {
217+ console . log ( e )
213218 return reject ( e )
214219 }
215220 } )
0 commit comments