Billing selection

@return \Illuminate\Http\Response
498499
public function getSubscribe(Request $request)
    {
        $user = $request->user();
        $invoice = $user->meta->upcomingInvoice();

        if ($user->meta->subscribed(config('plans.subscription_name')) && ! is_null($invoice)) {
            return view('billing.details')
                ->with('invoice', $invoice)
                ->with('invoiceDate', Carbon::createFromTimestamp($invoice->date))
                ->with('user', $user);
        }

        return view('billing.subscribe')
            ->with('user', $user);
    }
239059
public function getRespondent()
    {
        static $respondent;

        if (! $respondent) {
            $patientNumber  = $this->_getParam(\MUtil_Model::REQUEST_ID1);
            $organizationId = $this->_getParam(\MUtil_Model::REQUEST_ID2);

            $respondent = $this->loader->getRespondent($patientNumber, $organizationId);
            
            if ((! $respondent->exists) && $patientNumber && $organizationId) {
                throw new \Gems_Exception(sprintf($this->_('Unknown respondent %s.'), $patientNumber));
            }

            $respondent->applyToMenuSource($this->menu->getParameterSource());
        }

        return $respondent;
    }
323747
public function paymentAction()
    {
        $order = $this->checkRequest();

        return $this->render('SonataPaymentBundle:Payment:debug.html.twig', [
            'order' => $order,
            'check' => $this->getCurrentRequest()->get('check'),
        ]);
    }
106609
public function getInvoices(Request $request)
    {
        $user = $request->user();
        $invoices = $user->meta->invoices(config('plans.subscription_name'));

        return view('billing.invoices')
            ->with('invoices', $invoices)
            ->with('user', $user);
    }
842138
public function GetValidPaymentMethodsSelectableByTheUser()
    {
        $oPaymentMethods = clone $this->GetValidPaymentMethods(true);
        $aInvalidMethods = array();
        $oPaymentMethods->GoToStart();
        while ($oPaymentMethod = $oPaymentMethods->Next()) {
            $oHandler = $oPaymentMethod->GetFieldShopPaymentHandler();
            if ($oHandler && $oHandler->isBlockForUserSelection()) {
                $aInvalidMethods[] = MySqlLegacySupport::getInstance()->real_escape_string($oPaymentMethod->id);
            }
        }
        if (count($aInvalidMethods) > 0) {
            $oPaymentMethods->AddFilterString("`shop_payment_method`.`id` NOT IN ('".implode("','", $aInvalidMethods)."')");
        }
        $oPaymentMethods->GoToStart();

        return $oPaymentMethods;
    }
961224
public function outstanding()
    {
        $member = Security::getCurrentUser();
        $list = PaginatedList::create(
            $member->OutstandingInvoices(),
            $this->owner->getRequest()
        );

        $this->owner->customise([
            "Title" => _t('Orders.OutstandingOrders', 'Outstanding Orders'),
            "MenuTitle" => _t('Orders.OutstandingOrders', 'Outstanding Orders'),
            "Content" => $this->owner->renderWith(
                "SilverCommerce\\OrdersAdmin\\Includes\\OrdersList",
                ["List" => $list]
            )
        ]);

        $this->owner->extend("updateOutstandingOrders", $orders);

        return $this
            ->owner
            ->renderWith([
                'AccountController_outstanding',
                AccountController::class . '_outstanding',
                'AccountController',
                AccountController::class,
                'Page'
            ]);
    }
400312
public function paymentMethod()
    {
        $customer = $this->asBraintreeCustomer();

        foreach ($customer->paymentMethods as $paymentMethod) {
            if ($paymentMethod->isDefault()) {
                return $paymentMethod;
            }
        }
    }
715759
public function BillingForm()
    {
        $form = BillingDetailsForm::create($this, 'BillingForm');

        $data = Session::get("Checkout.BillingDetailsForm.data");
        if (is_array($data)) {
            $form->loadDataFrom($data);
        } elseif($member = Member::currentUser()) {
            // Fill email, phone, etc
            $form->loadDataFrom($member);
            
            // Then fill with Address info
            if($member->DefaultAddress()) {
                $form->loadDataFrom($member->DefaultAddress());
            }
        }

        $this->extend("updateBillingForm", $form);

        return $form;
    }
