Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

satispay/online-api-php-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Satispay Online API PHP SDK

Packagist Version Packagist Downloads

Deprecated API

For new integrations please use https://github.com/satispay/gbusiness-api-php-sdk.

Installation

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");

Documentation

https://s3-eu-west-1.amazonaws.com/docs.online.satispay.com/index.html

Authenticate with Bearer

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_...");

Authenticate with RSA Signature

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();

Enable Sandbox

To enable sandbox use setSandbox function.

\SatispayOnline\Api::setSandbox(true);