Get the article checkout URL.

@param Article $article The article.
@param Customer|null $customer The customer.
@return string
10102
public function getArticleCheckoutURL(Article $article, Customer $customer = null)
    {
        if ($customer === null) {
            return $article->getCheckoutUrl();
        }

        return $this->generateCheckoutURLForCustomer($customer->getHash(), $article->getArticleNumber());
    }
629096
def get_article(self, article_id):
        
        url = self._generate_url('articles/{0}'.format(article_id))
        return self.get(url)
174573
public function getManufacturerRecord($customer)
    {
        $mm = TableRegistry::getTableLocator()->get('Manufacturers');
        $manufacturer = $mm->find('all', [
            'conditions' => [
                'AddressManufacturers.email' => $customer->email
            ],
            'contain' => [
                'AddressManufacturers'
            ]
        ])->first();
        return $manufacturer;
    }
693465
public function &GetArticleObject()
    {
        if (is_null($this->oArticle)) {
            $this->oArticle = TdbShopArticle::GetNewInstance();
            if (!$this->oArticle->Load($this->sqlData['shop_article_id'])) {
                $this->oArticle = null;
            }
        }

        return $this->oArticle;
    }
356745
public function create(Article $article, User $author)
    {
        $article->setAuthor($author);

        /** @var Tag[] $tags */
        $tags = $article->getTags();
        if (is_array($tags)) {
            foreach ($tags as $tag) {
                $tag->setBlog($article->getBlog());
                $this->entityManager->persist($tag);
            }
        }

        //Article has to be persisted before BusinessPage generation
        $this->entityManager->persist($article);
        $this->entityManager->flush();

        $page = $this->businessPageBuilder->generateEntityPageFromTemplate(
            $article->getTemplate(),
            $article,
            $this->entityManager
        );

        //Transform VBP into BP
        $this->virtualToBusinessPageTransformer->transform($page);
        $page->setParent($article->getBlog());
        $page->setStatus($article->getStatus());

        $this->entityManager->persist($page);
        $this->entityManager->flush();

        return $page;
    }
1234620
private function getAddressFromCustomer($customer, $addressType = 'billing')
    {
        /** @var CustomerAddressInterface $address */
        $address = $this->customerAddressFactory->create();

        foreach ($customer->getData() as $key => $value) {
            if (strpos($key, $addressType) === 0) {
                $key = explode('.', $key);
                $key = array_pop($key);

                $address->setData($key, $value);
            }
        }

        return $address;
    }
1029166
protected function getSubscriptionPayload($customer, array $options = [])
    {
        $plan = BraintreeService::findPlan($this->plan);

        if ($this->skipTrial) {
            $trialDuration = 0;
        } else {
            $trialDuration = $this->trialDays ?: 0;
        }

        return array_merge([
            'planId' => $this->plan,
            'price' => number_format($plan->price * (1 + ($this->owner->taxPercentage() / 100)), 2, '.', ''),
            'paymentMethodToken' => $this->owner->paymentMethod()->token,
            'trialPeriod' => $this->trialDays && ! $this->skipTrial ? true : false,
            'trialDurationUnit' => 'day',
            'trialDuration' => $trialDuration,
        ], $options);
    }
10891
public function showCustomer($customer_id)
    {
        $response = $this->client->get('customers/' . $customer_id);
        return json_decode($response->getBody())->customer;
    }
570539
public function get($customer)
    {
        $id = null;
        if ($customer instanceof HpsPayPlanCustomer) {
            $id = $customer->customerKey;
        } else {
            $id = $customer;
        }
        $result = $this->doRequest(null, array(
            'verb'     => 'GET',
            'endpoint' => 'customers/'.$id,
        ));
        return $this->hydrateObject($result, 'HpsPayPlanCustomer');
    }
233152
protected function buildCustomer($request, Customer $customer = null)
    {
        if ($customer === null) {
            return $request;
        }

        $request['customerIdentifier'] = $customer->id;
        $request['firstName'] = $customer->firstName;
        $request['lastName'] = $customer->lastName;
        $request['company'] = $customer->company;
        $request['customerStatus'] = $customer->status;
        $request['primaryEmail'] = $customer->email;
        $request['phoneDay'] = $customer->homePhone;
        $request['phoneEvening'] = $customer->workPhone;
        $request['phoneMobile'] = $customer->mobilePhone;
        $request['fax'] = $customer->fax;
        $request['title'] = $customer->title;
        $request['department'] = $customer->department;
        $request = $this->buildAddress($request, $customer->address);

        return $request;
    }
387967
public function getFor(Customer $customer, $subscriptionId, array $parameters = [])
    {
        $this->parentId = $customer->id;

        return parent::rest_read($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;
    }
883057
protected function getArticleRouterPath($routeName, $type, $slug, $tagOrCategory, $locale, $parameters = [], $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH)
    {
        if (!$this->articleRouteExists($type, $locale)) {
            $routeName = '_slug';
        }
        if (!isset($parameters[$type])) {
            $parameters[$type] = $tagOrCategory;
        }
        if (!isset($parameters['url'])) {
            $parameters['url'] = $slug;
        }
        if (!isset($parameters['_locale'])) {
            $parameters['_locale'] = $locale;
        }

        return $this->router->generate($routeName, $parameters, $referenceType);
    }
530041
private function customerToTransaction($customer)
    {
        $transaction = [
            'Customer' => $customer->toArray(),
            'TransactionType' => TransactionType::MOTO,
        ];

        foreach ($customer->toArray() as $key => $value) {
            if ($key != 'TokenCustomerID') {
                $transaction[$key] = $value;
            }
        }

        /** @var Transaction $transaction */
        return ClassValidator::getInstance('Eway\Rapid\Model\Transaction', $transaction);
    }
606155
public function getPaymentSuccessPageUrl($order_id)
    {
        $frontOfficeRouter = $this->getContainer()->get('router.front');

        return URL::getInstance()->absoluteUrl(
            $frontOfficeRouter->generate(
                "order.placed",
                array("order_id" => $order_id),
                Router::ABSOLUTE_URL
            )
        );
    }
935965
public function getBannerLink()
    {
        $sUrl = null;

        if (isset($this->oxactions__oxlink) && $this->oxactions__oxlink->value) {
            /** @var \OxidEsales\Eshop\Core\UtilsUrl $oUtilsUlr */
            $oUtilsUlr = \OxidEsales\Eshop\Core\Registry::getUtilsUrl();
            $sUrl = $oUtilsUlr->addShopHost($this->oxactions__oxlink->value);
            $sUrl = $oUtilsUlr->processUrl($sUrl);
        } else {
            if ($oArticle = $this->getBannerArticle()) {
                // if article is assigned to banner, getting article link
                $sUrl = $oArticle->getLink();
            }
        }

        return $sUrl;
    }
216183
private function getWebsiteStoreId($customer, $defaultStoreId = null)
    {
        if ($customer->getWebsiteId() != 0 && empty($defaultStoreId)) {
            $storeIds = $this->storeManager->getWebsite($customer->getWebsiteId())->getStoreIds();
            $defaultStoreId = reset($storeIds);
        }
        return $defaultStoreId;
    }