Server SDKs
.NET Integration
Integration
-
From Visual Studio launch NuGet Package Manager
-
Search for JudoPay.Net
-
Add JudoPay.Net via
-
GUI, or
-
Package Manager Console
-
-
Add the JudoPay.Net package:
install-Package JudoPay.Net
Setup
-
Ensure all integration steps are completed.
-
Add your app’s sandbox Token and Secret:
var client = JudoPaymentsFactory.Create(
JudoEnvironment.Sandbox,
<yourApiToken>,
<yourApiSecret>
);
Only sandbox API tokens and secrets will work in the sandbox.
Using the wrong tokens and secrets will result in an authorisation failure.
-
Ensure the SDK is configured for the sandbox environment.
-
Use the test cards provided in the Judopay Portal:
-
Tools > Generating transactions
-
If performing transactions only from your backend, enable the Register Card Transactions permission for your app.
Create a separate app for your backend with the Make Payments permission enabled.
Test all your required payment types in the sandbox environment before going live.
PHP Integration
Prerequisites
-
PHP 5.5 and above
-
Composer Package Manager
Integration
Using the Composer Package Manager:
-
Add the Judopay package to your composer.json file:
"require": {
"judopay/judopay-sdk": "5.1.0"}
-
Execute:
$ composer install
-
Make the Judopay SDK classes available to your application, by adding the following to your file:
require 'vendor/autoload.php';
Setup
-
Create a new Judopay object, with your API credentials:
$judopay = new \Judopay(
array(
'apiToken' => 'your-token',
'apiSecret' => 'your-secret',
'judoId' => 'your-judo-id',
//Set to true on production, defaults to false which is the sandbox
'useProduction' => false
)
);
For the purpose of this exercise, the sandbox token and secret have been added.
-
Ensure the SDK is configured for the environment you are targeting.
-
For example, if you are using the sandbox environment: 'useProduction' => false
-
The Server SDK allows for further configuration:
-
Logging. To help debug you can attach a logger library.
We recommend Monolog, however any PSR-3 standard library is compatible.
Validation error details can be found in the modelErrors array. For example if a required field is missing from the model.
Check Card
Ensure your account supports the Check Card functionality. Contact Developer Support for more details.
When making Token Payments, you can obtain the card token from the Check Card response.
Create an instance of the CheckCard Model:
You do not need to set an amount. This is automatically set by Judopay's API in order to check the card

Parameter |
Description |
---|---|
yourConsumerReference String Required |
Unique reference to anonymously identify your customer. Advisable to use GUIDs. Must be below 40 characters. |
yourPaymentReference String Required |
Judopay's Server SDK sets this value automatically. If you insert a value, the SDK will change it. This value is unique in order to protect your customers against duplicate transactions. |
yourPaymentMetaData IDictionary Optional |
Additional information associated with a transaction to help reconcile. |
judoId String Required |
Unique ID supplied by Judopay. Specific to a merchant and/or location. Format:
|
cardNumber String Required |
Submitted without whitespace or non-numeric characters. |
currency String Optional |
The currency of the transaction. Any ISO 4217 alphabetic currency code:
|
cv2 String Required |
The 3 or 4 digit number on the back of a credit card. Also known as the card verification value (CVV) or security code. |
startDate String Optional |
For Maestro cards: Format:
|
expiryDate String Optional |
The expiry date of the card. Format:
|
issueNumber Integer Optional |
For Maestro cards:
|
initialRecurringPayment Boolean Optional |
Indicates if this initial payment is part of a recurring payment. |
recurringPayment Boolean Optional |
Indicates if this is a recurring payment. |
relatedReceiptId String Optional |
The receiptId returned from the first subscription payment.
Adding the relatedReceiptId references the subsequent recurring transactions to the original transaction. |
threeDSecure Object Required |
For any 3D Secure 2 requests .
Values:
Format:
Values:
Format:
Values:
|
If result.HasError = false, check the Payment Receipt Model response
Register Card
Use registerCard
to save the consumer's card details in Judopay's card vault.
When making Token Payments, you can obtain the card token from the Register Card response
Create an instance of the RegisterCard Model
You do not need to set an amount. This is automatically set by Judopay's Transaction API in order to register the card.
The receipt response will show the payment: Type = PreAuth.

