-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSubscriptionReceiver.php
More file actions
38 lines (32 loc) · 1.03 KB
/
SubscriptionReceiver.php
File metadata and controls
38 lines (32 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
require_once 'Receiver.php';
require_once 'SubscriptionNotification.php';
require_once 'Response.php';
require_once 'Sender.php';
class SubscriptionReceiver extends Receiver {
private $subNotification;
/**
* Handle subscription/unsubscription requests
**/
public function handleRequest(array $data) {
$this->subNotification = new SubscriptionNotification();
if(isset($data['applicationId'])) {
$this->subNotification->setApplicationId($data['applicationId']);
$this->subNotification->setFrequency($data['frequency']);
$this->subNotification->setStatus($data['status']);
$this->subNotification->setSubscriberId($data['subscriberId']);
$this->subNotification->setVersion($data['version']);
$this->subNotification->setTimeStamp($data['timeStamp']);
}
$this->getLogger()->LogInfo("Request Received: -> ".$this->subNotification->toString());
$resp = new Response("S1000","Success");
echo $resp->toJson();
}
/**
*
*/
public function getMessage() {
return $this->subNotification;
}
}
?>