1343624
public function request()
    {
        //load payments by date
        $this->getPagSeguroAbandoned();

        if ($this->_PagSeguroPaymentList->getTransactions()) {
            foreach ($this->_PagSeguroPaymentList->getTransactions() as $payment) {
                date_default_timezone_set('UTC');
                $order = \UOL\PagSeguro\Helper\Data::getReferenceDecryptOrderID($payment->getReference());
                $order = $this->_order->load($order);
                if ($this->getStoreReference() == \UOL\PagSeguro\Helper\Data::getReferenceDecrypt(
                        $payment->getReference())
                ) {
                    if (!is_null($this->_session->getData('store_id'))) {
                        array_push($this->_arrayPayments, $this->build($payment, $order));
                    }
                    if ($order) {
                        array_push($this->_arrayPayments, $this->build($payment, $order));
                    }
                }
            }
        }
        date_default_timezone_set($this->_timezone->getConfigTimezone());

        return $this->_arrayPayments;
    }
125549
public function index()
    {
        // If we are using simple checkout, skip
        if (Checkout::config()->simple_checkout) {
            return $this->redirect($this->Link('finish'));
        }
        
        // If we have turned off login, or member logged in
        if (!(Checkout::config()->login_form) || Member::currentUserID()) {
            return $this->redirect($this->Link('billing'));
        }

        $this->customise(array(
            'Title'     => _t('Checkout.SignIn', "Sign in"),
            "Login"     => true,
            'LoginForm' => $this->LoginForm()
        ));

        $this->extend("onBeforeIndex");

        return $this->renderWith(array(
            'Checkout',
            'Page'
        ));
    }
1371212
public function indexAction()
    {
        $request = $this->getCurrentRequest();
        $page = $request->get('page', 1);
        $displayMax = $request->get('max', 9);
        $displayMode = $request->get('mode', 'grid');
        $filter = $request->get('filter');
        $option = $request->get('option');

        if (!\in_array($displayMode, ['grid'], true)) { // "list" mode will be added later
            throw new NotFoundHttpException(sprintf('Given display_mode "%s" doesn\'t exist.', $displayMode));
        }

        $category = $this->retrieveCategoryFromQueryString();

        $this->get('sonata.seo.page')->setTitle($category ? $category->getName() : $this->get('translator')->trans('catalog_index_title'));

        $pager = $this->get('knp_paginator');
        $pagination = $pager->paginate($this->getProductSetManager()->getCategoryActiveProductsQueryBuilder($category, $filter, $option), $page, $displayMax);

        return $this->render('SonataProductBundle:Catalog:index.html.twig', [
            'display_mode' => $displayMode,
            'pager' => $pagination,
            'currency' => $this->getCurrencyDetector()->getCurrency(),
            'category' => $category,
            'provider' => $this->getProviderFromCategory($category),
        ]);
    }
235913
public function actionSelectFile()
    {
        //$this->layout = '@skeeks/cms/modules/admin/views/layouts/main.php';
        \Yii::$app->cmsToolbar->enabled = 0;

        $model = null;
        $className = \Yii::$app->request->get('className');
        $pk = \Yii::$app->request->get('pk');

        if ($className && $pk) {
            if ($model = $className::findOne($pk)) {

            }
        }


        return $this->render($this->action->id, [
            'model' => $model
        ]);
    }
728015
public function payments()
    {
        return $this->client->customerPayments->listFor($this, null, null, $this->getPresetOptions());
    }
