Stucked with plaid and dwolla integration

Hello Team,
I very new to both plaid and dwolla and I am stuck with one error. I am using plaid link and able to select an institution and get public token, which according to documentation should be exchanged for access_token. I called plaid’s ‘exchangePublicToken’ then pass public token from link. Inside the callback function, I tried to get processor_token by calling plaid’s ‘createProcessorToken’ function, but the response object is undefined. Please see my code below.
`
server.post(’/get_access_token’, function(req,res,next){

PLAID_PUBLIC_TOKEN = req.body.public_token; //from plaid link selection

plaidClient.exchangePublicToken(PLAID_PUBLIC_TOKEN, function(err, res) {

const accessToken = res.access_token;

ACCOUNTID = res.item_id;

// Create a processor token for a specific account id.

plaidClient.createProcessorToken(

accessToken,

ACCOUNTID,

'dwolla',

function(err, response) {

  const processorToken = response.processor_token;**// error occurs here => cannot read property 'processor_token' or undefined.** 

  //TODO: do something with account selection.

  return handle( req,response);

}

);

});

});
`
Please any help will be helpful. Code sample will be great.

I am facing the same problem. The response is undefined.

@dari_donkuro Also, I am not 100% sure but I think accountId is not the same as itemId.

Plaid’s documentation states,

" The Link module returns a ‘public_token’ and an ‘account_id’ (a property on the ‘metadata’ object) via the ‘onSuccess` callback’."

Check out the onSuccess callback parameter reference (accounts parameter under metadata object) in Plaid’s documentation: https://plaid.com/docs/#parameter-reference.
You should be able to get the accountId from there and make sure you include that in the request body along with the public_token.

Hope that helps you prevent other errors that you might’ve encountered in the future.

1 Like

Thank you. I am no more getting error, but the response is still empty, as well as the error parameter, so, it’s difficult to know what’s wrong.

Same. I am also getting an undefined response and it’s not clear as to what’s causing it. Hopefully, someone from the team will address it tomorrow.

Hello team,

My code and console outputs are below for reference.

Hi @nparajul – thanks for the detailed post with the response. I’m not aware of any changes with the Plaid + Dwolla integration, but I can look around to see if something has changed on Plaid’s end.

Sometimes, pretty printing the response has worked for me in the past, like in the following example. Hope it’s just that! :crossed_fingers:

client.createProcessorToken(
        ACCESS_TOKEN,
        ACCOUNT_ID,
        'dwolla',
        function(err, res) {
          if(err != null){
            prettyPrintResponse(err);
          } else {
            prettyPrintResponse(res);
            const processorToken = res.processor_token;
          }
        }
      ); 
1 Like

@dari_donkuro I was able to solve the issue. I forgot to enable Dwolla integration in Plaid’s dashboard. Hopefully that solves your issue too. Link: https://dashboard.plaid.com/team/integrations

@shreya Thank you for your help.

1 Like

Thanks for following with the update, Nitesh! Glad you were able to help resolve this!

Oh, I thought you did that already. My issue is different then, because, I enabled dwolla long time ago, before I even get to this phase in the integration.dwolla

Good luck with the rest of word!!

I finally resolved my issue. I think my issue was related to account_id as you pointed out, but it did not immediate get rid of the error after I made the correction, but today it worked out nicely without anything done.
I completed all six steps in the plaid & dwolla integration, but I do not know what to do next. For example now that I have processor token and account id, how do I move forward from here? I suspect from here I need to call dwolla API, but I don’t know where to start.
Any suggestion on what to do next?

Hi @dari_donkuro – thanks for your update!

As for the next step, it would be creating a funding-source resource for a Customer account using the Processor token. Here’s our guide on doing so - https://developers.dwolla.com/guides/plaid/create-funding-source

Check it out and let me know if you come across any questions! :slight_smile: