Completed
Push — feature/YP-3231 ( d02330...671c7e )
by Bruno
02:51
created

HostedPage::buyOneTimeAddon()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Zoho\Subscription\Api;
5
6
use Zoho\Subscription\Client\Client;
7
8
class HostedPage extends Client
9
{
10
    public function listHostedPages(): array
11
    {
12
        $response = $this->sendRequest('GET', 'hostedpages', ['content-type' => 'application/json'], json_encode($data));
0 ignored issues
show
Bug introduced by
The variable $data does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
13
14
        return $this->processResponse($response);
15
    }
16
17
    public function createSubscription(array $data): array
18
    {
19
        $response = $this->sendRequest('POST', 'hostedpages/newsubscription', ['content-type' => 'application/json'], json_encode($data));
20
21
        return $this->processResponse($response);
22
    }
23
24
    public function updateSubscription(array $data): array
25
    {
26
        $response = $this->sendRequest('POST', 'hostedpages/updatesubscription', ['content-type' => 'application/json'], json_encode($data));
27
28
        return $this->processResponse($response);
29
    }
30
31
    public function updateCard(array $data): array
32
    {
33
        $response = $this->sendRequest('POST', 'hostedpages/updatecard', ['content-type' => 'application/json'], json_encode($data));
34
35
        return $this->processResponse($response);
36
    }
37
38
    public function buyOneTimeAddon(array $data): array
39
    {
40
        $response = $this->sendRequest('POST', 'hostedpages/buyonetimeaddon', ['content-type' => 'application/json'], json_encode($data));
41
42
        return $this->processResponse($response);
43
    }
44
}
45