Parameter |
Description |
---|---|
yourConsumerReference String Required |
Unique reference to anonymously identify your customer. Advisable to use GUIDs. Must be below 40 characters. |
yourPaymentReference String Required |
Judopay's Server SDK sets this value automatically. If you insert a value, the SDK will change it. This value is unique in order to protect your customers against duplicate transactions. |
yourPaymentMetaData IDictionary Optional |
Additional information associated with a transaction to help reconcile. |
judoId String Required |
Unique ID supplied by Judopay. Specific to a merchant and/or location. Format:
|
cardNumber String Required |
Submitted without whitespace or non-numeric characters. |
currency String Optional |
The currency of the transaction. Any ISO 4217 alphabetic currency code:
|
cv2 String Required |
The 3 or 4 digit number on the back of a credit card. Also known as the card verification value (CVV) or security code. |
startDate String Optional |
For Maestro cards: Format:
|
expiryDate String Optional |
The expiry date of the card. Format:
|
issueNumber Integer Optional |
For Maestro cards:
|
initialRecurringPayment Boolean Optional |
Indicates if this initial payment is part of a recurring payment. |
recurringPayment Boolean Optional |
Indicates if this is a recurring payment. |
relatedReceiptId String Optional |
The receiptId returned from the first subscription payment.
Adding the relatedReceiptId references the subsequent recurring transactions to the original transaction. |
threeDSecure Object Required |
For any 3D Secure 2 requests.
Values:
Format:
Values:
Format:
Values:
|
If result.HasError = false, check the Payment Receipt Model response.
Save Card
Use saveCard
to save the consumer's card details in Judopay's card vault.
When making Token Payments, you can obtain the card token from the Save Card response.
Create an instance of the SaveCardModel:

Parameter |
Description |
---|---|
cardNumber String Required |
Submitted without whitespace or non-numeric characters. |
expiryDate String Optional |
The expiry date of the card. Format:
|
cardAddress Object Optional |
Card holder address. |
startDate String Optional |
For Maestro cards: Format:
|
issueNumber String Optional |
For Maestro cards:
|
yourConsumerReference String Required |
Unique reference to anonymously identify your customer. Advisable to use GUIDs. Must be below 40 characters. |
judoId String Required |
Unique ID supplied by Judopay. Specific to a merchant and/or location. Format:
|
currency String Optional |
The currency of the transaction. Any ISO 4217 alphabetic currency code:
|
If result.HasError = false, check the Payment Receipt Model response.
Token Payments
You can create a token payment following a: Payment | PreAuth | Register Card | Save Card operation, as a card token is always returned
Create an instance of the TokenPaymentModel:

|
|
---|---|
cardToken String Required |
Save the cardToken into your database to send back to Judopay, instead of inserting the consumer's card details. |
yourConsumerReference String Required |
Unique reference to anonymously identify your customer. Advisable to use GUIDs. Must be below 40 characters.This must match the original yourConsumerReference when the token was initially created. |
yourPaymentReference String Required |
Set your unique reference for this payment. Format:
|
yourPaymentMetaData IDictionary Optional |
Additional information associated with a transaction to help reconcile. |
judoId String Required |
Unique ID supplied by Judopay. Specific to a merchant and/or location. Format:
|
amount Decimal Required |
The amount to process. Format:
|
currency String Optional |
The currency of the transaction. Any ISO 4217 alphabetic currency code:
|
userAgent String Optional |
Consumer's browser details. |
deviceCategory String Optional |
The type of device where the consumer is carrying out the transaction:
|
acceptHeaders String Optional |
Consumer's browser details. |
initialRecurringPayment Boolean Optional |
Indicates if this initial payment is part of a recurring payment. |
recurringPayment Boolean Optional |
Indicates if this is a recurring payment. |
recurringPaymentType enum Optional |
Type of recurring payment. Values:
If a value is not set, the default value = RECURRING |
relatedReceiptId String Optional |
The receiptId returned from the first subscription payment.
Adding the relatedReceiptId references the subsequent recurring transactions to the original transaction. |
Check the Payment Receipt Model response.
Creating a PreAuth
Create an instance of the CardPaymentModel:

|
|
---|---|
yourConsumerReference String Required |
Unique reference to anonymously identify your customer. Advisable to use GUIDs. Must be below 40 characters. |
yourPaymentReference String Required |
Set your unique reference for this payment. Format:
|
yourPaymentMetaData IDictionary Optional |
Additional information associated with a transaction to help reconcile. |
judoId String Required |
Unique ID supplied by Judopay. Specific to a merchant and/or location. Format:
|
amount Decimal Required |
The amount to process. Format:
For currencies using a different structure please contact Judopay for support. |
currency String Optional |
The currency of the transaction. Any ISO 4217 alphabetic currency code:
|
cv2 String Required |
The 3 or 4 digit number on the back of a credit card. Also known as the card verification value (CVV) or security code. |
primaryAccountDetails Object Optional |
Primary Account Holder Details:
|
userAgent String Optional |
Consumer's browser details. |
deviceCategory String Optional |
The type of device where the consumer is carrying out the transaction:
|
acceptHeaders String Optional |
Consumer's browser details. |
initialRecurringPayment Boolean Optional |
Indicates if this initial payment is part of a recurring payment. |
recurringPayment Boolean Optional |
Indicates if this is a recurring payment. If recurringPayment = true, remember to send the |
recurringPaymentType enum Optional |
Type of recurring payment. Values:
recurringPaymentType is required if |
relatedReceiptId String Optional |
The receiptId returned from the first subscription payment. Adding the relatedReceiptId references the subsequent recurring transactions to the original transaction. |
cardNumber String Required |
Submitted without whitespace or non-numeric characters. |
expiryDate String Optional |
The expiry date of the card. Format:
|
startDate String Optional |
For Maestro cards Format:
|
issueNumber Integer Optional |
For Maestro cards:
|
cardAddress Object Optional |
Card holder address. |
threeDSecure Object Required |
For any 3D Secure 2 requests.
authenticationSource
Indicates the type of channel used to initiate the transaction. Format:
Values:
Indicates the type of 3D Secure 2 challenge request. Format:
Values:
The customer initiated transaction type, that is exempt from SCA. Format:
Values:
|
Check the Payment Receipt Model response.
Creating a Collection
Partial collections are supported. Use the same ReceiptId to collect different amounts up to the original preauth amount.
You cannot collect more than the original amount.
Following the preAuth, prepare the collection:

