Developer - SCI - Callback

Payment Callback

When SCI payment is made, EntroMoney sends Callback to your store provided callback url. It is an instant payment notification which should be used to validate date and register payment at your site.

In order to use EntroMoney Callbacks you must create a script which can receive payment details. EntroMoney provides simple PHP library to do that.

The following parameters are provided when your store receives a payment

Key Type Description
batch int Transaction id
date date Transaction date, format: Y-m-d - H:i:s
type string Transaction type
type_code string Transaction type code
account_purse string Account purse
status string Transaction status, pending - completed - cancel
amount float Transaction amount
fee float Transaction fee
net float Transaction net
balance float Your purse balance after transaction
purse string Your purse
desc string Transaction details
payment_id string Merchant reference number
up_1
up_2
up_3
up_4
up_5
string Custom fields specified before payment

Code Snippets

<?php
// Include lib
require_once 'path/to/entromoney/sci/sci.php';

// Sci config
$config = array();
$config['sci_user']	= 'ACCOUNT_ID';
$config['sci_id']	= 'SCI_ID';
$config['sci_pass']	= 'SCI_PASS';

// Call lib
try {
	$sci = new Paygate_Sci($config);
}
catch (Paygate_Exception $e) {
	exit($e->getMessage());
}

// Get hash
$input = array();
$input['hash'] = $_POST['hash'];

// Decode hash
$error = '';
$tran = $sci->query($input, $error);

if ($error)
{
	print_r($error);
}
else
{
	print_r($tran);
}

Response

stdClass Object
(
    [batch] => 68
    [date] => 2013-12-20 - 15:24:30
    [type] => (Sci) Received from
    [type_code] => transfer_sci
    [account_purse] => U1000002
    [status] => completed
    [amount] => +1
    [fee] => -0
    [net] => +1
    [balance] => 652.95
    [purse] => U1000000
    [desc] => Test
    [payment_id] => ID-123
    [up_1] => user_param_1
    [up_2] => user_param_2
    [up_3] => user_param_3
    [up_4] => user_param_4
    [up_5] => user_param_5
)