For new integrations please use https://github.com/satispay/gbusiness-api-php-sdk.
Run the following command:
composer require satispay/online-api-php-sdk
If you do not wish to use Composer, import the init.php
file.
require_once("/path/init.php");
https://s3-eu-west-1.amazonaws.com/docs.online.satispay.com/index.html
Sign in to your Dashboard at business.satispay.com, click "Negozi Online", click on "Crea codice di attivazione" and select "Security bearer" on top menu.
\SatispayOnline\Api::setSecurityBearer("osh_...");
Sign in to your Dashboard at business.satispay.com, click "Negozi Online", and then click on "Genera un token di attivazione" to generate an activation token.
Use the activation token with the authenticateWithToken
function to generate and exchange a pair of RSA keys.
Save the keys in your database or in a safe place not accesibile from your website.
// Authenticate and generate the keys
$authentication = \SatispayOnline\Api::authenticateWithToken("XXXXXX");
// Export keys
$publicKey = $authentication->publicKey;
$privateKey = $authentication->privateKey;
$keyId = $authentication->keyId;
Reuse the keys after authentication.
// Keys variables
$publicKey = "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhk...";
$privateKey = "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBg...";
$keyId = "ldg9sbq283og7ua1abpj989kbbm2g60us6f18c1sciq...";
// Set keys
\SatispayOnline\Api::setPublicKey($publicKey);
\SatispayOnline\Api::setPrivateKey($privateKey);
\SatispayOnline\Api::setKeyId($keyId);
// Test the authentication
\SatispayOnline\Api::testAuthentication();
To enable sandbox use setSandbox
function.
\SatispayOnline\Api::setSandbox(true);