/**
  * Get the subscriptions.
  *
  * @param integer $customerId The customer ID.
  * @param string $externalCustomerId The external customer ID.
  * @param string $subscriptionExternalId The external subscription ID.
  * @param integer $subscriptionId The subscription ID.
  * @return Get\ApiResponse
  */
 public function getSubscriptions($customerId = null, $externalCustomerId = null, $subscriptionExternalId = null, $subscriptionId = null)
 {
     $requestData = new Get\RequestData();
     $requestData->setCustomerId($customerId);
     $requestData->setExternalCustomerId($externalCustomerId);
     $requestData->setSubscriptionExternalId($subscriptionExternalId);
     $requestData->setSubscriptionId($subscriptionId);
     $request = new Get\Request($requestData);
     return $this->sendRequest($request, Get\ApiResponse::class);
 }
 /**
  * Get the subscriptions.
  *
  * @param integer $customerId The customer ID.
  * @param string $externalCustomerId The external customer ID.
  * @param string $subscriptionExternalId The external subscription ID.
  * @param integer $subscriptionId The subscription ID.
  * @return Get\ApiResponse
  */
 public function getSubscriptions($customerId = null, $externalCustomerId = null, $subscriptionExternalId = null, $subscriptionId = null)
 {
     $requestData = new Get\RequestData();
     $requestData->setCustomerId($customerId);
     $requestData->setExternalCustomerId($externalCustomerId);
     $requestData->setSubscriptionExternalId($subscriptionExternalId);
     $requestData->setSubscriptionId($subscriptionId);
     $request = new Get\Request($requestData);
     $apiResponse = $this->sendRequest($request, Get\ApiResponse::class);
     /** @var Get\Response $response */
     $response = $apiResponse->getResponse();
     foreach ($response->getSubscriptions() as $subscription) {
         $cancellationDate = $subscription->getCancellationDate();
         if ($cancellationDate === '0000-00-00 00:00:00') {
             $subscription->setCancellationDate(null);
         } else {
             $subscription->setCancellationDate(new \DateTime($cancellationDate));
         }
     }
     return $apiResponse;
 }