Judopay Documentation

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"
}
  1. Execute: $ composer install

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

Setup

  1. 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
        )
    );
  2. Ensure the SDK is configured for the sandbox environment

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

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.

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