Judopay Documentation

Server SDKs

Integrate with Judopay's Server SDKs.

Server SDK - .Net

For examples on integrating with the .Net Server SDK, see our sample app for more information.

Integration

  1. From Visual Studio launch NuGet Package Manager

  2. Search for JudoPay.Net 

  3. Add JudoPay.Net via

    1. GUI, or

    2. Package Manager Console 

  4. Add the JudoPay.Net package:

    Install-Package JudoPay.Net

Setup

  1. Ensure all integration steps are completed

  2. Add your app’s sandbox Token and Secret var client = JudoPaymentsFactory.Create<JudoEnvironment.Sandbox, "YOUR_API_TOKEN", "YOUR_API_SECRET">;

  3. Ensure the SDK is configured for the sandbox environment

  4. Use the test cards provided in the Judopay Portal:

    • Tools > Generating transactions

Tip

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.

Going Live with .Net

Use the live environment for testing before deploying your app.

Note

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

  • In JudoPaymentsFactory.Create method change the environment from Sandbox to Live:

    var client = JudoPaymentsFactory.Create(JudoEnvironment.Live, "YOUR_API_TOKEN", "YOUR_API_SECRET");

  • 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 PortalHistory

  • Test all payment scenarios and security features to verify the expected behaviour

Server SDK - PHP

For examples on Integrating PHP with the Server SDK, see our sample app for more information:

Integration Requirements

  • PHP 5.5 and above

  • Composer

Using Composer Package Manager:

  1. Add the Judopay package to your composer.json file:

"require": {    
    "judopay/judopay-sdk": "4.4.0"
}

2. Execute:

$ composer install

3. Make the Judopay SDK classes available: vendor/autoload.php file

Setup

  • Add the sandbox token and secret to your app

    $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
        )
    );
  • Ensure the SDK is configured for the sandbox environment

  • Use the test cards provided in the Judopay Portal: Tools > Generating transactions

 

The Server SDK allows further configuration:

Logging

To help debug you can attach a logger library. We recommend Monolog, however any PSR-3 standard library is compatible.

Going Live with PHP

Test all your required transaction types in the live environment.

Note

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

  • In the Judopay object change the production environment setting from false to true

  • Replace your sandbox API Token and Secret for the live API Token and Secret 

    $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' => true
        )
    );

Find these in Judopay Portal > Your apps > {app name} > Live Tokens