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


PHP OJSPaymentManager::acceptSubscriptionPayments方法代码示例

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


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

示例1: getContents

 /**
  * Get the HTML contents for this block.
  * @param $templateMgr object
  * @param $request PKPRequest
  * @return $string
  */
 function getContents(&$templateMgr, $request)
 {
     $journal =& $request->getJournal();
     $journalId = $journal ? $journal->getId() : null;
     if (!$journal) {
         return '';
     }
     if ($journal->getSetting('publishingMode') != PUBLISHING_MODE_SUBSCRIPTION) {
         return '';
     }
     $user =& $request->getUser();
     $userId = $user ? $user->getId() : null;
     $templateMgr->assign('userLoggedIn', isset($userId) ? true : false);
     if (isset($userId)) {
         $subscriptionDao =& DAORegistry::getDAO('IndividualSubscriptionDAO');
         $individualSubscription =& $subscriptionDao->getSubscriptionByUserForJournal($userId, $journalId);
         $templateMgr->assign_by_ref('individualSubscription', $individualSubscription);
     }
     // If no individual subscription or if not valid, check for institutional subscription
     if (!isset($individualSubscription) || !$individualSubscription->isValid()) {
         $ip = $request->getRemoteAddr();
         $domain = Request::getRemoteDomain();
         $subscriptionDao =& DAORegistry::getDAO('InstitutionalSubscriptionDAO');
         $subscriptionId = $subscriptionDao->isValidInstitutionalSubscription($domain, $ip, $journalId);
         if ($subscriptionId) {
             $institutionalSubscription =& $subscriptionDao->getSubscription($subscriptionId);
             $templateMgr->assign_by_ref('institutionalSubscription', $institutionalSubscription);
             $templateMgr->assign('userIP', $ip);
         }
     }
     import('classes.payment.ojs.OJSPaymentManager');
     $paymentManager = new OJSPaymentManager($request);
     if (isset($individualSubscription) || isset($institutionalSubscription)) {
         $acceptSubscriptionPayments = $paymentManager->acceptSubscriptionPayments();
         $templateMgr->assign('acceptSubscriptionPayments', $acceptSubscriptionPayments);
     }
     $acceptGiftSubscriptionPayments = $paymentManager->acceptGiftSubscriptionPayments();
     $templateMgr->assign('acceptGiftSubscriptionPayments', $acceptGiftSubscriptionPayments);
     return parent::getContents($templateMgr, $request);
 }
开发者ID:yuricampos,项目名称:ojs,代码行数:46,代码来源:SubscriptionBlockPlugin.inc.php

示例2: payRenewSubscription

 /**
  * Pay the "renew subscription" fee.
  * @param $args array
  * @param $request PKPRequest
  */
 function payRenewSubscription($args, $request)
 {
     $this->validate();
     if (count($args) != 2) {
         $request->redirect(null, 'dashboard');
     }
     $journal = $request->getJournal();
     if (!$journal) {
         $request->redirect(null, 'dashboard');
     }
     if ($journal->getSetting('publishingMode') != PUBLISHING_MODE_SUBSCRIPTION) {
         $request->redirect(null, 'dashboard');
     }
     import('classes.payment.ojs.OJSPaymentManager');
     $paymentManager = new OJSPaymentManager($request);
     $acceptSubscriptionPayments = $paymentManager->acceptSubscriptionPayments();
     if (!$acceptSubscriptionPayments) {
         $request->redirect(null, 'dashboard');
     }
     $this->setupTemplate($request);
     $user = $request->getUser();
     $userId = $user->getId();
     $institutional = array_shift($args);
     $subscriptionId = (int) array_shift($args);
     if ($institutional == 'institutional') {
         $subscriptionDao = DAORegistry::getDAO('InstitutionalSubscriptionDAO');
     } else {
         $subscriptionDao = DAORegistry::getDAO('IndividualSubscriptionDAO');
     }
     if (!$subscriptionDao->subscriptionExistsByUser($subscriptionId, $userId)) {
         $request->redirect(null, 'dashboard');
     }
     $subscription = $subscriptionDao->getSubscription($subscriptionId);
     if ($subscription->isNonExpiring()) {
         $request->redirect(null, 'dashboard');
     }
     import('classes.subscription.Subscription');
     $subscriptionStatus = $subscription->getStatus();
     $validStatus = array(SUBSCRIPTION_STATUS_ACTIVE, SUBSCRIPTION_STATUS_AWAITING_ONLINE_PAYMENT, SUBSCRIPTION_STATUS_AWAITING_MANUAL_PAYMENT);
     if (!in_array($subscriptionStatus, $validStatus)) {
         $request->redirect(null, 'dashboard');
     }
     $subscriptionTypeDao = DAORegistry::getDAO('SubscriptionTypeDAO');
     $subscriptionType = $subscriptionTypeDao->getSubscriptionType($subscription->getTypeId());
     $queuedPayment = $paymentManager->createQueuedPayment($journal->getId(), PAYMENT_TYPE_RENEW_SUBSCRIPTION, $user->getId(), $subscriptionId, $subscriptionType->getCost(), $subscriptionType->getCurrencyCodeAlpha());
     $queuedPaymentId = $paymentManager->queuePayment($queuedPayment);
     $paymentManager->displayPaymentForm($queuedPaymentId, $queuedPayment);
 }
开发者ID:pkp,项目名称:ojs,代码行数:53,代码来源:UserHandler.inc.php

示例3: saveSubscriptionPolicies

 /**
  * Save subscription policies for the current journal.
  * @param $args array
  * @param $request PKPRequest
  */
 function saveSubscriptionPolicies($args, &$request)
 {
     import('classes.subscription.form.SubscriptionPolicyForm');
     $subscriptionPolicyForm = new SubscriptionPolicyForm();
     $subscriptionPolicyForm->readInputData();
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('helpTopicId', 'journal.managementPages.subscriptions');
     if (Config::getVar('general', 'scheduled_tasks')) {
         $templateMgr->assign('scheduledTasksEnabled', true);
     }
     import('classes.payment.ojs.OJSPaymentManager');
     $paymentManager = new OJSPaymentManager($request);
     $templateMgr->assign('acceptSubscriptionPayments', $paymentManager->acceptSubscriptionPayments());
     if ($subscriptionPolicyForm->validate()) {
         $subscriptionPolicyForm->execute();
         $templateMgr->assign('subscriptionPoliciesSaved', '1');
         $subscriptionPolicyForm->display();
     } else {
         $subscriptionPolicyForm->display();
     }
 }
开发者ID:EreminDm,项目名称:water-cao,代码行数:26,代码来源:SubscriptionAction.inc.php

示例4: getSubscriptionSettings

 /**
  * Returns an array of information on the journal's subscription settings
  * @return array
  */
 function getSubscriptionSettings(&$request)
 {
     $journal = $request->getJournal();
     if (!$journal) {
         return array();
     }
     import('classes.payment.ojs.OJSPaymentManager');
     $paymentManager = new OJSPaymentManager($request);
     $settings = array('subscriptionsEnabled' => $paymentManager->acceptSubscriptionPayments(), 'allowRegReviewer' => $journal->getSetting('allowRegReviewer'), 'allowRegAuthor' => $journal->getSetting('allowRegAuthor'));
     return $settings;
 }
开发者ID:yuricampos,项目名称:ojs,代码行数:15,代码来源:NotificationManager.inc.php


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