Skip to main content
This widget is deprecated. For new integrations, use the Set PIN Widget.
The Set Pin Widget injects a configurable set of iframes into your app, allowing your user to securely enter a PIN in a PCI compliant manner. This helps remove some (but not all) of the PCI compliance requirements you would otherwise need to handle. The iframes injected by Synctera allow you complete control over the styling over the widget using only CSS.

Quick start

  1. Add <script src="https://widgets-sandbox.synctera.com/assets/set-pin/v1/loader.js"></script> to your page.
  2. Embed the Set Pin widgets when and as needed (both the Controller and Confirm Set Pin widgets are needed):
  3. Add your own submit button under the Set Pin widgets.
  4. Listen for the validity event on the Controller Set Pin widget (the one with the id):
  5. Have the button call setPinWidget.submit() to submit the pin.It returns a promise, which resolves if the pin submission was successful, or rejects if it failed.

Basic Example:

Styling: If you add a custom class name to the Set Pin widget, custom styling will be activated (see Custom Styling). By default, the widgets use the browser’s inbuilt styling for the Set Pin input text fields (note that without custom styling the widget iframe is 4px bigger than the input field inside to allow for any browser outline effects). See Custom Styling Example for a complete working example.

Environments

Browser support

The widgets work on both mobile and desktop, and we ensure support for all modern browsers. It also works in many older browsers, which we try to support where feasible.

Set Pin flow

Summary Fetch widget token from backend → Render widgets with token → Listen for “validity” event → User submits controller widget → Widget submits PIN to Synctera → And returns success or failure → Widget auto-destroys
Note: It is recommended to also add ‘load’ and ‘error’ listeners for UI management (see Widget API below).
The flow for using the widgets:
  1. On your backend, request a widget token from Synctera for the particular card you wish to use.
  2. Make sure the Synctera Set Pin widget Javascript has been added to your website.
  3. Render the two specialized Set Pin HTML tags as above, setting the token attribute, and your own button to submit the widget.
  4. You can style these fields however you like (as explained below in Custom Styling).
  5. Listen for the “validity” event from the controller widget.
  6. When valid, enable your button.
  7. When the button is clicked, call the submit() function on the controller widget.
  8. The submit function will submit the pin.
  9. It also returns a promise which resolves when successful, or rejects when there’s a failure.
  10. Once submitted, the widgets will auto-destroy and you can now remove them.

Widget API

Element Attributes:

Events:

Fields:

Custom styling

Summary
  • Add a class name to set-pin tags to activate Custom Styling: <set-pin class='customStyles' ...
  • Style as desired (i.e. border), but Font Styles are special
  • For pseudo-selectors, e.g. :hover, :focus, etc - use pseudo-attributes instead: Example: .customStyles[_hover] { border: 1px solid #616161; }
  • Font styles are auto-forwarded, but only certain values are allowed (see below)
  • Optional: You can use .customStyles[_required] to show the widgets once they have loaded
By default, without custom styling, the widgets use the browser’s inbuilt styling for the Set Pin input text fields (note that the widget iframe is 4px bigger than the input field inside to allow for any browser outline effects). You may want to style the widget to match your webapp design or to add things like placeholders. This can be done entirely through css styling. When a class attribute is added to the widget, the 4px spacing is removed, the input box styling is stripped and the background is made transparent such that any elements placed behind the widget will be visible (i.e. a placeholder element). The text input is set to always take up 100% of the height and width of the iframe, and likewise for the iframe in the widget tag. Input text field pseudo selectors such as :hover, :focus and :blank are indirectly supported through css-like attributes instead of actual pseudo selectors. As the user hovers, focuses and types in the field, attributes will be added/removed on the set-pin tag automatically. Supported “pseudo attributes” are inspired from: https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes#input_pseudo-classes Where customStyles is the class name added to widget tags, e.g. <set-pin class='customStyles'...: Note that for the confirm widget, the invalid and valid are dependent upon the value matching the controller widget’s value. However, out-of-range and in-range are not. See Font Styles for information on acceptable font style values. src=“https://widgets-sandbox.synctera.com/assets/set-pin/v1/loader.js”

Custom Styling Example:

Font Styles

You can style the tag as you see fit (border, background, etc). Css font properties are handled in a special way to forward them to the iframe for styling the input, in a secure and sanitized manner. As such only certain css font properties are supported and only with certain values (all other values may be ignored, if they work they are not guaranteed across all browsers): Note that with the font-family property, we look for a keyword in the first font in the comma seperated list of fonts you supply. If there’s a match, we use the font-family strings in the above table and not the font-family specified (for security). The above list of fonts are designed to ensure maximum coverage across different operating systems for similar style fonts. Custom fonts are not supported at this time.

Typescript type files

The following type definitions are available for Set Pin:

Additional Resources

For examples showing the Card Activation & Set PIN widget implementation please see the following:

Set PIN Widget

Card Activation Widget