当前位置: 首页>>代码示例>>PHP>>正文


PHP Invoice::getProducts方法代码示例

本文整理汇总了PHP中Invoice::getProducts方法的典型用法代码示例。如果您正苦于以下问题:PHP Invoice::getProducts方法的具体用法?PHP Invoice::getProducts怎么用?PHP Invoice::getProducts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Invoice的用法示例。


在下文中一共展示了Invoice::getProducts方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _process

 public function _process(Invoice $invoice, Am_Request $request, Am_Paysystem_Result $result)
 {
     $products = $invoice->getProducts();
     $data = $this->getPaymentData($products[0]->data()->get('fortumo_service_xml'));
     $a = new Am_Paysystem_Action_HtmlTemplate_Fortumo($this->getDir(), 'fortumo-payment.phtml');
     $a->data = $data;
     $a->invoice = $invoice;
     $result->setAction($a);
 }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:9,代码来源:fortumo.php

示例2: _process

 public function _process(Invoice $invoice, Am_Request $request, Am_Paysystem_Result $result)
 {
     $prSpeeds = array();
     foreach ($invoice->getProducts() as $product) {
         $prSpeeds[] = ($o = $product->data()->get('bitpay_speed_risk')) ? $o : $this->getConfig('bitpay_speed_risk');
     }
     $user = $invoice->getUser();
     $post = array('price' => $invoice->first_total, 'currency' => $invoice->currency, 'posData' => array(), 'notificationURL' => $this->getPluginUrl('ipn'), 'transactionSpeed' => $this->transactionSpeed[min($prSpeeds)], 'redirectURL' => $this->getConfig('use_http', false) ? str_replace('https://', 'http://', $this->getReturnUrl()) : $this->getReturnUrl(), 'orderID' => $invoice->public_id, 'itemDesc' => $invoice->getLineDescription(), 'buyerName' => $user->getName(), 'buyerAddress1' => $user->street, 'buyerAddress2' => $user->street2, 'buyerState' => Am_Di::getInstance()->stateTable->getTitleByCode($user->country, $user->state), 'buyerZip' => $user->zip, 'buyerCountry' => Am_Di::getInstance()->countryTable->getTitleByCode($user->country), 'buyerEmail' => $user->email, 'buyerPhone' => $user->phone);
     $post = array_filter($post);
     $req = new Am_Request_Bitpay($this, Am_HttpRequest::METHOD_POST, json_encode($post), 'createInvoice');
     $res = $req->getResult();
     if (!isset($res['status']) || $res['status'] != 'new') {
         Am_Di::getInstance()->errorLogTable->log("BitPay API Error. Invoice status is not NEW: " . @$res['status'] . ".");
         throw new Am_Exception_InternalError();
     }
     $invoice->data()->set(self::BITPAY_INVOICE_ID, $res['id'])->update();
     $action = new Am_Paysystem_Action_Redirect($res['url']);
     $result->setAction($action);
 }
开发者ID:grlf,项目名称:eyedock,代码行数:19,代码来源:bitpay.php

示例3: _process

 public function _process(Invoice $invoice, Am_Request $request, Am_Paysystem_Result $result)
 {
     $products = $invoice->getProducts();
     $a = new Am_Paysystem_Action_Form(self::LIVE_URL);
     $web_id = $products[0]->data()->get('web_id');
     if (empty($web_id)) {
         $this->getConfig('web_id');
     }
     $a->id = $web_id;
     $a->pricepoint = $products[0]->data()->get(self::PRICEPOINT);
     $a->paymentoption = $this->getPaymentOption($invoice);
     $a->firstname = $invoice->getFirstName();
     $a->lastname = $invoice->getLastName();
     $a->address = $invoice->getStreet();
     $a->city = $invoice->getCity();
     $a->state = $invoice->getState();
     $a->zip = $invoice->getZip();
     $a->country = $invoice->getCountry();
     $a->phone = $invoice->getPhone();
     $a->email = $invoice->getEmail();
     $a->username = $invoice->getLogin();
     $a->password = 'notused';
     $a->purchaseamt = $invoice->first_total;
     $a->currencyid = $invoice->currency;
     $a->purchasedesc = $invoice->getLineDescription();
     if ($invoice->rebill_times) {
         $a->recurflag = 'Y';
         $a->recuramt = $invoice->second_total;
         $a->recurdatevalue = $this->getDays(new Am_Period($this->invoice->first_period));
     } else {
         $a->recurflag = 'N';
     }
     $a->xfield = $invoice->public_id;
     $a->postbackurl = $this->getPluginUrl('ipn');
     $a->country = $invoice->getCountry();
     $result->setAction($a);
 }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:37,代码来源:charge2000.php

示例4: isNotificationRuleMatch

 protected function isNotificationRuleMatch(EmailTemplate $tmpl, Invoice $invoice)
 {
     if (!$tmpl->conditions) {
         return true;
     }
     $conds = array();
     foreach (explode(',', $tmpl->conditions) as $item) {
         preg_match('/([A-Z]*)-(.*)/', $item, $match);
         $conds[$match[1]][] = $match[2];
     }
     //check product conditions
     $product_ids = array();
     if (isset($conds['CATEGORY'])) {
         $catProducts = $this->getDi()->productCategoryTable->getCategoryProducts();
         foreach ($conds['CATEGORY'] as $cat_id) {
             if (isset($catProducts[$cat_id])) {
                 $product_ids = array_merge($product_ids, $catProducts[$cat_id]);
             }
         }
     }
     if (isset($conds['PRODUCT'])) {
         $product_ids = array_merge($product_ids, $conds['PRODUCT']);
     }
     if (!count($product_ids) && isset($conds['CATEGORY'])) {
         //user set up categories without products
         return false;
     }
     if (count($product_ids)) {
         $invoice_product_id = array_map(create_function('$a', 'return $a->pk();'), $invoice->getProducts());
         if (!array_intersect($product_ids, $invoice_product_id)) {
             return false;
         }
     }
     //check paysystem conditions
     if (isset($conds['PAYSYSTEM']) && !in_array($invoice->paysys_id, $conds['PAYSYSTEM'])) {
         return false;
     }
     return true;
 }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:39,代码来源:EmailTemplate.php

示例5: hasDigitalProducts

 function hasDigitalProducts(Invoice $invoice)
 {
     if ($this->getConfig('tax_digital')) {
         return true;
     }
     foreach ($invoice->getProducts() as $p) {
         if ($p->tax_group && $p->tax_digital) {
             return true;
         }
     }
 }
开发者ID:grlf,项目名称:eyedock,代码行数:11,代码来源:Tax.php


注:本文中的Invoice::getProducts方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。