Dwolla Drop-in Components: Low-Code Components For Integrating a Payment API 
Published: 2020-12-14 16:57:46

The integration of APIs can be challenging, especially for those in a hurry to launch or new to the API world. Dwolla’s Drop-in Components are prebuilt, low-code components that allow developers to integrate Dwolla’s API faster for a more seamless experience in our programmable payments infrastructure. 

These low-code components can give access to Dwolla’s programmable payment infrastructure with minimal lines of code. 

Our framework agnostic library can be used as isolated functions or joined together to construct common user flows—while still giving developers and companies the flexibility to control their own branding via our white-labeled API. 

## Introducing Dwolla’s Drop-in Components

Our first release of a low-code solution includes six components commonly used by developers integrating our programmable payments infrastructure.

Each drop-in component caters to a specific customer type which is briefly defined in the series. For a more detailed list on the different customer types and their capabilities within the Dwolla ecosystem, please visit our [docs on concepts](https://developers.dwolla.com/concepts/customer-types#customer-types).

### Part I: Getting Started

#### Integration

In our five part blog series, the following integration steps need to be completed prior to attempting implementation of any drop-in. For helpful integration steps in other languages, please visit our [software development kit](https://docs.dwolla.com/#sdk-support).

1. Setting Up Dwolla Server Side
`npm install dwolla-v2` <br>

2. Generate a One-Time Use Client Token
You can generate this token by setting up a free [sandbox](https://accounts-sandbox.dwolla.com/sign-up) account. Here you will be able to obtain a key and secret to be able to generate a one-time-use client token, as well as find customer IDs to create customers and help begin testing the drop-ins. <br>
We have also created a [Postman Collection](https://app.getpostman.com/run-collection/e946a89ed19313cce582) to assist in sandbox testing and getting familiar with our API. <br>

3. Setup Dwolla on Your Front End
Be sure to add dwolla.js by including the script tag below to the `head` of your HTML file. <br>

`<script type="text/javascript" src="https://cdn.dwolla.com/v2/dwolla-web.js"></script>`

## Create an Unverified Customer

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/i8qnhzo3kqrfg4ri0m6o.png)

An Unverified Customer is a customer type that requires a minimal amount of information in order to be created and send funds. This information includes: 

* First Name 
* Last Name 
* Email 
* Optionally: Business Name for Businesses

To find out more about the abilities and limitations of this customer type, visit our docs on concepts.

After completing the integration steps above, the steps to create an Unverified Customer are as follows:

#### Generate a Client Token

```
POST https://api-sandbox.dwolla.com/client-tokens
Accept: application/vnd.dwolla.v1.hal+json
Content-Type: application/json
Authorization: Bearer {{token}}

{
  "action": "customer.create”,
  "_links": {
    “customer”: {
      “href”: “https://api-sandbox.dwolla.com/customers/{{customerId}}”
    }
  }
}
```


#### Configure the Dwolla Object

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

<div class="customer">
  <dwolla-customer-create 
      terms=”https://www.yourterms.com”
      privacy=”https://www.yourprivacy.com”>       
  </dwolla-customer-create >
</div>
```


### Solutions for Possible Errors

1. Duplicate Email <br>
If you are unable to “Agree & Continue” after your drop-in has successfully loaded, this could be an issue of a duplicate email in the system. Try inputting a different email for successful testing and usage of this drop-in.

2. Invalid Token <br>
Make sure that the token generated was copied and pasted correctly. If you are using the sandbox to test out this drop-in component, your token can be generated in the “Applications Tab” found after login. Tokens are valid for 60 minutes.

### Styling

By default, the elements within your specified container are responsive to any change and screen size. Dwolla also allows you to customize the styling of your components by providing a stylesheet to dwolla.configure.

### Try It Out and Join the Discussion

Check out our [open-source project](https://github.com/Dwolla/drop-ins-examples) and visit our [discussion forum](https://discuss.dwolla.com/) for help or questions regarding our drop-in components. This is the first version of our low-code solution and updates as well as additional components will be released in the future in order to make the integration of our programmable payments infrastructure faster and easier to use.

[Next](https://dev.to/dwolla/dwolla-drop-in-components-part-ll-upgrading-an-unverified-customer-287l), see how you’ll be able to change an Unverified Customer to a different customer type with additional capabilities.