Parameter |
Description |
---|---|
receiptId String Required |
Judopay’s reference for the transaction. Required for you to process the collection.
Get the |
yourPaymentReference String Required |
Set your unique reference for this payment. Format:
This value should be unique in order to protect your customers against duplicate transactions. With a server side integration, if a payment reference is not supplied, the transaction will not be processed. |
amount Float Required |
The amount to process. Format:
For currencies using a different structure please contact Judopay for support. |
Check the response: Payment Receipt Model.
Voiding a PreAuth Transaction
Cancel a pre-authorised transaction if the funds have not yet settled.
Voids cannot be performed on transactions that have been collected (partial or full).
Create a void request:

|
|
---|---|
judoId String Required |
Only applies to PHP integrations. Unique ID supplied by Judopay. Specific to a merchant and/or location. Format:
|
receiptId String Required |
The preAuth receiptId. Required for you to process the void. |
amount Decimal |
The amount field is required for PHP integrations. The amount to process. Format:
For currencies using a different structure please contact Judopay for support |
If response.HasError = false, check the Payment Receipt Modelresponse.
Creating a Payment
When handling exceptions, it is good practice to use Try Catch Block.
Create an instance of the CardPaymentModel:

|
|
---|---|
yourConsumerReference String Required |
Unique reference to anonymously identify your customer. Advisable to use GUIDs. Must be below 40 characters. |
yourPaymentReference String Required |
Set your unique reference for this payment. Format:
|
yourPaymentMetaData IDictionary Optional |
Additional information associated with a transaction to help reconcile. |
judoId String Required |
Unique ID supplied by Judopay. Specific to a merchant and/or location. Format:
|
amount Decimal Required |
The amount to process. Format:
For currencies using a different structure please contact Judopay for support. |
cardNumber String Required |
Submitted without whitespace or non-numeric characters. |
currency String Optional |
The currency of the transaction. Any ISO 4217 alphabetic currency code:
|
cv2 String Required |
The 3 or 4 digit number on the back of a credit card. Also known as the card verification value (CVV) or security code. |
primaryAccountDetails Object Optional |
Primary Account Holder Details:
|
userAgent String Optional |
Consumer's browser details. |
deviceCategory String Optional |
The type of device where the consumer is carrying out the transaction:
|
acceptHeaders String Optional |
Consumer's browser details. |
initialRecurringPayment Boolean Optional |
Indicates if this initial payment is part of a recurring payment. |
recurringPayment Boolean Optional |
Indicates if this is a recurring payment. If recurringPayment = true, remember to send the |
recurringPaymentType enum Optional |
Type of recurring payment. Values:
recurringPaymentType is required if |
relatedReceiptId String Optional |
The receiptId returned from the first subscription payment. Adding the relatedReceiptId references the subsequent recurring transactions to the original transaction. |
startDate String Optional |
For Maestro cards: Format:
|
issueNumber Integer Optional |
For Maestro cards:
|
cardAddress Object Optional |
Card holder address.
|
If response.HasError = false, check the Payment Receipt Model response.
3D Secure 2 Transaction Flow
Authenticate a 3D Secure 2 transaction to allow for additional transaction checks required for compliance with Strong Customer Authentication (SCA).
For more information on 3D Secure 2 and SCA, see What is Strong Customer Authentication?
Make sure your account has 3D Secure 2 enabled. Contact Customer Support to set this up.
The instance of the CardPaymentModel you created for Creating a Payment, just needs the following additional 3D Secure 2 parameters to be included:

