Please note that this page contains technical information which is intended to help developers start using our SDK.
Quick example on how to use method Cards with functionality payment_init.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'cards';
$api_parameters['func'] = 'payment_init';
$api_parameters['get_variables'] = array();
$api_parameters['method_params'] = array(
'payment' => array( // MANDATORY
'merchanttransactionid' => '', // MANDATORY - Payment merchant assigned transaction ID
'skinid' => null, // Skin ID to be used
'originatortransactionid' => null, // A number that uniquely identifies the transaction in the original requester's system
'amount' => 0, // MANDATORY - Payment amount
'currency' => '', // MANDATORY - Payment currency
'returnurl' => '', // MANDATORY - Payment return URL
'description' => null, // Payment description
'statementdescriptor' => null, // Payment statement description
'billingaddress' => array(
'id' => 0, // Address ID
'country' => '', // Address country
'city' => '', // Address city
'zipcode' => '', // Address zipcode
'state' => '', // Address state
'street' => '', // Address street name
'streetnumber' => '', // Address street number
'housenumber' => '', // Address house number
'houseextension' => '', // Address house extension
),
'shippingaddress' => array(
'id' => 0, // Address ID
'country' => '', // Address country
'city' => '', // Address city
'zipcode' => '', // Address zipcode
'state' => '', // Address state
'street' => '', // Address street name
'streetnumber' => '', // Address street number
'housenumber' => '', // Address house number
'houseextension' => '', // Address house extension
),
'customer' => array(
'id' => 0, // Customer ID
'merchantcustomerid' => null, // Merchant assigned customer ID
'email' => null, // Customer email
'firstname' => null, // Customer first name
'lastname' => null, // Customer last name
'gender' => null, // Customer gender
'dateofbirth' => null, // Customer date of birth
'socialsecuritynumber' => null, // Customer social security number
'phone' => null, // Customer phone
'company' => null, // Customer company
),
'card' => array(
'holdername' => '', // Card holder name
'number' => '', // Card number
'expirationmonth' => '', // Card expiration month
'expirationyear' => '', // Card expiration year
'issuingbankcountry' => '', // Card issuing bank country
'securitycode' => '', // Card security code (CVV2)
'requiresecuritycode' => null, // If set to false when the security code parameter is not used, it will not redirect to the form page to fill in the security code, but the payment will be directly sent to the payment provider.
'token' => '', // Card token
'maskednumber' => '', // Card masked number
),
'creditcardtoken' => array( // Credit card token structure
'value' => '', // Token value
'requiresecuritycode' => null, // Should payer be asked for CVV/CVC?
'securitycode' => '', // Token security code
),
'installments' => null, // Payment split into installments
'splits' => array(
'0' => array(
'siteid' => null, // Refund site ID
'amount' => 0, // Split payment amount
'merchanttransactionid' => '', // Payment merchant assigned transaction ID
'originatortransactionid' => '', // A number that uniquely identifies the transaction in the original requester's system
),
),
'capture' => null, // Should capture payment?
'retry' => null, // Should retry payment?
'3dsecure' => null, // Should try a 3D secure payment?
'3dsecuredata' => array(
'authenticationstatus' => '', // Authentication status
'eci' => '', // ECI
'cavv' => '', // CAVV
'dsid' => '', // DSID
'3dsecureversion' => '', // 3D secure version
),
'deviceinfo' => array(
'browseracceptheader' => '', // Browser accept header
'browseruseragent' => '', // Browser user agent
'browserjavaenabled' => true, // Broser Java enabled
'browserjavascriptenabled' => true, // Browser JavaScript enabled
'browserlanguage' => '', // Browser language
'browsercolordepth' => 0, // Browser color depth
'browserscreenheight' => 0, // Browser screen height
'browserscreenwidth' => 0, // Browser screen width
'browsertimezone' => 0, // Browser timezone
),
'scaexemption' => '', // Sca exemption
'cardonfile' => array(
'isinitial' => true, // Is initial
'type' => '', // Transaction type
'initialpaymentid' => 0, // Initial payment id
),
'language' => '', // Language used
'generatecreditcardtoken' => null, // Should return credit card token in response?
'moto' => null, // If set to true, the payment will be marked at the acquirer as Mail Order Telephone Order type of transaction. This is not available for all acquirers.
'paymenttokenlifetime' => null, // Payment token lifetime
),
);
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Cards with functionality payment_details.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'cards';
$api_parameters['func'] = 'payment_details';
$api_parameters['get_variables'] = array(
'id' => 0, // Payment ID MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Cards with functionality payment_status.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'cards';
$api_parameters['func'] = 'payment_status';
$api_parameters['get_variables'] = array(
'id' => 0, // Payment ID MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Cards with functionality payment_capture.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'cards';
$api_parameters['func'] = 'payment_capture';
$api_parameters['get_variables'] = array(
'id' => 0, // Payment ID MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Cards with functionality split_capture.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'cards';
$api_parameters['func'] = 'split_capture';
$api_parameters['get_variables'] = array(
'id' => 0, // Payment ID MANDATORY
);
$api_parameters['method_params'] = array(
'payment' => array( // MANDATORY
'split' => array( // MANDATORY
'id' => 0, // MANDATORY - Split ID to be captured
'amount' => 0, // MANDATORY - Split amount to be captured
'originatortransactionid' => '', // A number that uniquely identifies the transaction in the original requester's system (if required)
),
'totalcapturecount' => null, // Total number of captures that will be performed on this split
),
);
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Cards with functionality payment_cancel.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'cards';
$api_parameters['func'] = 'payment_cancel';
$api_parameters['get_variables'] = array(
'id' => 0, // Payment ID MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Cards with functionality payments_list.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'cards';
$api_parameters['func'] = 'payments_list';
$api_parameters['get_variables'] = array(
'limit' => 0, // Rows limit
'start_date' => '', // Interval starting date
'end_date' => '', // Interval ending date
'country' => '', // Country
'currency' => '', // Currency
'minimum_amount' => 0, // Minimum amount
'maximum_amount' => 0, // Maximum amount
'merchant_transaction_id' => '', // Merchant transaction ID
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Cards with functionality refund_init.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'cards';
$api_parameters['func'] = 'refund_init';
$api_parameters['get_variables'] = array(
'id' => 0, // Payment ID MANDATORY
);
$api_parameters['method_params'] = array(
'refund' => array( // MANDATORY
'merchanttransactionid' => '', // MANDATORY - Refund merchant assigned transaction ID
'originatortransactionid' => '', // A number that uniquely identifies the transaction in the original requester's system
'amount' => 0, // MANDATORY - Refund amount
'description' => '', // Refund description
'statementdescriptor' => '', // Refund statement description
'captureid' => 0, // Mandatory only when refunding a payment that has multiple partial captures
'splitid' => 0, // SplitID for which we want to initiate the refund (if we refund a split)
),
);
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Cards with functionality split_refund.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'cards';
$api_parameters['func'] = 'split_refund';
$api_parameters['get_variables'] = array(
'id' => 0, // Payment ID MANDATORY
'split_id' => 0, // Payment Split ID MANDATORY
);
$api_parameters['method_params'] = array(
'refund' => array( // MANDATORY
'merchanttransactionid' => '', // MANDATORY - Refund merchant assigned transaction ID
'originatortransactionid' => '', // A number that uniquely identifies the transaction in the original requester's system
'amount' => 0, // MANDATORY - Refund amount
'description' => '', // Refund description
'statementdescriptor' => '', // Refund statement description
'captureid' => 0, // MANDATORY - Mandatory only when refunding a payment that has multiple partial captures
'splitid' => 0, // SplitID for which we want to initiate the refund (if we refund a split)
),
);
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Cards with functionality refunds_list.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'cards';
$api_parameters['func'] = 'refunds_list';
$api_parameters['get_variables'] = array(
'id' => 0, // Payment ID MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Cards with functionality refund_details.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'cards';
$api_parameters['func'] = 'refund_details';
$api_parameters['get_variables'] = array(
'payment_id' => 0, // Payment ID MANDATORY
'id' => 0, // Refund ID MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Cards with functionality refund_status.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'cards';
$api_parameters['func'] = 'refund_status';
$api_parameters['get_variables'] = array(
'id' => 0, // Refund ID MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Cards with functionality payout_init.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'cards';
$api_parameters['func'] = 'payout_init';
$api_parameters['get_variables'] = array();
$api_parameters['method_params'] = array(
'payout' => array( // MANDATORY
'merchanttransactionid' => '', // MANDATORY - Payout merchant assigned transaction ID
'amount' => 0, // MANDATORY - Payout amount
'currency' => '', // MANDATORY - Payout currency
'description' => null, // Payout description
'methodid' => 0, // Payment method ID
'statementdescriptor' => null, // Payout statement description
'billingaddress' => array(
'id' => 0, // Address ID
'country' => '', // Address country
'city' => '', // Address city
'zipcode' => '', // Address zipcode
'state' => '', // Address state
'street' => '', // Address street name
'streetnumber' => '', // Address street number
'housenumber' => '', // Address house number
'houseextension' => '', // Address house extension
),
'customer' => array(
'id' => 0, // Customer ID
'merchantcustomerid' => null, // Merchant assigned customer ID
'email' => null, // Customer email
'firstname' => null, // Customer first name
'lastname' => null, // Customer last name
'gender' => null, // Customer gender
'dateofbirth' => null, // Customer date of birth
'socialsecuritynumber' => null, // Customer social security number
'phone' => null, // Customer phone
'company' => null, // Customer company
),
'card' => array(
'holdername' => '', // Card holder name
'number' => '', // Card number
'expirationmonth' => '', // Card expiration month
'expirationyear' => '', // Card expiration year
'issuingbankcountry' => '', // Card issuing bank country
'securitycode' => '', // Card security code (CVV2)
'requiresecuritycode' => null, // If set to false when the security code parameter is not used, it will not redirect to the form page to fill in the security code, but the payment will be directly sent to the payment provider.
'token' => '', // Card token
'maskednumber' => '', // Card masked number
),
'details' => array(
'0' => array(
'customeriban' => '', // Customer IBAN
'customerbankaccountid' => '', // Customer bank account id
'cryptoaddress' => '', // Address when paying with crypto
'cryptocurrency' => null, // Crypto currency
'Securityquestion' => '', // Security question
'securityanswer' => '', // Security answer
'ipaddress' => '', // IP Address
),
),
),
);
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Cards with functionality payouts_list.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'cards';
$api_parameters['func'] = 'payouts_list';
$api_parameters['get_variables'] = array();
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Cards with functionality payout_details.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'cards';
$api_parameters['func'] = 'payout_details';
$api_parameters['get_variables'] = array(
'id' => 0, // Payout ID MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Cards with functionality payout_status.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'cards';
$api_parameters['func'] = 'payout_status';
$api_parameters['get_variables'] = array(
'id' => 0, // Payout ID MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Cards with functionality card_auth_init.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'cards';
$api_parameters['func'] = 'card_auth_init';
$api_parameters['get_variables'] = array();
$api_parameters['method_params'] = array(
'card_authentication' => array( // MANDATORY
'customer' => array(
'id' => 0, // Customer ID
'merchantcustomerid' => null, // Merchant assigned customer ID
'email' => null, // Customer email
'firstname' => null, // Customer first name
'lastname' => null, // Customer last name
'gender' => null, // Customer gender
'dateofbirth' => null, // Customer date of birth
'socialsecuritynumber' => null, // Customer social security number
'phone' => null, // Customer phone
'company' => null, // Customer company
'inputdatetime' => null, // Customer creation date
),
'billingaddress' => array(
'id' => 0, // Address ID
'country' => '', // Address country
'city' => '', // Address city
'zipcode' => '', // Address zipcode
'state' => '', // Address state
'street' => '', // Address street name
'streetnumber' => '', // Address street number
'housenumber' => '', // Address house number
'houseextension' => '', // Address house extension
),
'card' => array( // MANDATORY
'holdername' => '', // Card holder name
'number' => '', // MANDATORY - Card number
'expirationmonth' => '', // Card expiration month
'expirationyear' => '', // Card expiration year
'issuingbankcountry' => '', // Card issuing bank country
'securitycode' => '', // Card security code (CVV2)
'requiresecuritycode' => null, // If set to false when the security code parameter is not used, it will not redirect to the form page to fill in the security code, but the payment will be directly sent to the payment provider.
'token' => '', // Card token
'maskednumber' => '', // Card masked number
),
),
);
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Cards with functionality card_auth_details.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'cards';
$api_parameters['func'] = 'card_auth_details';
$api_parameters['get_variables'] = array(
'token' => '', // Card Authentication Token MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Cards with functionality card_auth_cancel.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'cards';
$api_parameters['func'] = 'card_auth_cancel';
$api_parameters['get_variables'] = array(
'token' => '', // Card Authentication Token MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Cards with functionality captures_list.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'cards';
$api_parameters['func'] = 'captures_list';
$api_parameters['get_variables'] = array(
'id' => 0, // Payment ID MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Cards with functionality capture_details.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'cards';
$api_parameters['func'] = 'capture_details';
$api_parameters['get_variables'] = array(
'payment_id' => 0, // Payment ID MANDATORY
'id' => 0, // Capture ID MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Exchangerates with functionality exchangerates.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'echangerates';
$api_parameters['func'] = 'exchangerates';
$api_parameters['get_variables'] = array(
'from_currency' => '', // From currency MANDATORY
'to_currency' => '', // To currency MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Merchants with functionality merchant_details.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'merchants';
$api_parameters['func'] = 'merchant_details';
$api_parameters['get_variables'] = array(
'id' => 0, // Merchant ID MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Merchants with functionality merchant_create.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'merchants';
$api_parameters['func'] = 'merchant_create';
$api_parameters['get_variables'] = array();
$api_parameters['method_params'] = array(
'merchant' => array(
'company_name' => '', // Merchant company name
'company_address' => '', // Merchant company address
'merchant' => array(
'alias' => null, // Merchant alias
'active' => null, // Merchant status
'provider_merchant_id' => null, // ID of merchant provider
'required_site_id' => null, // Requested site ID
),
'user' => array(
'name' => null, // Account username
'password' => null, // Account password
'email' => null, // Account email
'siteid' => null, // Site ID attached to this account
'roleid' => null, // Role ID assigned to user account
),
'merchant_site' => array(
'id' => null, // Site ID
'merchantid' => 0, // ID of merchant that owns the site
'created' => null, // Site date of creation
'url' => null, // Site URL
'active' => null, // Site status
'notificationurl' => null, // Notification URL
'alias' => null, // Site alias
'apikey' => null, // Site REST API key
'iplist' => null, // IPs Whitelist
'details' => array(
'reasons' => array( // Possible error codes
'0' => array(
'code' => 0, // Error code
'info' => '', // Error message
),
),
'name' => null, // Site Name
'country' => null, // Site Country
'city' => null, // Site City
'email' => null, // Site contact email address
'address' => null, // Site contact address
'bankname' => null, // Site bank name
'accountiban' => null, // Site account IBAN
'accountswift' => null, // Site account SWIFT
'bankswiftid' => null, // Site bank SWIFT
'bankcode' => null, // Site bank code
'vatnumber' => null, // Site VAT number
'registrationnumber' => null, // Site registration number
'mcc' => null, // Site company MCC
'main_business' => null, // Site company main business
),
),
),
);
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Merchants with functionality merchant_edit.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'merchants';
$api_parameters['func'] = 'merchant_edit';
$api_parameters['get_variables'] = array(
'id' => 0, // Site ID MANDATORY
);
$api_parameters['method_params'] = array(
'merchant' => array(
'alias' => null, // Merchant alias
'active' => null, // Merchant status
'provider_merchant_id' => null, // ID of merchant provider
'required_site_id' => null, // Requested site ID
),
);
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Merchants with functionality merchant_delete.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'merchants';
$api_parameters['func'] = 'merchant_delete';
$api_parameters['get_variables'] = array(
'id' => 0, // Merchant ID MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Merchantsites with functionality list_all.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'merchantsites';
$api_parameters['func'] = 'list_all';
$api_parameters['get_variables'] = array();
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Merchantsites with functionality site_details.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'merchantsites';
$api_parameters['func'] = 'site_details';
$api_parameters['get_variables'] = array(
'id' => 0, // Site ID MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Merchantsites with functionality site_create.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'merchantsites';
$api_parameters['func'] = 'site_create';
$api_parameters['get_variables'] = array();
$api_parameters['method_params'] = array(
'merchantsite' => array( // MANDATORY
'merchantid' => 0, // ID of merchant that owns the site
'url' => '', // MANDATORY - Site URL
'active' => null, // Site status
'notificationurl' => '', // MANDATORY - Notification URL
'alias' => null, // Site alias
'iplist' => null, // IPs Whitelist
'details' => array(
'name' => null, // Site Name
'country' => null, // Site Country
'city' => null, // Site City
'email' => null, // Site contact email address
'address' => null, // Site contact address
'bankname' => null, // Site bank name
'accountiban' => null, // Site account IBAN
'accountswift' => null, // Site account SWIFT
'bankswiftid' => null, // Site bank SWIFT
'bankcode' => null, // Site bank code
'vatnumber' => null, // Site VAT number
'registrationnumber' => null, // Site registration number
'mcc' => null, // Site company MCC
'main_business' => null, // Site company main business
),
),
);
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Merchantsites with functionality site_edit.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'merchantsites';
$api_parameters['func'] = 'site_edit';
$api_parameters['get_variables'] = array(
'id' => 0, // Site ID MANDATORY
);
$api_parameters['method_params'] = array(
'merchantsite' => array(
'merchantid' => 0, // ID of merchant that owns the site
'url' => null, // Site URL
'active' => null, // Site status
'notificationurl' => null, // Notification URL
'alias' => null, // Site alias
'iplist' => null, // IPs Whitelist
'details' => array(
'reasons' => array( // Possible error codes
'0' => array(
'code' => 0, // Error code
'info' => '', // Error message
),
),
'name' => null, // Site Name
'country' => null, // Site Country
'city' => null, // Site City
'email' => null, // Site contact email address
'address' => null, // Site contact address
'bankname' => null, // Site bank name
'accountiban' => null, // Site account IBAN
'accountswift' => null, // Site account SWIFT
'bankswiftid' => null, // Site bank SWIFT
'bankcode' => null, // Site bank code
'vatnumber' => null, // Site VAT number
'registrationnumber' => null, // Site registration number
'mcc' => null, // Site company MCC
'main_business' => null, // Site company main business
),
),
);
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Merchantsites with functionality site_delete.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'merchantsites';
$api_parameters['func'] = 'site_delete';
$api_parameters['get_variables'] = array(
'id' => 0, // Site ID MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Merchantsites with functionality regen_apikey.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'merchantsites';
$api_parameters['func'] = 'regen_apikey';
$api_parameters['get_variables'] = array(
'id' => 0, // Site ID MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Methods with functionality list_all.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'methods';
$api_parameters['func'] = 'list_all';
$api_parameters['get_variables'] = array(
'additional_details' => , // Additional details
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Methods with functionality method_details.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'methods';
$api_parameters['func'] = 'method_details';
$api_parameters['get_variables'] = array(
'id' => 0, // Method ID MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Methods with functionality for_country.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'methods';
$api_parameters['func'] = 'for_country';
$api_parameters['get_variables'] = array(
'country' => '', // Country MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Methods with functionality assigned_methods.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'methods';
$api_parameters['func'] = 'assigned_methods';
$api_parameters['get_variables'] = array(
'additional_details' => , // Additional details
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Methods with functionality assigned_for_country.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'methods';
$api_parameters['func'] = 'assigned_for_country';
$api_parameters['get_variables'] = array(
'country' => '', // Country MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Payments with functionality payment_init.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'payments';
$api_parameters['func'] = 'payment_init';
$api_parameters['get_variables'] = array();
$api_parameters['method_params'] = array(
'payment' => array( // MANDATORY
'skinid' => null, // Skin ID to be used
'clientip' => null,
'merchanttransactionid' => '', // MANDATORY - Payment merchant assigned transaction ID
'originatortransactionid' => null, // A number that uniquely identifies the transaction in the original requester's system
'amount' => 0, // MANDATORY - Payment amount
'currency' => '', // MANDATORY - Payment currency
'returnurl' => '', // MANDATORY - Payment return URL
'description' => null, // Payment description
'preapprovalid' => null, // Payment preapproval ID
'methodid' => null, // Payment method ID
'methodoptionid' => null, // Payment method option ID
'guaranteed' => null, // Try using guaranteed payment methods
'redirectiniframe' => null, // Payment redirect in IFrame
'redirectmerchantiniframe' => null, // Payment redirect in IFrame
'includemethodids' => null,
'excludemethodids' => null,
'prioritizemethodids' => null,
'details' => array(
'bankcode' => '', // Payment bank code
'accountnumber' => '', // Payment account number
'iban' => '', // Payment IBAN
'bic' => '', // Payment BIC
'entityid' => '', // Payment entity ID
'referenceid' => '', // Payment reference ID
'entitynumber' => '', // Payment entity number
'referencenumber' => '', // Payment reference number
'accountholder' => '', // Payment account holder
'bankname' => '', // Payment bank name
'banksortcode' => '', // Payment bank sort code
'socialsecuritynumber' => '', // Payer social security number
'swift_bic' => '', // Payment SWIFT / BIC
'accountcurrency' => '', // Payment account currency
'prepaidcard' => '', // Payment prepaid card
'prepaidcardpin' => '', // Payment prepaid card PIN
'serialnumbers' => '', // Payment serial numbers
'wallet' => '', // Customer wallet
'payercountry' => '', // Payer country ISO 2 characters
'payeremail' => '', // Payer email address
'payerphone' => '', // Payer phone number
'billingcyclestart' => '', // Payment billing cycle start
'billingcycleend' => '', // Payment billing cycle end
'unsubscribeinstructions' => '', // Unsubscribe instructions
'customerloginid' => '', // Customer login ID
'paidamount' => 0, // Paid amount
'paidcurrency' => null, // Paid currency
'providerexchangerate' => 0, // Provider exchange rate
'payerbankaccountid' => '', // Payer bank account ID
'ismobileapp' => null, // Payment is initiated in a mobile app
'isoffline' => null, // Offline payment method
'storename' => '', // Store name. Can be null only when the store information is verified
'storeid' => '', // Store ID
'terminalid' => '', // Terminal ID
),
'preapprovaldetails' => array( // Preapproval details
'preapprovedmaximumamount' => 0, // Preapproved maximum amount
'merchantpreapprovalid' => '', // Preapproval id provided by merchant
'frequency' => '', // Preapproval frequency
'preapprovaldescription' => '', // Preapproval description
),
'customparameters' => null,
'customer' => array(
'id' => 0, // Customer ID
'merchantcustomerid' => null, // Merchant assigned customer ID
'email' => null, // Customer email
'firstname' => null, // Customer first name
'lastname' => null, // Customer last name
'gender' => null, // Customer gender
'dateofbirth' => null, // Customer date of birth
'socialsecuritynumber' => null, // Customer social security number
'phone' => null, // Customer phone
'company' => null, // Customer company
),
'billingaddress' => array(
'id' => 0, // Address ID
'country' => '', // Address country
'city' => '', // Address city
'zipcode' => '', // Address zipcode
'state' => '', // Address state
'street' => '', // Address street name
'streetnumber' => '', // Address street number
'housenumber' => '', // Address house number
'houseextension' => '', // Address house extension
),
'shippingaddress' => array(
'id' => 0, // Address ID
'country' => '', // Address country
'city' => '', // Address city
'zipcode' => '', // Address zipcode
'state' => '', // Address state
'street' => '', // Address street name
'streetnumber' => '', // Address street number
'housenumber' => '', // Address house number
'houseextension' => '', // Address house extension
),
'articles' => array(
'0' => array(
'merchantarticleid' => '0', // Merchant assigned article ID
'name' => '', // Article name
'quantity' => 0, // Article quantity
'price' => 0, // Article price in centimes
'vat' => 0, // VAT percent in centimes
'discount' => 0, // Discount percent in centimes
'discountvalue' => 0, // Integer value e.g 10 GBP discount (value with two decimals for 10 GBP send 1000)
'type' => 0, // Article type
'taxtype' => 0, // Tax type
),
),
'splits' => array(
'0' => array(
'siteid' => null, // Refund site ID
'amount' => 0, // Split payment amount
'merchanttransactionid' => '', // Payment merchant assigned transaction ID
'originatortransactionid' => '', // A number that uniquely identifies the transaction in the original requester's system
),
),
'executiondate' => '', // Direct Debit executed at a specific date
'language' => '', // Language used
'tokenlifetime' => null, // Payment token lifetime
),
);
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Payments with functionality payment_recurrent.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'payments';
$api_parameters['func'] = 'payment_recurrent';
$api_parameters['get_variables'] = array();
$api_parameters['method_params'] = array(
'payment' => array( // MANDATORY
'skinid' => null, // Skin ID to be used
'clientip' => null,
'merchanttransactionid' => '', // MANDATORY - Payment merchant assigned transaction ID
'originatortransactionid' => null, // A number that uniquely identifies the transaction in the original requester's system
'amount' => 0, // MANDATORY - Payment amount
'currency' => '', // MANDATORY - Payment currency
'returnurl' => null, // Payment return URL
'description' => null, // Payment description
'preapprovalid' => 0, // MANDATORY - Payment preapproval ID
'methodid' => null, // Payment method ID
'methodoptionid' => null, // Payment method option ID
'guaranteed' => null, // Try using guaranteed payment methods
'redirectiniframe' => null, // Payment redirect in IFrame
'redirectmerchantiniframe' => null, // Payment redirect in IFrame
'includemethodids' => null,
'excludemethodids' => null,
'prioritizemethodids' => null,
'details' => array(
'bankcode' => '', // Payment bank code
'accountnumber' => '', // Payment account number
'iban' => '', // Payment IBAN
'bic' => '', // Payment BIC
'entityid' => '', // Payment entity ID
'referenceid' => '', // Payment reference ID
'entitynumber' => '', // Payment entity number
'referencenumber' => '', // Payment reference number
'accountholder' => '', // Payment account holder
'bankname' => '', // Payment bank name
'banksortcode' => '', // Payment bank sort code
'socialsecuritynumber' => '', // Payer social security number
'swift_bic' => '', // Payment SWIFT / BIC
'accountcurrency' => '', // Payment account currency
'prepaidcard' => '', // Payment prepaid card
'prepaidcardpin' => '', // Payment prepaid card PIN
'serialnumbers' => '', // Payment serial numbers
'wallet' => '', // Customer wallet
'payercountry' => '', // Payer country ISO 2 characters
'payeremail' => '', // Payer email address
'payerphone' => '', // Payer phone number
'billingcyclestart' => '', // Payment billing cycle start
'billingcycleend' => '', // Payment billing cycle end
'unsubscribeinstructions' => '', // Unsubscribe instructions
'customerloginid' => '', // Customer login ID
'paidamount' => 0, // Paid amount
'paidcurrency' => null, // Paid currency
'providerexchangerate' => 0, // Provider exchange rate
'payerbankaccountid' => '', // Payer bank account ID
'ismobileapp' => null, // Payment is initiated in a mobile app
'isoffline' => null, // Offline payment method
'storename' => '', // Store name. Can be null only when the store information is verified
'storeid' => '', // Store ID
'terminalid' => '', // Terminal ID
),
'preapprovaldetails' => array( // Preapproval details
'preapprovedmaximumamount' => 0, // Preapproved maximum amount
'merchantpreapprovalid' => '', // Preapproval id provided by merchant
'frequency' => '', // Preapproval frequency
'preapprovaldescription' => '', // Preapproval description
),
'customparameters' => null,
'customer' => array( // MANDATORY
'id' => 0, // Customer ID
'merchantcustomerid' => null, // Merchant assigned customer ID
'email' => '', // MANDATORY - Customer email
'firstname' => null, // Customer first name
'lastname' => null, // Customer last name
'gender' => null, // Customer gender
'dateofbirth' => null, // Customer date of birth
'socialsecuritynumber' => null, // Customer social security number
'phone' => null, // Customer phone
'company' => null, // Customer company
'inputdatetime' => null, // Customer creation date
),
'billingaddress' => array(
'id' => 0, // Address ID
'country' => '', // Address country
'city' => '', // Address city
'zipcode' => '', // Address zipcode
'state' => '', // Address state
'street' => '', // Address street name
'streetnumber' => '', // Address street number
'housenumber' => '', // Address house number
'houseextension' => '', // Address house extension
),
'shippingaddress' => array(
'id' => 0, // Address ID
'country' => '', // Address country
'city' => '', // Address city
'zipcode' => '', // Address zipcode
'state' => '', // Address state
'street' => '', // Address street name
'streetnumber' => '', // Address street number
'housenumber' => '', // Address house number
'houseextension' => '', // Address house extension
),
'articles' => array(
'0' => array(
'merchantarticleid' => '0', // Merchant assigned article ID
'name' => '', // Article name
'quantity' => 0, // Article quantity
'price' => 0, // Article price in centimes
'vat' => 0, // VAT percent in centimes
'discount' => 0, // Discount percent in centimes
'discountvalue' => 0, // Integer value e.g 10 GBP discount (value with two decimals for 10 GBP send 1000)
'type' => 0, // Article type
'taxtype' => 0, // Tax type
),
),
'splits' => array(
'0' => array(
'siteid' => null, // Refund site ID
'amount' => 0, // Split payment amount
'merchanttransactionid' => '', // Payment merchant assigned transaction ID
'originatortransactionid' => '', // A number that uniquely identifies the transaction in the original requester's system
),
),
'executiondate' => '', // Direct Debit executed at a specific date
'language' => '', // Language used
'tokenlifetime' => null, // Payment token lifetime
),
);
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Payments with functionality payment_details.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'payments';
$api_parameters['func'] = 'payment_details';
$api_parameters['get_variables'] = array(
'id' => 0, // Payment ID MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Payments with functionality payment_capture.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'payments';
$api_parameters['func'] = 'payment_capture';
$api_parameters['get_variables'] = array(
'id' => 0, // Payment ID MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Payments with functionality split_capture.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'payments';
$api_parameters['func'] = 'split_capture';
$api_parameters['get_variables'] = array(
'id' => 0, // Payment ID MANDATORY
'split_id' => 0, // Payment Split ID MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Payments with functionality payment_cancel.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'payments';
$api_parameters['func'] = 'payment_cancel';
$api_parameters['get_variables'] = array(
'id' => 0, // Payment ID MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Payments with functionality payments_list.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'payments';
$api_parameters['func'] = 'payments_list';
$api_parameters['get_variables'] = array(
'page_size' => 0, // Records per page
'page_index' => 0, // Page index
'sort_direction' => '', // Sort direction
'sort_by' => '', // Sorting results by
'start_date' => '', // Interval starting date
'end_date' => '', // Interval ending date
'method_id' => 0, // Method ID
'country' => '', // Country
'currency' => '', // Currency
'minimum_amount' => 0, // Minimum amount
'maximum_amount' => 0, // Maximum amount
'merchant_transaction_id' => '', // Merchant transaction ID
'status_id' => 0, // Transaction status
'method_transaction_id' => '', // Method transaction ID
'type_id' => '', // Transaction type
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Payments with functionality refund_types.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'payments';
$api_parameters['func'] = 'refund_types';
$api_parameters['get_variables'] = array(
'id' => 0, // Payment ID MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Payments with functionality refund.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'payments';
$api_parameters['func'] = 'refund';
$api_parameters['get_variables'] = array(
'id' => 0, // Payment ID MANDATORY
);
$api_parameters['method_params'] = array(
'refund' => array( // MANDATORY
'merchanttransactionid' => '', // MANDATORY - Refund merchant assigned transaction ID
'originatortransactionid' => '', // A number that uniquely identifies the transaction in the original requester's system
'amount' => 0, // MANDATORY - Refund amount
'description' => null, // Refund description
'details' => array(
'customeraccountnumber' => '', // Refund customer account number
'cpfaccountholder' => '', // Refund CPF account holder
'bankname' => '', // Refund bank name
'bankaccounttype' => '', // Refund bank account type
'bankbranch' => '', // Refund bank branch
'bankcode' => '', // Refund bank code
'bankagencycode' => '', // Refund bank agency code
'bankaccountnumber' => '', // Refund account number
'bankswiftid' => '', // Refund bank SWIFT ID
'banksortcode' => '', // Refund bank sort code
'customeriban' => '', // Refund customer IBAN
),
'customer' => array(
'id' => 0, // Customer ID
'merchantcustomerid' => null, // Merchant assigned customer ID
'email' => null, // Customer email
'firstname' => null, // Customer first name
'lastname' => null, // Customer last name
'gender' => null, // Customer gender
'dateofbirth' => null, // Customer date of birth
'socialsecuritynumber' => null, // Customer social security number
'phone' => null, // Customer phone
'company' => null, // Customer company
),
'billingaddress' => array(
'id' => 0, // Address ID
'country' => '', // Address country
'city' => '', // Address city
'zipcode' => '', // Address zipcode
'state' => '', // Address state
'street' => '', // Address street name
'streetnumber' => '', // Address street number
'housenumber' => '', // Address house number
'houseextension' => '', // Address house extension
),
'bankaddress' => array(
'id' => 0, // Address ID
'country' => '', // Address country
'city' => '', // Address city
'zipcode' => '', // Address zipcode
'state' => '', // Address state
'street' => '', // Address street name
'streetnumber' => '', // Address street number
'housenumber' => '', // Address house number
'houseextension' => '', // Address house extension
),
'articles' => array(
'0' => array(
'merchantarticleid' => '0', // Merchant assigned article ID
'name' => '', // Article name
'quantity' => 0, // Article quantity
'price' => 0, // Article price in centimes
'vat' => 0, // VAT percent in centimes
'discount' => 0, // Discount percent in centimes
'discountvalue' => 0, // Integer value e.g 10 GBP discount (value with two decimals for 10 GBP send 1000)
'type' => 0, // Article type
'taxtype' => 0, // Tax type
),
),
'tokenlifetime' => null, // Refund token lifetime
),
);
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Payments with functionality split_refund.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'payments';
$api_parameters['func'] = 'split_refund';
$api_parameters['get_variables'] = array(
'id' => 0, // Payment ID MANDATORY
'split_id' => 0, // Payment Split ID MANDATORY
);
$api_parameters['method_params'] = array(
'refund' => array( // MANDATORY
'merchanttransactionid' => '', // MANDATORY - Refund merchant assigned transaction ID
'originatortransactionid' => '', // A number that uniquely identifies the transaction in the original requester's system
'amount' => 0, // MANDATORY - Refund amount
'description' => null, // Refund description
'details' => array(
'customeraccountnumber' => '', // Refund customer account number
'cpfaccountholder' => '', // Refund CPF account holder
'bankname' => '', // Refund bank name
'bankaccounttype' => '', // Refund bank account type
'bankbranch' => '', // Refund bank branch
'bankcode' => '', // Refund bank code
'bankagencycode' => '', // Refund bank agency code
'bankaccountnumber' => '', // Refund account number
'bankswiftid' => '', // Refund bank SWIFT ID
'banksortcode' => '', // Refund bank sort code
'customeriban' => '', // Refund customer IBAN
),
'customer' => array(
'id' => 0, // Customer ID
'merchantcustomerid' => null, // Merchant assigned customer ID
'email' => null, // Customer email
'firstname' => null, // Customer first name
'lastname' => null, // Customer last name
'gender' => null, // Customer gender
'dateofbirth' => null, // Customer date of birth
'socialsecuritynumber' => null, // Customer social security number
'phone' => null, // Customer phone
'company' => null, // Customer company
),
'billingaddress' => array(
'id' => 0, // Address ID
'country' => '', // Address country
'city' => '', // Address city
'zipcode' => '', // Address zipcode
'state' => '', // Address state
'street' => '', // Address street name
'streetnumber' => '', // Address street number
'housenumber' => '', // Address house number
'houseextension' => '', // Address house extension
),
'bankaddress' => array(
'id' => 0, // Address ID
'country' => '', // Address country
'city' => '', // Address city
'zipcode' => '', // Address zipcode
'state' => '', // Address state
'street' => '', // Address street name
'streetnumber' => '', // Address street number
'housenumber' => '', // Address house number
'houseextension' => '', // Address house extension
),
'articles' => array(
'0' => array(
'merchantarticleid' => '0', // Merchant assigned article ID
'name' => '', // Article name
'quantity' => 0, // Article quantity
'price' => 0, // Article price in centimes
'vat' => 0, // VAT percent in centimes
'discount' => 0, // Discount percent in centimes
'discountvalue' => 0, // Integer value e.g 10 GBP discount (value with two decimals for 10 GBP send 1000)
'type' => 0, // Article type
'taxtype' => 0, // Tax type
),
),
'tokenlifetime' => null, // Refund token lifetime
),
);
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Payments with functionality refunds_list.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'payments';
$api_parameters['func'] = 'refunds_list';
$api_parameters['get_variables'] = array(
'id' => 0, // Payment ID MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Payments with functionality refund_details.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'payments';
$api_parameters['func'] = 'refund_details';
$api_parameters['get_variables'] = array(
'payment_id' => 0, // Payment ID MANDATORY
'id' => 0, // Refund ID MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Preapprovals with functionality list_all.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'preapprovals';
$api_parameters['func'] = 'list_all';
$api_parameters['get_variables'] = array();
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Preapprovals with functionality preapproval_close.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'preapprovals';
$api_parameters['func'] = 'preapproval_close';
$api_parameters['get_variables'] = array(
'id' => 0, // Preapproval ID MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Preapprovals with functionality preapproval_details.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'preapprovals';
$api_parameters['func'] = 'preapproval_details';
$api_parameters['get_variables'] = array(
'id' => 0, // Preapproval ID MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Preapprovals with functionality preapproval_payments.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'preapprovals';
$api_parameters['func'] = 'preapproval_payments';
$api_parameters['get_variables'] = array(
'id' => 0, // Preapproval ID MANDATORY
);
$api_parameters['method_params'] = array();
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Preapprovals with functionality preapproval_init.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'preapprovals';
$api_parameters['func'] = 'preapproval_init';
$api_parameters['get_variables'] = array();
$api_parameters['method_params'] = array(
'preapproval' => array( // MANDATORY
'merchantpreapprovalid' => '', // MANDATORY - Preapproval merchant assigned ID
'methodid' => 0, // MANDATORY - Preapproval method ID
'methodoptionid' => 0, // Option for Payment Method ID
'executiondate' => '', // Executed at a specific date
'recurringperiod' => 0, // Preapproval recurring period
'description' => '', // MANDATORY - Preapproval description
'preapprovedmaximumamount' => 0, // Preapproval maximum amount
'currency' => '', // Preapproval currency
'returnurl' => '', // MANDATORY - Preapproval return URL
'customer' => array( // MANDATORY
'id' => 0, // Customer ID
'merchantcustomerid' => null, // Merchant assigned customer ID
'email' => '', // MANDATORY - Customer email
'firstname' => null, // Customer first name
'lastname' => null, // Customer last name
'gender' => null, // Customer gender
'dateofbirth' => null, // Customer date of birth
'socialsecuritynumber' => null, // Customer social security number
'phone' => null, // Customer phone
'company' => null, // Customer company
),
'billingaddress' => array( // MANDATORY
'id' => 0, // Address ID
'country' => '', // MANDATORY - Address country
'city' => '', // Address city
'zipcode' => '', // Address zipcode
'state' => '', // Address state
'street' => '', // Address street name
'streetnumber' => '', // Address street number
'housenumber' => '', // Address house number
'houseextension' => '', // Address house extension
),
),
);
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Users with functionality create.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'users';
$api_parameters['func'] = 'create';
$api_parameters['get_variables'] = array();
$api_parameters['method_params'] = array(
'user' => array( // MANDATORY
'name' => '', // MANDATORY - Account username
'password' => null, // Account password
'email' => '', // MANDATORY - Account email
'siteid' => null, // Site ID attached to this account
'roleid' => null, // Role ID assigned to user account
),
);
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}
Quick example on how to use method Users with functionality edit.
<?php
include( 'bootstrap.php' );
// Tells SDK we work on debugging mode or not
S2P_SDK\S2P_SDK_Module::st_debugging_mode( true );
// Tells SDK errors should be thrown instead of retrieving them with $obj->get_error() or S2P_SDK\S2P_SDK_Module::st_get_error()
S2P_SDK\S2P_SDK_Module::st_throw_errors( false );
$api_parameters = array();
// Uncomment line below if you want to override Site ID set in config.php
// $api_parameters['site_id'] = '{PROVIDED_SITE_ID}';
// Uncomment line below if you want to override API Key set in config.php
// $api_parameters['api_key'] = '{PROVIDED_APIKEY}';
// Uncomment line below if you want to override environment set in config.php
// $api_parameters['environment'] = 'test'; // test or live
$api_parameters['method'] = 'users';
$api_parameters['func'] = 'edit';
$api_parameters['get_variables'] = array(
'id' => 0, // User Account ID MANDATORY
);
$api_parameters['method_params'] = array(
'user' => array(
'password' => null, // Account password
'email' => null, // Account email
),
);
$call_params = array();
$finalize_params = array();
$finalize_params['redirect_now'] = false;
if( !($call_result = S2P_SDK\S2P_SDK_Module::quick_call( $api_parameters, $call_params, $finalize_params )) )
{
echo 'API call error: ';
if( ($error_arr = S2P_SDK\S2P_SDK_Module::st_get_error())
and !empty( $error_arr['display_error'] ) )
echo $error_arr['display_error'];
else
echo 'Unknown error.';
} else
{
echo 'API call time: '.$call_result['call_microseconds'].'ms<br/>'."\n";
if( !empty( $call_result['finalize_result']['should_redirect'] )
and !empty( $call_result['finalize_result']['redirect_to'] ) )
echo '<br/>'."\n".
'Go to <a href="'.$call_result['finalize_result']['redirect_to'].'">'.$call_result['finalize_result']['redirect_to'].'</a> to complete transaction<br/>'."\n".
'<br/>'."\n";
echo 'Call result:<br>'."\n".
'<pre>';
var_dump( $call_result['call_result'] );
echo '</pre>';
}