@param string $customerExtUid

@return \DVelopment\FastBill\Model\Subscription
336054
public function getSubscriptionByCustomerExtUid($customerExtUid)
    {
        /** @var SubscriptionFbApi $response */
        $response = $this->call(new Request('subscription.get', array('customer_ext_uid' => $customerExtUid)), 'DVelopment\FastBill\Model\SubscriptionFbApi');
        $subscriptions = $response->getResponse()->getSubscriptions();

        return reset($subscriptions);
    }
278818
public function getSubscription($subscriptionId, array $parameters = [])
    {
        return $this->client->subscriptions->getFor($this, $subscriptionId, $parameters);
    }
638632
public function getUsagesLeft($customerId = null)
    {
        $usageLeft = $this->getMaxUsage();

        if ($this->getPerCustomerUsageCount()) {
            // Get usage left for current customer. If the record is not found,
            // it means that the customer has not yes used this coupon.
            if (null !== $couponCustomerCount = CouponCustomerCountQuery::create()
                    ->filterByCouponId($this->getId())
                    ->filterByCustomerId($customerId)
                    ->findOne()) {
                // The coupon has already been used -> remove this customer's usage count
                $usageLeft -= $couponCustomerCount->getCount();
            }
        }

        return $usageLeft;
    }
556394
public function getRecentlyViewed($customerId, $limit)
    {
        $attributes = $this->config->getProductAttributes();

        $this->productIndexcollection->addAttributeToSelect($attributes);
        $this->productIndexcollection->setCustomerId($customerId);
        $this->productIndexcollection->addUrlRewrite()->setPageSize(
            $limit
        )->setCurPage(
            1
        );

        /* Price data is added to consider item stock status using price index */
        $collection = $this->productIndexcollection->addPriceData()
            ->addIndexFilter()
            ->setAddedAtOrder()
            ->setVisibility($this->productVisibility->getVisibleInSiteIds());

        return $collection->getColumnValues('product_id');
    }
1134110
public function setCustomerId( $customerid )
	{
		if ( $customerid === $this->getCustomerId() ) { return; }

		$this->_notifyListeners( 'setCustomerId.before', $customerid );

		$this->_values['customerid'] = (string) $customerid;
		$this->_modified = true;

		$this->_notifyListeners( 'setCustomerId.after', $customerid );
	}
1366366
protected function checkExistingCustomerBasket($customerId)
    {
        $basket = $this->basketManager->findOneBy(['customer' => $customerId]);
        if ($basket instanceof BasketInterface) {
            throw new HttpException(400, sprintf('Customer (%d) already has a basket', $customerId));
        }
    }
712331
public function createCustomer($customerExtId)
    {
        $request = $this
            ->apiRequestFactory
            ->createCustomerRequest($customerExtId);

        return $this->send($request);
    }
687419
public function getCustomer($customerId)
    {
        //retrieve customer, set customer attributes
        $customerModel = $this->customerResource->get($customerId);
        if ($customerModel instanceof \Exception) {
            throw $customerModel;
        }

        $this->_setAttributes($customerModel);
        $this->setDeletable(true);

        return $this;
    }
999822
public function importForCustomer(string $customerId, array $data, array $headers = [])
    {
        $url = $this->url('subscriptions/customers/%s/import_subscription', $customerId);

        return $this->post($url, $data, $headers);
    }
455531
public function getCustomer($customerId)
    {
        $requestData = new Get\RequestData();
        $requestData->setCustomerId($customerId);

        $customers = $this->getCustomers($requestData)->getResponse()->getCustomers();

        return isset($customers[0]) ? $customers[0] : null;
    }
1138418
public function unregisterCard(string $customerId)
    {
        // Log Debug
        $this->flow->getLogger()->debug("Unregistering Card for $customerId");

        return $this->make(
            $this->flow->send(
                'post',
                $this->endpoint . '/unRegister',
                ['customerId' => $customerId]
            )
        );
    }
428593
public function createPaymentByTransactionIdQuery($transactionId)
    {
        $query = $this->getFactory()->createPaymentPayoneQuery();
        $query->filterByTransactionId($transactionId);

        return $query;
    }
1097176
public function createCustomer($paymentType, $customerId, $payment, $additional = [])
    {
        $this->integrityCheck();
        $createCustomerRes = $this->mpay24Sdk->createCustomer($paymentType, $customerId, $payment, $additional);
        $this->recordedLastMessageExchange('CreateCustomer');

        return $createCustomerRes;
    }
367444
public function getSubscriptionInvoices(int $subscriptionId): array
    {
        $results = $this->_createInvoiceQuery()
            ->where(['subscriptionId' => $subscriptionId])
            ->orderBy(['dateCreated' => SORT_DESC])
            ->all();

        $invoices = [];

        foreach ($results as $result) {
            $result['invoiceData'] = Json::decodeIfJson($result['invoiceData']);
            $invoices[] = new Invoice($result);
        }

        return $invoices;
    }
894984
public function getCustomer($customerId)
    {
        /** @var CustomerFbApi $response */
        $response = $this->call(new Request('customer.get', array('customer_id' => $customerId)), 'DVelopment\FastBill\Model\CustomerFbApi');
        $customers = $response->getResponse()->getCustomers();

        return reset($customers);
    }
1111427
public function delete(string $customerId, array $headers = [])
    {
        $url = $this->url('customers/%s/delete_card', $customerId);

        return $this->post($url, [], $headers);
    }
490959
public function deleteProfile($customerId, $profileId = null)
    {
        $request = new DeleteProfile($this->config->getMerchantId());
        $request->setCustomerId($customerId);
        $request->setProfileId($profileId);

        $this->request = $request->getXml();
        $this->send();

        $result = new DeleteProfileResponse($this->response);
        return $result;
    }