DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Kelly M. for Dwolla

Posted on • Updated on

Dwolla Drop-in Components Part ll: Upgrading an Unverified Customer

Because an Unverified Customer has basic capabilities in the Dwolla ecosystem, there may be instances where this customer type will need to be upgradedβ€”like if your Unverified Customer needs to send more than $5,000 per week. Upgrading an Unverified Customer to a Verified Customer will give them the ability to increase their transaction limits. For more information on the difference between an Unverified and Verified Customer, visit our docs on concepts.

Prior to using this low-code drop-in, make sure you have created an Unverified Customer, using our Create an Unverified Customer drop-in, by specifying the firstName, lastName and email parameters.

Visit Part l of the Dwolla Drop-in Component Series if you haven’t already created an Unverified Customer type for more clarity.

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

{
    "firstName": "Unverified",
    "lastName": "Customer",
    "email": "unverifiedCustomer@email.com"
}

HTTP/1.1 201 Created
Location: https://api-sandbox.dwolla.com/customers/fc451a7a-ae30-4404-aB95-e3553fcd733f


Enter fullscreen mode Exit fullscreen mode

For additional information on creating an Unverified Customer, check out our developer documentation.

Upgrade an Unverified Customer

Alt Text

The steps for this component assume that you have already integrated the Dwolla Drop-in library. Please view the Getting Started section on Part l of this blog series if you have not done so already.

1. 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.update”,
  "_links": {
    β€œcustomer”: {
      β€œhref”: β€œhttps://api-sandbox.dwolla.com/customers/{{customerId}}”
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

2. Configure the Dwolla Object

<script src="https://cdn.dwolla.com/v2/dwolla-web.js"></script>
<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-update 
      customerId="customerId"
      firstName=”firstName”
      lastName=”lastName”
      email=”email”
      terms=”https://www.yourterms.com”
      privacy=”https://www.yourprivacy.com”>       
  </dwolla-customer-update >
</div>

Enter fullscreen mode Exit fullscreen mode

Solutions for Possible Errors

  1. Invalid Token
    Make sure that the token generated was copied + 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.

  2. customerId
    A missing or invalid customerId will trigger an error as one is required to upgrade an Unverified Customer. You can find your customerId in the sandbox after customer creation.

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 containing the attributes found here.

Try It Out and Join the Discussion

Check out our open-source project and visit our discussion forum 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.

Check out the next component Create a Personal Verified Customer.

Top comments (0)

🌚 Browsing with dark mode makes you a better developer.

It's a scientific fact.