Ethan
Ethan

Reputation: 400

JS error on balanced.init()

  1. Uncaught TypeError: Cannot use 'in' operator to search for 'debug' in undefined
  2. a.balanced.initbalanced.js:1https://js.balancedpayments.com/v1/balanced.js
  3. (anonymous function)

    <script type="text/javascript" src=" https://js.balancedpayments.com/v1/balanced.js"></script>
    <script>
    //balanced.init('/v1/marketplaces/TEST-MP798-194-2357');
    //balanced.init('/marketplaces/TEST-MP798-194-2357');
    balanced.init('TEST-MP798-194-2357');
    </script>
    

Getting the same error on each of the different calls. Is my URI incorrect?

Upvotes: 3

Views: 345

Answers (1)

Mahmoud Abdelkader
Mahmoud Abdelkader

Reputation: 24979

This is a documentation bug on our end. There should be a second optional parameter, but right now it's required.

Like you have figured out,

balanced.init('YOUR-MARKETPLACE-URI', {}); // works
balanced.init('YOUR-MARKETPLACE-URI', {'debug': true}); // turns on debugging

Hope this helps.

Upvotes: 2

Related Questions