當前位置: 首頁>>代碼示例>>PHP>>正文


PHP payment::get方法代碼示例

本文整理匯總了PHP中payment::get方法的典型用法代碼示例。如果您正苦於以下問題:PHP payment::get方法的具體用法?PHP payment::get怎麽用?PHP payment::get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在payment的用法示例。


在下文中一共展示了payment::get方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: gateway

		public function gateway() {
			if ($error = getRequest('err_msg')) {
				$error = $error[0];
				$error = iconv("windows-1251", "utf-8", urldecode($error));
				cmsController::getInstance()->errorUrl = "/emarket/ordersList/";
				$this->errorNewMessage($error);
			}

			$orderId = payment::getResponseOrderId();
			if (!$orderId) {
				throw new publicException("Order identificator wasn't recieved from payment system");
			}

			$order = order::get($orderId);
			if ($order instanceof order) {
				$paymentId = $order->getValue('payment_id');
				if ($paymentId) {
					$payment = payment::get($paymentId, $order);
					return $payment->poll();
				} else {
					throw new publicException("No payment method inited for order #{$orderId}");
				}
			} else {
				throw new publicException("Order #{$orderId} doesn't exists");
			}
		}
開發者ID:BGCX261,項目名稱:zimmerli-svn-to-git,代碼行數:26,代碼來源:__payments.php

示例2: sendManagerNotification

 public function sendManagerNotification(order $order)
 {
     $regedit = regedit::getInstance();
     $cmsController = cmsController::getInstance();
     $domains = domainsCollection::getInstance();
     $domainId = $cmsController->getCurrentDomain()->getId();
     $defaultDomainId = $domains->getDefaultDomain()->getId();
     if ($regedit->getVal("//modules/emarket/manager-email/{$domainId}")) {
         $emails = $regedit->getVal("//modules/emarket/manager-email/{$domainId}");
         $fromMail = $regedit->getVal("//modules/emarket/from-email/{$domainId}");
         $fromName = $regedit->getVal("//modules/emarket/from-name/{$domainId}");
     } elseif ($regedit->getVal("//modules/emarket/manager-email/{$defaultDomainId}")) {
         $emails = $regedit->getVal("//modules/emarket/manager-email/{$defaultDomainId}");
         $fromMail = $regedit->getVal("//modules/emarket/from-email/{$defaultDomainId}");
         $fromName = $regedit->getVal("//modules/emarket/from-name/{$defaultDomainId}");
     } else {
         $emails = $regedit->getVal('//modules/emarket/manager-email');
         $fromMail = $regedit->getVal("//modules/emarket/from-email");
         $fromName = $regedit->getVal("//modules/emarket/from-name");
     }
     $letter = new umiMail();
     $recpCount = 0;
     foreach (explode(',', $emails) as $recipient) {
         $recipient = trim($recipient);
         if (strlen($recipient)) {
             $letter->addRecipient($recipient);
             $recpCount++;
         }
     }
     if (!$recpCount) {
         return;
     }
     list($template) = def_module::loadTemplatesForMail("emarket/mail/default", "neworder_notification");
     try {
         $payment = payment::get($order->payment_id);
         $paymentName = $payment->name;
         $paymentStatus = order::getCodeByStatus($order->getPaymentStatus());
     } catch (coreException $e) {
         $paymentName = "";
         $paymentStatus = "";
     }
     $param = array();
     $param["order_id"] = $order->id;
     $param["order_name"] = $order->name;
     $param["order_number"] = $order->number;
     $param["payment_type"] = $paymentName;
     $param["payment_status"] = $paymentStatus;
     $param["price"] = $order->getActualPrice();
     $param["domain"] = cmsController::getInstance()->getCurrentDomain()->getHost();
     $content = def_module::parseTemplateForMail($template, $param);
     $langs = cmsController::getInstance()->langs;
     $letter->setFrom($fromMail, $fromName);
     $letter->setSubject($langs['notification-neworder-subject'] . " (#{$order->number})");
     $letter->setContent($content);
     $letter->commit();
     $letter->send();
 }
開發者ID:BGCX261,項目名稱:zimmerli-svn-to-git,代碼行數:57,代碼來源:__notification.php


注:本文中的payment::get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。