The SysPay Event Messaging System will call the URL you provided us anytime an event occurs. By default the data will be encoded in application/x-www-form-urlencoded.
The data provided will contain the following keys:
data: The event-specific data
A callback will be provided with the following HTTP headers that will let you validate that the call is genuine:
The checksum is computed the following way:
HEX_SHA1(REQUEST_BODY + PASSPHRASE)
<?php
$keys = array(
9000 => 'passphrase1',
42 => 'passphrase2'
);
$partner = $_SERVER['HTTP_X_PARTNER'];
$checksum = $_SERVER['HTTP_X_CHECKSUM'];
$eventId = $_SERVER['HTTP_X_EVENT_ID'];
$eventDate = $_SERVER['HTTP_X_EVENT_DATE'];
$body = file_get_contents('php://input');
if (!isset($keys[$partner])) {
die("Unknown partner id");
}
$shouldBe = sha1($body . $keys[$partner]);
if ($checksum === $shouldBe) {
// Request is validated
}
Whenever a referral you sent to us has finished registering, you will receive a notification containing the syspay user id and your own reference for this user (that was given when referring the user to our page). You should use that notification to map the SysPay user id to this user in your system for further use.
Name | Type | Mandatory | Description |
---|---|---|---|
type | string | Y | user_created |
data.syspay_id | int | Y | The SysPay user id of the referral |
data.reference | string | Y | Your own reference for this referral |
data.registration_date | int | Y | The user registration date (unix timestamp) |
type=user_created&data%5Bsyspay_id%5D=339&data%5Breference%5D=1372860895&data%5Bregistration_date%5D=1372860953
This decodes to:
Array
(
[type] => user_created
[data] => Array
(
[syspay_id] => 339
[reference] => 1372860895
[registration_date] => 1372860953
)
)