Create a subscription for a Customer ID

@param string $customerId
@param array $options
@param array $filters

@return \Mollie\Api\Resources\BaseResource|\Mollie\Api\Resources\Payment
@throws \Mollie\Api\Exceptions\ApiException
177820
public function createForId($customerId, array $options = [], array $filters = [])
    {
        $this->parentId = $customerId;

        return parent::rest_create($options, $filters);
    }
154474
public function create($creditcard, $options = [])
     {
         if (isset($options['customer'])) {
             $params['card'] = $creditcard;

             return $this->gateway->commit('post', $this->gateway->buildUrlFromString('customers/'.$options['customer'].'/cards'), $params);
         } else {
             $params['email'] = Arr::get($options, 'email');
             $params['description'] = Arr::get($options, 'name');
             $params['card'] = $creditcard;

             return $this->gateway->commit('post', $this->gateway->buildUrlFromString('customers'), $params);
         }
     }
1119777
public function delete($customerId, $resourceId, $optParams = array()) {
      $params = array('customerId' => $customerId, 'resourceId' => $resourceId);
      $params = array_merge($params, $optParams);
      $data = $this->__call('delete', array($params));
      return $data;
    }
387967
public function getFor(Customer $customer, $subscriptionId, array $parameters = [])
    {
        $this->parentId = $customer->id;

        return parent::rest_read($subscriptionId, $parameters);
    }
1356962
public function loadByCustomerId($customerId)
    {
        $contact = $this->getCollection()
            ->loadByCustomerId($customerId);

        if ($contact) {
            return $contact;
        }

        return $this;
    }
797567
public static function create($user_id, $params, $options = null)
    {
        $url = static::classUrlWithUserId($user_id);
        return static::_directRequest('post', $url, $params, $options);
    }
144589
public function create(array $card, $customerId = null) {
        $expiryMonth    = str_pad($card['expiryMonth'], 2, '0', STR_PAD_LEFT);
        $expiryYear     = $card['expiryYear'];
        $expiresAt      = $this->getExpirationDate($expiryMonth, $expiryYear);
        $ccType         = $this->ccTypeAdapter->getFromGateway($card['paymentMethod']);

        /** @var PaymentTokenInterface $paymentToken */
        $paymentToken = $this->creditCardTokenFactory->create();
        $paymentToken->setExpiresAt($expiresAt);

        if( array_key_exists('id', $card) ) {
            $paymentToken->setGatewayToken($card['id']);
        }

        $tokenDetails = [
            'type'              => $ccType,
            'maskedCC'          => $card['last4'],
            'expirationDate'    => $expiryMonth . '/' . $expiryYear,
        ];

        $paymentToken->setTokenDetails($this->convertDetailsToJSON($tokenDetails));
        $paymentToken->setIsActive(true);
        $paymentToken->setPaymentMethodCode(ConfigProvider::CODE);

        if($customerId) {
            $paymentToken->setCustomerId($customerId);
        }

        $paymentToken->setPublicHash($this->generatePublicHash($paymentToken));

        return $paymentToken;
    }
436447
public function invoice(array $options = [])
    {
        if ($this->stripe_id) {
            $parameters = array_merge($options, ['customer' => $this->stripe_id]);

            try {
                return StripeInvoice::create($parameters, $this->getStripeKey())->pay();
            } catch (StripeErrorInvalidRequest $e) {
                return false;
            }
        }

        return true;
    }
1372091
public function createPayment($data, $filters = [])
    {
        return $this->client->orderPayments->createFor($this, $data, $filters);
    }
1040198
public function createFor(Customer $customer, array $options = [], array $filters = [])
    {
        $this->parentId = $customer->id;

        return parent::rest_create($options, $filters);
    }
76980
public function get($customerId, $optParams = array()) {
      $params = array('customerId' => $customerId);
      $params = array_merge($params, $optParams);
      $data = $this->__call('get', array($params));
      if ($this->useObjects()) {
        return new Customer($data);
      } else {
        return $data;
      }
    }
746008
public function buildCustomerCollection($customerIds)
    {
        $customerLog = $this->getTable('customer_log');
        $customerCollection = $this->customerCollection->create()
            ->addAttributeToSelect('*')
            ->addNameToSelect();
        $customerCollection = $this->addBillingJoinAttributesToCustomerCollection($customerCollection);
        $customerCollection = $this->addShippingJoinAttributesToCustomerCollection($customerCollection);
        $customerCollection = $customerCollection->addAttributeToFilter('entity_id', ['in' => $customerIds]);

        // get the last login date from the log_customer table
        $customerCollection->getSelect()->columns([
            'last_logged_date' => $this->expressionFactory->create(
                ["expression" => "(
                    SELECT last_login_at 
                    FROM  $customerLog 
                    WHERE customer_id =e.entity_id ORDER BY log_id DESC LIMIT 1
                )"]
            ),
        ]);

        return $customerCollection;
    }
377957
public function create($data, $customerId = null)
    {
        if (isset($customerId)) {
            return $this->client()->put($data, 'customers/{customerId}', ['customerId' => $customerId]);
        }

        return $this->client()->post($data, 'customers');
    }
1073341
public function deleteCustomer($customerId)
    {
        $requestData = new Delete\RequestData($customerId);
        $request = new Delete\Request($requestData);

        return $this->sendRequest($request, Delete\ApiResponse::class);
    }
278876
public function createFor(Customer $customer, array $options = [], array $filters = [])
    {
        return $this->createForId($customer->id, $options, $filters);
    }
714988
public static function create($userId, $params = null, $options = null)
    {
        return self::_userBasedCreate($userId, $params, $options);
    }
917259
public function sendInvite($customerId, CustomerInvite $invite = null)
    {
        $data = is_null($invite) ? array() : $invite->exportData();
        $endpoint = '/admin/customers/'.$customerId.'/send_invite.json';
        $response = $this->request(
            $endpoint, 'POST', array(
            'custom_invite' => $data
            )
        );
        return $response['customer_invite'];
    }