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.
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.
Make a HTTP POST Request: /paymentsession
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.
An example of an iFrameConfiguration object:
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:
|
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:
|
layout String | Sets the layout of the iFrame payment form. Values:
For the form layout illustrations, see Form Layout. |
defaultCountryCode String | Sets the country displayed in the country field. For example:
|
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:
|
errorsDisplay String | Formats how errors are displayed to the consumer. Values:
|
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:
|
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. |
Once the paymentSession and payment iFrame steps have been implemented, you can integrate the below payment methods, using our Web SDK:
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:
Putting it all together to display the payment form and make a transaction:
Follow our Testing your Web SDK Integration test scenarios, to test your integration and generate:
- Successful payments
- Declined payments
- Unexpected errors