1: <?php
2:
3: namespace Cloudflare\User;
4:
5: use Cloudflare\Api;
6: use Cloudflare\User;
7:
8: /**
9: * CloudFlare API wrapper
10: *
11: * Billing
12: *
13: * @author James Bell <[email protected]>
14: *
15: * @version 1
16: */
17: class Billing extends Api
18: {
19: /**
20: * Default permissions level
21: *
22: * @var array
23: */
24: protected $permission_level = ['read' => '#billing:read', 'edit' => '#billing:edit'];
25:
26: /**
27: * Billing Profile (permission needed: #billing:read)
28: * Access your billing profile object
29: */
30: public function billing()
31: {
32: return $this->get('/user/billing/profile');
33: }
34:
35: /**
36: * Billing History (permission needed: #billing:read)
37: * Access your billing profile object
38: *
39: * @param int|null $page Page number of paginated results
40: * @param int|null $per_page Number of items per page
41: * @param string|null $order Field to order billing history by
42: * @param string|null $type The billing item type
43: * @param string|null $occured_at When the billing item was created
44: * @param string|null $action The billing item action
45: */
46: public function history($page = null, $per_page = null, $order = null, $type = null, $occured_at = null, $action = null)
47: {
48: $data = [
49: 'page' => $page,
50: 'per_page' => $per_page,
51: 'order' => $order,
52: 'type' => $type,
53: 'occured_at' => $occured_at,
54: 'action' => $action,
55: ];
56:
57: return $this->get('/user/billing/history', $data);
58: }
59: }
60: