SALT provides client libraries in several programming languages that you can use to connect to the SALT Payment Gateway.
You'll need a SALT account to use our client libraries. You can create a free Sandbox account by following the link below!
The built JAR file can be found in the
target/ folder of the project.
The Java source comes with several working code examples. To run the examples:
merchantIdin the project configuration.
mvn install -Psingle-purchase
mvn install -Psecure-storage
mvn install -Precurring-purchase
SALT's PHP library requires PHP version 5.3.0 or higher.
To use this library, include the SALT.php file and start using the library.
//Include the salt library include 'path/to/SALT/lib/SALT.php'; //Include the classes you want to use from the SALT namespace. use \SALT\Merchant; use \SALT\HttpsCreditCardService; ... //Initialize the SALT library (HttpsCreditCardService is the key class here) $url = 'https://test.saltpayments.com/gateway/creditcard/processor.do'; $merchant = new Merchant ('Merchant ID', 'API Key'); $service = new HttpsCreditCardService($merchant, $url); ... // Perform charges, refunds, etc. See Client Library API for info.
Any transaction errors, validation errors, connection errors, or other types of errors will cause a \SALT\SaltError (Exception). Make sure to catch these exceptions and handle them appropriately.
To run the tests, you'll need PHPUnit. Run the following on your command line from the root directory of this project:
phpunit --bootstrap lib/Salt.php tests/