935412
function selection() {
    global $order;

    for ($i=1; $i<13; $i++) {
      $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B - (%m)',mktime(0,0,0,$i,1,2000)));
    }

    $today = getdate();
    for ($i=$today['year']; $i < $today['year']+10; $i++) {
      $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
    }

    $onFocus = ' onfocus="methodSelect(\'pmt-' . $this->code . '\')"';

    if ($this->gateway_mode == 'offsite') {
      $selection = array('id' => $this->code,
                         'module' => $this->title);
    } else {
      $selection = array('id' => $this->code,
                         'module' => $this->title,
                         'fields' => array(array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_OWNER,
                                                 'field' => zen_draw_input_field('authorizenet_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'], 'id="'.$this->code.'-cc-owner"' . $onFocus . ' autocomplete="off"'),
                                               'tag' => $this->code.'-cc-owner'),
                                         array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_NUMBER,
                                               'field' => zen_draw_input_field('authorizenet_cc_number', '', 'id="'.$this->code.'-cc-number"' . $onFocus . ' autocomplete="off"'),
                                               'tag' => $this->code.'-cc-number'),
                                         array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_EXPIRES,
                                               'field' => zen_draw_pull_down_menu('authorizenet_cc_expires_month', $expires_month, strftime('%m'), 'id="'.$this->code.'-cc-expires-month"' . $onFocus) . '&nbsp;' . zen_draw_pull_down_menu('authorizenet_cc_expires_year', $expires_year, '', 'id="'.$this->code.'-cc-expires-year"' . $onFocus),
                                               'tag' => $this->code.'-cc-expires-month')));
      if (MODULE_PAYMENT_AUTHORIZENET_USE_CVV == 'True') {
        $selection['fields'][] = array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_CVV,
                                       'field' => zen_draw_input_field('authorizenet_cc_cvv', '', 'size="4" maxlength="4"' . ' id="'.$this->code.'-cc-cvv"' . $onFocus . ' autocomplete="off"') . ' ' . '<a href="javascript:popupWindow(\'' . zen_href_link(FILENAME_POPUP_CVV_HELP) . '\')">' . MODULE_PAYMENT_AUTHORIZENET_TEXT_POPUP_CVV_LINK . '</a>',
                                       'tag' => $this->code.'-cc-cvv');
      }
    }
    return $selection;
  }
930122
public function orderFormAction()
    {
        $locale = $this->getUser()->getLocale();

        return $this->render(
            'SuluSalesOrderBundle:Template:order.form.html.twig',
            [
                'systemUser' => $this->getSystemUserArray(),
                'systemUserId' => $this->getUser()->getContact()->getId(),
                'termsOfPayment' => $this->getTermsArray(self::$termsOfPaymentEntityName),
                'termsOfDelivery' => $this->getTermsArray(self::$termsOfDeliveryEntityName),
                'orderStatus' => $this->getOrderStatus(),
                'currencies' => $this->getCurrencies($locale),
                'customerId' => Account::TYPE_CUSTOMER,
                'taxClasses' => $this->getTaxClasses($locale),
                'units' => $this->getProductUnits($locale),
                'customerTypes' => $this->getCustomerTypesManager()->retrieveAllAsArray($locale),
                'customerTypeDefault' => $this->getCustomerTypesManager()->retrieveDefault($locale)
            ]
        );
    }
1237093
public function request()
    {
        $this->getTransactions();
        if (! is_null($this->_PagSeguroPaymentList->getTransactions())) {

            foreach ($this->_PagSeguroPaymentList->getTransactions() as $payment) {
                if (! $this->addPayment($this->decryptOrderById($payment), $payment))
                    continue;
            }
        }
        return $this->_arrayPayments;
    }
918968
public function getUserPayments()
    {
        if ($this->_oUserPayments == null) {
            $this->_oUserPayments = false;
            if ($oUser = $this->getUser()) {
                $sTplLang = \OxidEsales\Eshop\Core\Registry::getLang()->getObjectTplLanguage();
                $sPaymentId = $this->getPaymentId();
                $this->_oUserPayments = $oUser->getUserPayments();
                // generate selected
                foreach ($this->_oUserPayments as $oUserPayment) {
                    $oPayment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);
                    $oPayment->setLanguage($sTplLang);
                    $oPayment->load($oUserPayment->oxuserpayments__oxpaymentsid->value);
                    $oUserPayment->oxpayments__oxdesc = clone $oPayment->oxpayments__oxdesc;
                    if ($oUserPayment->oxuserpayments__oxid->value == $sPaymentId) {
                        $oUserPayment->selected = 1;
                        break;
                    }
                }
            }
        }

        return $this->_oUserPayments;
    }