Can Dwolla be integrated into a Wix site?

If it cannot, can it be integrated with Squarespace or other third party site builder services?

Thanks,
Anthony

Hi Anthony – Yes! As long as you have a back-end server that can make calls to the Dwolla API. you should be able to integrate it into your site built by any of those third party site builder services!

Hope that helps! Let us know if you come across any questions!

Hi. I am working with Wix and they have installed dwolla-v2 on the backend. Their tech people installed the node for my website.

But I keep getting an error when I put my page together.

This is the code I have in my on my webpage. But I keep getting an error of (Unexpected token N in JSON at position 4). Can you assist? This is my first time doing this and I don’t think I’m doing it right.

  <div class="container">
    <div class="container-sm">
        <h3>Create Customer</h3>
        <div class="orange-border">
            <dwolla-customer-create terms="https://docs.dwolla.com/" privacy="https://developers.dwolla.com/">
            </dwolla-customer-create>
        </div>
    </div>
    <div class="container-sm">
        <div class="code-container">
          
        </div>
    </div>
</div>
</div>

@bksmittie

It looks like you have your Client variable commented out.

Thanks…Yes I tried uncommenting this out, but it didn’t work. I can put in a backend .js module to run on the backend in Wix. I’m trying to see what code I need to have run here to make this work. I believe the token is not getting through, but just trying to figure this out.

The backend.js code for the page I have is the following:

const dwolla = require(“dwolla-v2”);

// Navigate to https://dashboard.dwolla.com/applications (production) or https://dashboard-sandbox.dwolla.com/applications (Sandbox) for your application key and secret.

const appKey = “my app key here”;
const appSecret = “my secret key here”;

const client = new dwolla.Client({
key: appKey,
secret: appSecret,
environment: “sandbox”, // optional - defaults to production
});

client.post("/tokenUrl", function (req, res) {
generateClientTokenWithBody(req.body).then((clientTokenRes) => {
console.log(clientTokenRes);
res.send({ token: clientTokenRes.token });
});
});

function generateClientTokenWithBody(body) {
const url = /client-tokens;
return dwolla
.post(url, body)
.then((response) => {
return response.body;
})
.catch((error) => {
return error;
});
}

@bksmittie

Have you tried putting in your key and secret in the appKey and appSecret values?

Can you also share further information on what you mean by “I am working with Wix and they have installed dwolla-v2 on the backend.“

Hi @bksmittie

The reason why I asked is because an errors can occur when your key and secret doesn’t match your environment.

Since the code you shared looks to be in the Sandbox env, if the key and secret is to your production, then this will cause an error.

If you want to use the sandbox environment, make sure you’re using your sandbox key + secret, and for production environment, production key + secret

Hey @bksmittie – it looks like you’re using a tokenUrl instead of a single client-token for the non-flow component you’re using above for adding an Unverified Customer. Perhaps that could be why you’re getting the above error.

Would you be able to share your configuration code? It should look like the following -

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