Skip to content

bessone/online-api-php-sdk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Satispay Online API PHP SDK

Documentation

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

Install with Composer

composer require satispay/online-api-php-sdk

Configuration

// Set security bearer
\SatispayOnline\Api::setSecurityBearer('yoursecuritybearer');

// Set staging, true or false (not mandatory)
\SatispayOnline\Api::setStaging(true);

// Set client, use this format: Platform/x.x.x (not mandatory)
\SatispayOnline\Api::setClient('WordPress/4.8 WooCommerce/3.1.1');

// Get client
\SatispayOnline\Api::getClient();

Examples

Check bearer

\SatispayOnline\Api::setSecurityBearer('yoursecuritybearer');

try {
  \SatispayOnline\Bearer::check();
  echo 'OK';
} catch(\Exception $ex) {
  echo 'Invalid Security Bearer';
}

Users

Create user

\SatispayOnline\Api::setSecurityBearer('yoursecuritybearer');

$user = \SatispayOnline\User::create([
  'phone_number' => '+390000000000'
]);

Get users

\SatispayOnline\Api::setSecurityBearer('yoursecuritybearer');

$users = \SatispayOnline\User::all();

Get user

\SatispayOnline\Api::setSecurityBearer('yoursecuritybearer');

$user = \SatispayOnline\User::get('userid');

Charges

Create charge

\SatispayOnline\Api::setSecurityBearer('yoursecuritybearer');

$charge = \SatispayOnline\Charge::create([
  'user_id' => 'userid',
  'currency' => 'EUR',
  'amount' => 1000
]);

Get charges

\SatispayOnline\Api::setSecurityBearer('yoursecuritybearer');

$charges = \SatispayOnline\Charge::all();

Get charge

\SatispayOnline\Api::setSecurityBearer('yoursecuritybearer');

$charge = \SatispayOnline\Charge::get('chargeid');

Update charge

\SatispayOnline\Api::setSecurityBearer('yoursecuritybearer');

$charge = \SatispayOnline\Charge::update('chargeid', [
  'description' => 'newdescription'
]);

Refunds

Create refund

\SatispayOnline\Api::setSecurityBearer('yoursecuritybearer');

$refund = \SatispayOnline\Refund::create([
  'charge_id' => 'chargeid',
  'currency' => 'EUR',
  'amount' => 1000
]);

Get refunds

\SatispayOnline\Api::setSecurityBearer('yoursecuritybearer');

$refunds = \SatispayOnline\Refund::all();

Get refund

\SatispayOnline\Api::setSecurityBearer('yoursecuritybearer');

$refund = \SatispayOnline\Refund::get('refundid');

Packages

No packages published

Languages

  • PHP 100.0%