Parameter |
Description |
---|---|
cardHolderName String Required |
The full name of the card holder. When testing in the sandbox environment, it is the cardHolderName that is used to determine the test card for 3D Secure 2 authentication. Format:
|
mobileNumber String Optional |
Consumer’s valid UK mobile number. |
phoneCountryCode String Optional |
The country code of the consumer's phone. |
emailAddress String Optional |
Consumer’s valid email address. It is recommended but not required for 3D Secure 2 authentication. |
threeDSecure Object Required |
For any 3D Secure 2 requests.
Indicates the type of channel used to initiate the transaction. Format:
Values:
Indicates the type of 3D Secure 2 challenge request. Format:
Values:
The customer initiated transaction type, that is exempt from SCA. Format:
Values:
Make sure when testing
The URL that will receive the method completion message, confirming the Issuer has completed the device details check. Format:
The URL that will receive the outcome of the challenge request to the consumer. Format:
|
If no additional transaction checks are required, you will receive the usual paymentReceipt response.
If additional transaction checks are required, you will receive the challenge response.

Parameter |
Description |
---|---|
cv2 String Required |
The 3 or 4 digit number on the back of a credit card. Also known as the card verification value (CVV) or security code. |
methodCompletion enum Required |
Indicates if the 3DS ACS method to collect the device details was completed successfully. Values:
|
primaryAccountDetails Object |
For MCC 6012 merchants, this object needs to be added to the request. Values:
|

Parameter |
Description |
---|---|
cv2 String Required |
The 3 or 4 digit number on the back of a credit card. Also known as the card verification value (CVV) or security code. |
primaryAccountDetails Object |
For MCC 6012 merchants, this object needs to be added to the request. Values:
|
Check the Payment Receipt Model response.
Payment Receipt Model

Parameter |
Description |
---|---|
receiptId String |
Judopay's reference for the transaction. Used to process refunds or collections. |
yourPaymentReference String |
Your unique reference for this payment.
This value should be unique in order to protect your customers against duplicate transactions. With a server side integration, if a payment reference is not supplied, the transaction will not be processed. |
typeString |
Type of transaction:
This transaction type is available from API Version 6.4.1 onwards. |
acquirerTransactionIDString |
The unique ID of a transaction set by the acquirer. |
createdAtDate |
An ISO8601 formatted date and time. Includes time zone offset. |
resultString |
Result of transaction. |
messageString |
Message detailing the outcome. |
externalBankResponseCode String |
Reason code provided by the bank for declined transactions. |
judoIdString |
Unique ID supplied by Judopay. Specific to a merchant and/or location. |
merchantNameString |
Merchant's trading name. |
appearsOnStatementAsString |
How the Merchant appears on the consumer's statement. |
originalAmountDecimal |
Amount of transaction. This field will not be included for Refund and PreAuth transaction types. |
amountCollectedDecimal |
Amount collected. This field will be included for the PreAuth transaction type. |
netAmountDecimal |
The remaining balance of the transaction after a refund. You cannot refund more than the original transaction amount. |
amountDecimal |
The amount to process. Format:
For currencies using a different structure please contact Judopay for support. |
currencyString |
The currency of the transaction. Any ISO 4217 alphabetic currency code:
|
cardDetailsObject |
Information on the card used in this transaction:
|
consumerObject |
Details of the consumer. Used for repeat transactions. Details:
|
device Object |
Specific device details to identify a consumer:
|
riskScoreInteger |
Consumer's risk score. |
yourPaymentMetaDataString |
Additional information associated with a transaction to help reconcile. |
threeDSecureObject |
For any 3DSecure requests .Includes the result of the authentication process:
|
risksObject |
Risk checks on:
|
recurringBoolean |
Is the transaction a recurring transaction?
If false, the field will not be returned. |
Creating a Refund
You can process a full or partial refund.
Ensure the Refund Payments permission is enabled on your API token.
Create a refund request:

|
|
---|---|
receiptId String Required |
Judopay’s reference for the transaction. Required for you to process the refund. |
amount Decimal Required |
The amount to process. Format:
For currencies using a different structure please contact Judopay for support |
yourPaymentReference String Required |
Your unique reference for this payment. Format:
|
If response.HasError = false, check the Payment Receipt Model response.
Going Live
Test all your required transaction types in the live environment before deploying your app.
You will need to have tested your app in the sandbox environment before going live.
1. Activate your Account
-
To process live payments, ensure you have a live account.
-
Complete the activation form for us to make the necessary changes to your account.
We will contact you as soon as you are live.
2. Point to the Live Environment
-
Replace your sandbox API Token and Secret for the live API Token and Secret
-
Find these in Judopay Portal > Your apps > {app name} > Live Tokens
-
3. Test Live Payments
-
Ensure the SDK is properly configured for the live environment
-
Use real debit or credit cards
-
Test cards provided will not work in live
-
We recommend to perform pre-authorizations followed by a void, or regular payments followed by a refund
-
Send a refund through the Judopay Portal > History
-
-
Test all payment scenarios and security features to verify the expected behaviour