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


PHP OJSPaymentManager::acceptGiftSubscriptionPayments方法代码示例

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


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

示例1: payPurchaseGiftSubscription

 /**
  * Process payment form for buying a gift subscription
  * @param $args array
  * @param $request PKPRequest
  */
 function payPurchaseGiftSubscription($args, $request)
 {
     $journal = $request->getJournal();
     if (!$journal) {
         $request->redirect(null, 'index');
     }
     import('classes.payment.ojs.OJSPaymentManager');
     $paymentManager = new OJSPaymentManager($request);
     $acceptSubscriptionPayments = $paymentManager->acceptGiftSubscriptionPayments();
     if (!$acceptSubscriptionPayments) {
         $request->redirect(null, 'index');
     }
     $this->setupTemplate();
     $user = $request->getUser();
     // If buyer is logged in, save buyer user id as part of gift details
     if ($user) {
         $buyerUserId = $user->getId();
     } else {
         $buyerUserId = null;
     }
     import('classes.subscription.form.GiftIndividualSubscriptionForm');
     $giftSubscriptionForm = new GiftIndividualSubscriptionForm($buyerUserId);
     $giftSubscriptionForm->readInputData();
     if ($giftSubscriptionForm->validate()) {
         $giftSubscriptionForm->execute();
     } else {
         $giftSubscriptionForm->display();
     }
 }
开发者ID:ucsal,项目名称:ojs,代码行数:34,代码来源:GiftsHandler.inc.php

示例2: gifts

 /**
  * Display user gifts page
  * @param $args array
  * @param $request PKPRequest
  */
 function gifts($args, $request)
 {
     $this->validate();
     $journal = $request->getJournal();
     if (!$journal) {
         $request->redirect(null, 'dashboard');
     }
     // Ensure gift payments are enabled
     import('classes.payment.ojs.OJSPaymentManager');
     $paymentManager = new OJSPaymentManager($request);
     $acceptGiftPayments = $paymentManager->acceptGiftPayments();
     if (!$acceptGiftPayments) {
         $request->redirect(null, 'dashboard');
     }
     $acceptGiftSubscriptionPayments = $paymentManager->acceptGiftSubscriptionPayments();
     $journalId = $journal->getId();
     $user = $request->getUser();
     $userId = $user->getId();
     // Get user's redeemed and unreedemed gift subscriptions
     $giftDao = DAORegistry::getDAO('GiftDAO');
     $giftSubscriptions = $giftDao->getGiftsByTypeAndRecipient(ASSOC_TYPE_JOURNAL, $journalId, GIFT_TYPE_SUBSCRIPTION, $userId);
     $this->setupTemplate($request);
     $templateMgr = TemplateManager::getManager($request);
     $templateMgr->assign(array('journalTitle' => $journal->getLocalizedName(), 'journalPath' => $journal->getPath(), 'acceptGiftSubscriptionPayments' => $acceptGiftSubscriptionPayments, 'giftSubscriptions' => $giftSubscriptions));
     $templateMgr->display('user/gifts.tpl');
 }
开发者ID:pkp,项目名称:ojs,代码行数:31,代码来源:UserHandler.inc.php

示例3: 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

示例4: subscriptions

 /**
  * Display subscriptions page.
  * @param $args array
  * @param $request PKPRequest
  */
 function subscriptions($args, &$request)
 {
     $this->addCheck(new HandlerValidatorJournal($this));
     $this->validate();
     $this->setupTemplate(true);
     $journalDao =& DAORegistry::getDAO('JournalSettingsDAO');
     $journalSettingsDao =& DAORegistry::getDAO('JournalSettingsDAO');
     $subscriptionTypeDao =& DAORegistry::getDAO('SubscriptionTypeDAO');
     $journal =& $request->getJournal();
     $journalId = $journal->getId();
     $subscriptionName =& $journalSettingsDao->getSetting($journalId, 'subscriptionName');
     $subscriptionEmail =& $journalSettingsDao->getSetting($journalId, 'subscriptionEmail');
     $subscriptionPhone =& $journalSettingsDao->getSetting($journalId, 'subscriptionPhone');
     $subscriptionFax =& $journalSettingsDao->getSetting($journalId, 'subscriptionFax');
     $subscriptionMailingAddress =& $journalSettingsDao->getSetting($journalId, 'subscriptionMailingAddress');
     $subscriptionAdditionalInformation =& $journal->getLocalizedSetting('subscriptionAdditionalInformation');
     $individualSubscriptionTypes =& $subscriptionTypeDao->getSubscriptionTypesByInstitutional($journalId, false, false);
     $institutionalSubscriptionTypes =& $subscriptionTypeDao->getSubscriptionTypesByInstitutional($journalId, true, false);
     import('classes.payment.ojs.OJSPaymentManager');
     $paymentManager = new OJSPaymentManager($request);
     $acceptGiftSubscriptionPayments = $paymentManager->acceptGiftSubscriptionPayments();
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('subscriptionName', $subscriptionName);
     $templateMgr->assign('subscriptionEmail', $subscriptionEmail);
     $templateMgr->assign('subscriptionPhone', $subscriptionPhone);
     $templateMgr->assign('subscriptionFax', $subscriptionFax);
     $templateMgr->assign('subscriptionMailingAddress', $subscriptionMailingAddress);
     $templateMgr->assign('subscriptionAdditionalInformation', $subscriptionAdditionalInformation);
     $templateMgr->assign('acceptGiftSubscriptionPayments', $acceptGiftSubscriptionPayments);
     $templateMgr->assign('individualSubscriptionTypes', $individualSubscriptionTypes);
     $templateMgr->assign('institutionalSubscriptionTypes', $institutionalSubscriptionTypes);
     $templateMgr->display('about/subscriptions.tpl');
 }
开发者ID:reconciler,项目名称:ojs,代码行数:38,代码来源:AboutHandler.inc.php


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