@@ 44-52 (lines=9) @@ | ||
41 | /** |
|
42 | * @throws Exception |
|
43 | */ |
|
44 | public function create(array $params) |
|
45 | { |
|
46 | $processor = new Processor(); |
|
47 | $params = $processor->processConfiguration(new Configuration\SubscriptionCreate(), [$params]); |
|
48 | ||
49 | $response = $this->httpPost('subscriptions', $params); |
|
50 | ||
51 | return $this->hydrator->hydrate($response, SubscriptionModel::class); |
|
52 | } |
|
53 | ||
54 | /** |
|
55 | * @throws Exception |
|
@@ 57-65 (lines=9) @@ | ||
54 | /** |
|
55 | * @throws Exception |
|
56 | */ |
|
57 | public function cancel(string $id, array $params = []) |
|
58 | { |
|
59 | $processor = new Processor(); |
|
60 | $params = $processor->processConfiguration(new Configuration\SubscriptionCancel(), [$params]); |
|
61 | ||
62 | $response = $this->httpDelete("subscriptions/$id", $params); |
|
63 | ||
64 | return $this->hydrator->hydrate($response, SubscriptionModel::class); |
|
65 | } |
|
66 | ||
67 | /** |
|
68 | * @throws Exception |
|
@@ 80-88 (lines=9) @@ | ||
77 | /** |
|
78 | * @throws Exception |
|
79 | */ |
|
80 | public function update(string $id, array $params) |
|
81 | { |
|
82 | $processor = new Processor(); |
|
83 | $params = $processor->processConfiguration(new Configuration\SubscriptionUpdate(), [$params]); |
|
84 | ||
85 | $response = $this->httpPost("subscriptions/$id", $params); |
|
86 | ||
87 | return $this->hydrator->hydrate($response, SubscriptionModel::class); |
|
88 | } |
|
89 | } |
|
90 |
@@ 44-52 (lines=9) @@ | ||
41 | /** |
|
42 | * @throws Exception |
|
43 | */ |
|
44 | public function create(array $params) |
|
45 | { |
|
46 | $processor = new Processor(); |
|
47 | $params = $processor->processConfiguration(new Configuration\CustomerCreate(), [$params]); |
|
48 | ||
49 | $response = $this->httpPost('customers', $params); |
|
50 | ||
51 | return $this->hydrator->hydrate($response, CustomerModel::class); |
|
52 | } |
|
53 | ||
54 | /** |
|
55 | * @throws Exception |