Getting Started with create customer issue

Hey there, I am very new to Dwolla, I am baffled by this “undefined” error message I received on the frontend of Drop-in and am not sure how to debug this!

I also have a question of, what exactly am I suppose to put in this block of code, I can see that it’s suppose to be private and terms but I am not sure what that means and where to find that info…? →
<dwolla-customer-create terms="https://docs.dwolla.com/"privacy="https://developers.dwolla.com/"> </dwolla-customer-create>

please and thank you :slight_smile:

Hi @akikoLPF

I found this answer in regards to the undefined issue.

Drop-in components are low-code components devs use in order to speed up the process of their launch. In other words nothing in terms of text should go in between that block of code. Here is a concept article on drop-ins for more information

Not sure I completely understand this question. Are you saying that the links to the “Terms of Services” is not working?

Hey there! Thanks for getting back to me! I dont believe this is working for me :frowning: or maybe I am not understanding fully?

   <script>
    dwolla.configure({
          environment: "sandbox",
        styles: "/styles/create.css",
        token: () => Promise.resolve(`{{ token }}`),
        success: (res) => Promise.resolve(),
        error: (err) => Promise.resolve()
    });
</script>

At the line where “token” thats where we should put the key and secret? I have tried that in a way that looks like this:

    <script>
    dwolla.configure({
          environment: "sandbox",
        styles: "/styles/create.css",
        token: () => Promise.resolve({{ key: "3242hfedsndaklds", secret: "sadk/sadis930[32blah"  }}),
        success: (res) => Promise.resolve(),
        error: (err) => Promise.resolve()
    });
</script>

It didnt work, then I tried putting the token from my sandbox and that didnt work either, I am at a lost on where / how to add the token?

Oh about my second question, sorry I wasn’t more specific, I meant in terms of this block of code →

 <dwolla-customer-create terms="https://docs.dwolla.com/" privacy="https://developers.dwolla.com/">

Inside of the terms="" and privacy="" is there suppose to be something that I provide from my sandbox or may i suppose to leave it like this?

Thanks again for all the help, sorry if its a bit confusing!

Also, if you could show me an example of how I am suppose to input my key and secret into the token or however I am suppose to input it to get the undefined error to stop showing

please :slight_smile:

Hi @akikoLPF

Here are some free resources we have available online. Including a “Getting Started” video:

Getting Started
Drop-ins Example
Building With Drop-in Components
Dwolla v2-node

I would just copy + paste the drop-in component code as it was given. The TOS and Privacy were put in the code for legal reasons and should not be deleted.

Hey there!

So, I’ve gone through each step, and looked at all the resources you’ve given me. I have added my keys in the proper places, copied & pasted the integration code like in the repo given, watched the video and everything, yet, I am still getting the “undefined” message on my UI… I don’t know what I am doing wrong, is there any way I can get someone to look at the code with me to see what I am doing wrong?

Okay I noticed something odd, I fiddled with the script tags and noticed that when I add these tags from the copy & paste component code i receive this error:

 <script type="text/javascript" src="cdn.dwolla.com/2/dwolla.js"></script>
<script type="module" src="cdn.dwolla.com/2/dwolla-components.js"></script>

create-customer:12 GET http://localhost:4041/cdn.dwolla.com/2/dwolla.js net::ERR_ABORTED 404 (Not Found)

create-customer:13 GET http://localhost:4041/cdn.dwolla.com/2/dwolla-components.js net::ERR_ABORTED 404 (Not Found)

I noticed that the this link https://www.dwolla.com/updates/low-code-drop-in-components/ provides this code <script type="text/javascript" src="https://cdn.dwolla.com/v2/dwolla-web.js"></script>

which gives me this error

dwolla-web.js:176 Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': the name "dwolla-error" has already been used with this registry at Object.<anonymous> (http://cdn.dwolla.com/v2/dwolla-web.js:176:64) at i (http://cdn.dwolla.com/v2/dwolla-web.js:1:110) at Module.<anonymous> (http://cdn.dwolla.com/v2/dwolla-web.js:182:110523) at i (http://cdn.dwolla.com/v2/dwolla-web.js:1:110) at http://cdn.dwolla.com/v2/dwolla-web.js:1:925 at http://cdn.dwolla.com/v2/dwolla-web.js:1:935

I am pretty sure I followed the instructions and did all my installations so I don’t understand whats happening here.

Hey there, I still never got my answer for these questions. Although I figured out my first issue with the scripting tags. I still have the issue of my Drop In UI showing the undefined error message…

Hi @akikoLPF

Are you passing in the key + secret as it correlates to the specific environment you’re running your application on? (sandbox/production)

Hi @akikoLPF – with the recent updates to drop-ins you’d need to use the following configuration for non-flow components. Notice that the token is now aa JSON object that contains a key value pair for token - a generated single-use client-token.

<script>
  dwolla.configure({
    environment: "sandbox",
    styles: "/styles/create.css",
    token: () => Promise.resolve(`{{ token }}`),
    success: (res) => Promise.resolve(res),
    error: (err) => Promise.resolve(err),
  });
</script>

This… this is exactly what my issue was… and I didn’t see it at all :upside_down_face: :upside_down_face: :upside_down_face:

I feel so dumb for not seeing that part at all. But also, will you guys change that in the Drop in repo example? Since it’s supposed to be a key/value pair?? Maybe I didn’t read the docs correctly but that was a little unclear to me it.

Also, for the example of a business verified customer, will that also be in 2 curly braces or will it stay in quotes → tokenUrl: "/tokenUrl"

Also, thank you very much!

1 Like

Hi Akiko – we have it on our agenda to update the examples repo as well. So sorry for the confusion!

The tokenUrl for the flow components (like Business Verified Customer) is still the same as in the docs :slight_smile: