[dwolla.cards.start] Invalid token in sandbox

I am implementing Dwolla-cards.js but [dwolla.cards.start] Invalid token in my sandbox account could you please guide me

Hi @Netset_PHP_Team – would you be able to share the Customer Id for which you’re getting the invalid token error? Perhaps the token being generated is somehow being manipulated when passed to the dwolla.cards.start function, or it’s being invoked more than once, causing the token to fail?

Hi Shreya
Here is my customer url

Hi @shreya ,

Are you there? I am waiting for your response its been 3 days i am stuck here in funding source token.

This function is throwing exception ==>
function throwIfTokenInvalid(token) {
if (typeof (token) !== ‘string’ || hex2String(token).split(":").length !== 2)
throw new Error(’[dwolla.cards.start] Invalid token: ’ + token)
As per this function token type should not be string but as per js documentation token type is string its getting confuse

Hi @Netset_PHP_Team , A few issues I see here after taking a look at your application.

  1. As referenced in this thread, Adding a debit card requires a permission to be enabled on your Sandbox account as this is a premium feature. I went ahead and configured this feature on your Sandbox account which should now give you access to call the /card-funding-sources-token endpoint to obtain a unique token for adding a card.

  2. After reviewing our API request logs, it appears that you are making a request to /customers/2f334221-d7ba-49d6-b20d-c3dd71bce191/funding-sources-token, however this is the wrong endpoint for obtaining a card token that can be used with dwolla-cards.js. As mentioned in this thread, the dwolla-swagger-php library didn’t yet contain the method for getCustomerCardToken. I went ahead and added this method and updated the version of the library to 1.7.0. You should be able to pull down the latest version which contains support for that request.

Let us know if you continue to run into issues after reviewing and making changes based on the items above.

Hi @spencer

Thank you so much this was really helpful this was working fine now but now I am getting another error i.e code: “UnknownError”
message: “Could not connect to server.”
Could you please check this once ?


Hi @Netset_PHP_Team – would you be able to share more information about the API request or the code that’s resulting in the above error? Any screenshots would be helpful too!