mandate-signing UI Element lets a payer review and sign a SEPA Direct Debit mandate from an invitation link,
without leaving your application. It presents the mandate form, collects the payer details, and reports the outcome
back to your page through events.
For security and compliance reasons, the mandate data can’t leave the Qonto domain and therefore the UI this element
injects into your website is implemented with an iframe. This way, the data is securely handled by Qonto while still
being accessible from your application. The iframe resizes itself to fit its content, so you don’t need to set a height
on the container.
The mandate invitation page is public, so this UI Element doesn’t need an
access
token or
a proxy
endpoint.
You only need the ID of the invitation link and the container where the
element will be rendered.
How it works
The mandate signing is rendered by calling thecreateUIElement function with the appropriate
settings:
Parameters
You pass these parameters inuiElementSettings.uiElementParams:
The element honors the
locale passed in operationSettings (or set when initializing the SDK). The supported
values are en, fr, de, es, it and pt.
Get the invitation link ID
TheinvitationLinkId comes from a blank mandate invitation link generated in the Qonto web app. It is not the
sign_url returned when you create a mandate through the API.
- In the Qonto web app, go to the Share blank mandate step of the mandate creation flow
(
/flows/direct-debit-collections/create-mandate/share-blank-mandate). - Click Generate mandate link. The invitation link is copied to your clipboard.
- The link looks like
https://pay.qonto.com/mandate-invite/<invitation_link_id>. Pass the last part of the path,<invitation_link_id>, asinvitationLinkId.
Validation and errors
createUIElement rejects with an InvalidParametersError and doesn’t render anything in these cases:
invitationLinkIdis missing, empty or not a string.localeis not one of the supported values.
EmbedOperationError if the parent element with the given uiParentElementId is not found, or if the
element doesn’t finish loading within 30 seconds.
If the container already holds a mandate signing element, calling
createUIElement again replaces it instead of adding a second one. The
previous element is removed before the new one is mounted. Parameters are
validated first, so if the call is rejected with an InvalidParametersError
(the error is still thrown), the existing element stays in place.Emitted events
The mandate signing UI Element emits the following events when users interact with it. You can set up a listener by passing a function as theuiElementSettings.uiElementEventListener parameter when calling createUIElement.
Mandate loaded
This event is emitted when the mandate invitation has loaded and the form is shown. It has noeventDetail.
Mandate signed
This event is emitted as soon as the mandate is successfully signed. It is useful in case you want to track the result, or to automatically move the user to the next step of your flow without waiting for user interaction. It has noeventDetail.
Mandate error
This event is emitted when the mandate can’t be loaded or signed. TheeventDetail contains a code that tells you
what happened:
You only need to listen for this event if you want to react to the failure, for example to track it or to take the
user out of the signing step when the invitation can’t be used.
Content Security Policy
The mandate signing UI Element is rendered in an iframe hosted by Qonto. If your website sends a Content Security Policy, allow the Qonto embed host in theframe-src directive (or in default-src if you don’t set frame-src):
Framing 'https://embed.qonto.com/' violates the following Content Security Policy directive. The createUIElement
call is then rejected with an EmbedOperationError after 30 seconds, and the frame is removed from the container. The
error message doesn’t mention the policy, so check the browser console if you see this error and your site sets a CSP.
When you test against the staging environment, the host is different. Allow
the staging embed host as well, for example
https://embed-js-master.staging.qonto.co.Customization
Like the rest of the UI Elements, the mandate signing element can be adapted to your branding by defining CSS variables with the--qonto-embed- prefix in your stylesheet. The SDK reads the variables from your stylesheets and passes them to
the element when it mounts.
Accepted values:
- Colors must be hexadecimal (
#7e1adb,#7e1adbff),rgb()/rgba(),hsl()/hsla()ortransparent. - Lengths must be in
pxorrem, within a reasonable range for the property (for example,button-border-radiusandcontainer-border-radiusaccept0to32px). - Font weights must be
normal,boldor a number from100to900. - Line heights must be a unitless number from
1to2.5. - Borders must be
noneor a width of up to4px, a style (solid,dashed,dottedordouble) and a color, for example1px solid #7e1adb. - Font families must be system fonts, with a maximum of five names (for example,
Arial, Helvetica, sans-serif).