Error: uncaught exception: Invalid marketplace uri

空扰寡人 提交于 2020-01-16 11:25:30

问题


well, it looks like I'm the first in the S.O. community to post a question with a balancedpayments tag.

I recently began developing with balancedpayments. I

  • created a test marketplace,
  • added a "webhook" uri still pending, in the form of: https://www.mydomain.com/main/balancedpayments (maybe this is the problem?)
  • referring to documentation url [balanced.js][1] I added this to my page head section:

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

(In the body, I have made a standard html form, and above the form I added a javascript section using the example jquery stuff found on the balanced.js page, as linked above, I'm not posting that part for now, because it doesn't appear to be related to my initial js error.)

When the document is ready, and before I ever fill in or submit the form, I get this js error: Timestamp: 11/29/2013 12:09:53 PM Error: uncaught exception: Invalid marketplace uri "main/balancedpayments/TEST-MP4IaoKYeyteVLTY0nphZijM"

I will provide any additional information requested.


回答1:


Did you take a look at this section? https://docs.balancedpayments.com/current/#including-and-initializing-balanced-js

Specifically:

<script type="text/javascript">
    balanced.init('${REPLACE_THIS_WITH_YOUR_MARKETPLACE_URI}');
</script>
Example:

<script type="text/javascript">
    balanced.init('/v1/marketplaces/TEST-MP5JtbXVDZkSGruOJyNasPqy');
</script>

You can find your API key secret and marketplace URI from your dashboard. You will notice that marketplace URIs start with /v1/.... so in this case, your marketplace URI is: /v1/marketplaces/TEST-MP4IaoKYeyteVLTY0nphZijM

There's a live fiddle for you to try it out, http://jsfiddle.net/balanced/ZwhrA/, which is linked to from the documentation.



来源:https://stackoverflow.com/questions/20290660/error-uncaught-exception-invalid-marketplace-uri

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!