.NET and PHP Integrations
- 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
For examples on integrating with the .NET Server SDK, see our sample app for more information.
Only sandbox API tokens and secrets will work in the sandbox. Using the wrong tokens and secrets will result in an authorisation failure.
- Ensure all integration steps are completed.
- Add your app’s sandbox Token and Secret: var client = JudoPaymentsFactory.Create( JudoEnvironment.Sandbox, <yourApiToken>, <yourApiSecret> );
- Ensure the SDK is configured for the sandbox environment.
- Use the test cards provided in the Judopay Portal:
- Tools > Generating transactions
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. For our DotNetSDK core sample app, see DotNetSDK.
The Server SDK allows for further configuration: Logging To help debug you can attach a logger library. Validation error details can be found in the modelErrors array. For example if a required field is missing from the model.
Other Payment Methods using the Server SDKs To send payment requests with the wallet details from Apple Pay™ and Google Pay™, see our Transaction API for more information.
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 Transaction API in order to check the card.
If result.HasError = false, check the Payment Receipt Model response.
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. authenticationSource indicates the type of channel used to initiate the transaction. Format:
Values:
challengeRequestIndicator Indicates the type of 3D Secure 2 challenge request. Format:
Values:
scaExemption The customer initiated transaction type, that is exempt from SCA. Format:
Values:
|
If result.HasError = false, check the Payment Receipt Model response.
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:
If result.HasError = false, check the Payment Receipt Model response.
You can create a token payment following a: Payment | PreAuth | Save Card operation, as a card token is always returned.
Create an instance of the TokenPaymentModel:
If result.HasError = false, check the Payment Receipt Model response.
Create an instance of the CardPayment Model:
If result.HasError = false, check the Payment Receipt Model response.
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:
Check the Payment Receipt Model response.
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:
If result.HasError = false, check the Payment Receipt Model response.
When handling exceptions, it is good practice to use Try Catch Block.
Create an instance of the CardPayment Model:
If result.HasError = false, check the Payment Receipt Model response.
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?
The instance of the CardPaymentModel you created for Creating a Payment, just needs the following additional 3D Secure 2 parameters to be included:
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.
Check the Payment Receipt Model response.
You can process a full or partial refund.
Ensure the Refund Payments permission is enabled on your API token.
Create a refund request:
Check the Payment Receipt Model response.
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.
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.
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
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.