Dwolla.js docs incorrect code example


(Nickforddesign) #1

In the JS example for setting up Dwolla.js, there are several basic mistakes that should be corrected.

First, using a JS linter (or trying to run this code example) will show that the last set of closing braces are unnecessary. Removing the last line would also allow the indenting to be corrected.

Also, log should probably be change to console.log, otherwise that will also throw an error for most users.

dwolla.iav.start('8zN400zyPUobbdmeNfhTGH2Jh5JkFREJa9YBI8SLXp0ERXNTMT', {
    container: 'iavContainer',
    stylesheets: [
      'http://fonts.googleapis.com/css?family=Lato&subset=latin,latin-ext',
      'http://myapp.com/iav/customStylesheet.css'
    ],
    microDeposits: false,
    fallbackToMicroDeposits: true
  }, function(err, res) {
    log('Error: ' + JSON.stringify(err) + ' -- Response: ' + JSON.stringify(res))
  })
})

should be:

dwolla.iav.start('8zN400zyPUobbdmeNfhTGH2Jh5JkFREJa9YBI8SLXp0ERXNTMT', {
  container: 'iavContainer',
  stylesheets: [
    'http://fonts.googleapis.com/css?family=Lato&subset=latin,latin-ext',
    'http://myapp.com/iav/customStylesheet.css'
  ],
  microDeposits: false,
  fallbackToMicroDeposits: true
}, function(err, res) {
  console.log('Error: ' + JSON.stringify(err) + ' -- Response: ' + JSON.stringify(res))
})

https://developers.dwolla.com/resources/dwolla-js/instant-account-verification.html


(Spencer Hunter) #2

Ah, good catch @nickforddesign! We made the quick change to our docs and deployed the fix. Please let us know if you see any other issues, otherwise don’t hesitate to open up a PR since our docs are open sourced!


(Nickforddesign) #3

Ah good to know, I’ll submit a PR next time!

Thanks!


(Cory Anderson) #4