https://s3-eu-west-1.amazonaws.com/docs.online.satispay.com/index.html
composer require satispay/online-api-php-sdk
// 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();
\SatispayOnline\Api::setSecurityBearer('yoursecuritybearer');
try {
\SatispayOnline\Bearer::check();
echo 'OK';
} catch(\Exception $ex) {
echo 'Invalid Security Bearer';
}
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');
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'
]);
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');