Web
Web Integrations

Web SDK

Web SDK

Judopay's Web SDK is a JavaScript library which includes a fully customisable hosted iframe solution enabling you to collect sensitive card information. You will not take on additional PCI scope, as sensitive card information such as:

  • card number (PAN)
  • expiry date
  • CV2

will be submitted by your customers into fields hosted by Judopay.



Web SDK Video Tutorials




Payment Flow

3ds2 payment flow



Creating a 3D Secure 2 Payment with the Web SDK

When authorising /payments or /preauths it is recommended to use paymentSession.

Web SDK Version 0.0.29 (and higher) fully supports 3D Secure 2 flows. No additional support is required, the SDK does the rest.




The following steps are prerequisites for all the payment methods available for integration using Judopay's Web SDK.

Step One: Create a paymentSession




Make a HTTP POST Request: /paymentsession

Payment Session Request Example
Response Reference Example



Your backend server should store the paymentSession response reference returned by Judopay's API. Use this reference from the response to populate paymentSession when calling /payments and /preauths from your front-end client. See Making a Transaction.

The following parameters need to remain consistent between the /paymentsession requests and the /payments and /preauths requests, otherwise the transaction will fail:

  • YourPaymentReference
  • YourConsumerReference
  • JudoID
  • Currency
  • Amount

This is used to cross reference the validity of the transaction.



Step Two: Add the Payment Form to your Website

example payment form



Create and customise the Judopay Web SDK iFrame



An example of an iFrameConfiguration object:

iFrame Configuration Object Example


The iframe is created in your <SCRIPT> location.

See below for more details on the parameters that create the iFrameConfiguration object:

Parameter

Description

isGeoLocationGatheringAllowed Boolean

isGeoLocationGatheringAllowed = false

The browser will not ask for the location.

isChallengeModalCancelButtonVisible Boolean

isChallengeModalCancelButtonVisible = true

If set to false, the cancel (X) button on the 3D Secure 2 challenge modal will not be shown.

iFrame Parameters:



language String



Sets the language of the iFrame.

Values:

  • en (english) (Default)
  • es (spanish)
  • fr (french)
  • pt (portugese)
  • de (german)

errorFieldId String



Set as the class name of the <div> where the errors appear.

For example: <div class="judopay-errors">Error Location</div>

showCardTypeIcons Boolean



showCardTypeIcons = true

The card icons will display when the card entry is recognised.

cardTypeIconRight String

Changes the position of the card icon.

cardTypeIconTop String

Changes the position of the card icon.

backgroundColor String



Sets the background colour of the iFrame.

For example:

  • #FFFFFF
  • Default: white

layout String



Sets the layout of the iFrame payment form.

Values:

  • vertical (default)
  • compact
  • horizontal

For the form layout illustrations, see Form Layout.

defaultCountryCode String



Sets the country displayed in the country field.

For example:

  • UK

isCountryAndPostcodeVisible Boolean



isCountryAndPostcodeVisible = true

The country and postCode fields will be displayed.

isCardHolderNameVisible Boolean

isCardHolderNameVisible = true

The cardHolderName field will be displayed.

enabledPaymentMethods String [ ]



Array of accepted payment methods.

Values:

  • CARD
  • IDEAL

errorsDisplay String



Formats how errors are displayed to the consumer.

Values:

  • SHOW_ALL
  • HIDE_UNDER_FIELDS
  • HIDE_UNDER_FORM
  • HIDE_ALL

shouldAutofocus Boolean



shouldAutofocus = true

Sets the focus to the cardNumber field when the iFrame appears

idealPollingTimeout Number



Specifies the amount of time the system waits for the IDEAL alternative payment method to respond.

For example: 6000

disableUnderline Boolean



disableUnderline = false

When the consumer enters information into the iFrame, the fields will be underlined and highlighted.

allowedCardSchemes String [ ]



Array of accepted card schemes.

If this field is set, an error will appear if an unsupported card scheme is entered.

Values:

  • amex
  • mastercard
  • maestro
  • visa
  • diners
  • discover
  • jcb

styles Object



A JSON object.

Define further css style customisation for the payment fields.

For more information, see Styles Properties.

fonts Object [ ]



An array of JSON objects, each representing a font.

For more information, see Form Fonts.



Payment Methods

Once the paymentSession and payment iFrame steps have been implemented, you can integrate the below payment methods, using our Web SDK:

Card Payments

Wallet Payments

Alternative Payments



Setting up an Incremental Authorisation

The incremental authorisation feature allows you to increment the value of your original preAuth for scenarios where you need to charge your customer a higher total amount. By incrementing the preAuth value, you will be able to capture the total amount that you wish to charge your customer when you are ready.

The allow increment flag allows you to set up your initial preAuth so that it can be incremented by an additional amount.

This feature is only available with a limited set of processors - please check with your account manager before you use this feature.

  • allowIncrement is a part of the main JudoPaymentConfiguration config object, and can be set when creating the configuration object.
    • If present = it is automatically applied for preAuth requests.
    • If no value is provided = then false is set by default.

Example:

val configuration: JudoPaymentConfiguration = { ... allowIncrement: true, }; const judopay = new JudoPay() judopay.createCardDetails('jupay-payment-iframe', configuration)


Putting it all together to display the payment form and make a transaction:

Example Flow



Handle the Response






Testing your Integration

Follow our Testing your Web SDK Integration test scenarios, to test your integration and generate:

  • Successful payments
  • Declined payments
  • Unexpected errors