Use Pre-Built Form Components
This sample shows how to use the Pre-Built form component.
This option is the easiest way to integrate dhango into your application. However, the option shown under Create a Payment Token will allow you to construct your own HTML if that is your preferred approach.
All that is required is a div in which the dhango Javascript will inject form elements to build the payment method form. Once the form is constructed, the rest of the functionaliy works the same as the Create a Payment Token option.
One benefit of this approach is that the form validation is automatically built into the user experience. Try clicking "Submit" without entering in data to see the validation at work.