Skip to main content
Payrails Drop-in is our pre-built UI solution for accepting payments on your application. Drop-in shows all payment methods as a list, in the same block. Tokenizing new cards, adding new payment methods, and managing 3D-Secure or APM redirect flows usually don’t require more development work than simply integrating our drop-in into your user journey.

How it works

From an implementation perspective, a Drop-in integration contains:
  • Server-side: a single API call that creates the payment session.
  • Client-side: frontend component, which uses the payment session data to make the payment request and to handle any other actions like redirects or 3D Secure authentication.
  • Webhook server: receives notifications that inform you about the outcome of each payment.

Get started

Below is a two-step process for starting drop-in for your client.

Create the Drop-in component

First, create a Drop-in using the dropin(configuration) method of the Payrails client as shown below:
JavaScript
The Drop-in configuration is defined as shown below:

Mount the Drop-in to the DOM

Now, when the mount(containerId) method of the Drop-in is called, the Drop-in will be inserted in the specified div. For instance, the call below will insert the Drop-in into the div with the id #dropin-container.

HTML

JavaScript

You can use the unmount method to reset the Drop-in to its initial state.

Payment methods behavior and configurations

Event Listener

Attach your callables to the events emitted by the Drop-in:
The handler function() => void is a callback function you provide, that will be called when the event is fired.

Style

You can configure the style of the Drop-in and individual elements inside with this configuration object:
Typescript

Style non sensitive elements

Drop-in config allows you to pass custom classnames for non-sensitive elements. Allowing to easily change the styling of the entire drop-in form to match your branding. You can customize:
  • Radio buttons
  • Store instrument checkboxes
  • Button styles
  • Custom font families
  • Custom spacing and animations
Additional information: What is not customizable:
  • Animations after successful/failed payments
  • Animation on Payment button
  • If you would like to add some possibilities, please contact the Payrails team.
Payrails dropin also allows you to optionally show payment method logo alongside each payment method name. You can pass the showPaymentMethodLogo as true for the payment methods you would want to show this. By default this is false.

Translations

For the Drop-in, translations are part of the dropin(options) signature, inside the translations. here’s the complete interface:

Handle 3DS

We have 2 modes for handling 3ds -
  1. Iframe based flow - In this flow the user sees the iframe as a popup to validate 3DS. We would recommend this flow to maximise conversion.
  2. Redirection based flow - In this flow the user is redirected to the new page to validate 3DS. If you have very strong CSP settings which cannot be relaxed to accommodate for 3DS, then we would recommend this flow.
The DropIn integration be default comes with the iframe based flow. In order to switch to redirection based flow, the payrails SDK needs to be initialized with redirectFor3DS to true.
TypeScript

Authorization failure dialog configuration

Failure message can be hidden automatically after given amount of time.
Last modified on September 23, 2026