-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathgetStatistics.php
More file actions
42 lines (38 loc) · 1.17 KB
/
getStatistics.php
File metadata and controls
42 lines (38 loc) · 1.17 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
39
40
41
42
<?php
require_once '../vendor/autoload.php';
require_once('config.php');
try {
/**
* You can either call the getStats with a period, or startDate and endDate
*
* for example:
* 'startDate' => new DateTime('2015-03-01'),
* 'endDate' => new DateTime('2015-03-08')
*
* Or
* 'period' => \Paynl\Alliance\Statistics::PERIOD_LAST_WEEK
*
* Usable periods:
* \Paynl\Alliance\Statistics::PERIOD_THIS_WEEK
* \Paynl\Alliance\Statistics::PERIOD_LAST_WEEK
* \Paynl\Alliance\Statistics::PERIOD_THIS_MONTH
* \Paynl\Alliance\Statistics::PERIOD_LAST_MONTH
*/
$result = Paynl\Alliance\Statistics::getStats(array(
# Required
'period' => \Paynl\Alliance\Statistics::PERIOD_THIS_WEEK,
# Optional
'excludeSandbox' => true,
'filters' => array(
array(
'key' => 'payment_profile_id',
'operator' => 'eq', # possible values are: 'eq', 'neq', 'gt', 'lt', 'like'
'value' => '10'
),
),
));
$data = $result->getData();
var_dump($data);
} catch (Exception $e) {
echo "Error occurred: " . $e->getMessage();
}