AntonLV 9 лет назад
Родитель
Сommit
b3a6ec5831

+ 6 - 6
inc/classes/BxDolPayments.php

@@ -247,33 +247,33 @@ class BxDolPayments extends BxDolFactory implements iBxDolSingleton
 
 	public function getSubscribeUrl($iVendorId, $sVendorProvider, $mixedModuleId, $iItemId, $iItemCount = 1)
     {
-    	if(!BxDolRequest::serviceExists($this->_sActive, 'get_subscribe_url', 'Cart'))
+    	if(!BxDolRequest::serviceExists($this->_sActive, 'get_subscribe_url', 'Subscriptions'))
     		return '';
 
-    	return BxDolService::call($this->_sActive, 'get_subscribe_url', array($iVendorId, $sVendorProvider, $mixedModuleId, $iItemId, $iItemCount), 'Cart');
+    	return BxDolService::call($this->_sActive, 'get_subscribe_url', array($iVendorId, $sVendorProvider, $mixedModuleId, $iItemId, $iItemCount), 'Subscriptions');
     }
 
 	/**
      * Returns "Subscribe" JavaScript code to use in onclick attribute.
      */
-    public function getSubscribeJs($iVendorId, $sVendorProvider, $mixedModuleId, $iItemId, $iItemCount = 1)
+    public function getSubscribeJs($iVendorId, $sVendorProvider, $mixedModuleId, $iItemId, $iItemCount = 1, $sRedirect = '')
     {
     	if(!BxDolRequest::serviceExists($this->_sActive, 'get_subscribe_js', 'Subscriptions'))
 			return array();
 
-		$aSrvParams = array($iVendorId, $sVendorProvider, $mixedModuleId, $iItemId, $iItemCount);
+		$aSrvParams = array($iVendorId, $sVendorProvider, $mixedModuleId, $iItemId, $iItemCount, $sRedirect);
 		return BxDolService::call($this->_sActive, 'get_subscribe_js', $aSrvParams, 'Subscriptions');
     }
 
     /**
      * Returns the whole "Subscribe" link including HTML tag BUTTON and cart JavaScript code.
      */
-    public function getSubscribeLink($iVendorId, $sVendorProvider, $mixedModuleId, $iItemId, $iItemCount = 1)
+    public function getSubscribeLink($iVendorId, $sVendorProvider, $mixedModuleId, $iItemId, $iItemCount = 1, $sRedirect = '')
     {
 		if(!BxDolRequest::serviceExists($this->_sActive, 'get_subscribe_link', 'Subscriptions'))
 			return '';
 
-		$aSrvParams = array($iVendorId, $sVendorProvider, $mixedModuleId, $iItemId, $iItemCount);
+		$aSrvParams = array($iVendorId, $sVendorProvider, $mixedModuleId, $iItemId, $iItemCount, $sRedirect);
 		return BxDolService::call($this->_sActive, 'get_subscribe_link', $aSrvParams, 'Subscriptions');
     }
 

+ 68 - 0
modules/base/notifications/classes/BxBaseModNotificationsModule.php

@@ -34,21 +34,89 @@ class BxBaseModNotificationsModule extends BxBaseModGeneralModule
         $this->_iOwnerId = 0;
     }
 
+    /**
+     * @page service Service Calls
+     * @section bx_base_notifications Base Notifications
+     * @subsection bx_base_notifications-other Other
+     * @subsubsection bx_base_notifications-add_handlers add_handlers
+     * 
+     * @code bx_srv('bx_notifications', 'add_handlers', [...]); @endcode
+     * 
+     * Register handlers for specified module.
+     *
+     * @param $sModuleUri string with module URI.
+     * 
+     * @see BxBaseModNotificationsModule::serviceAddHandlers
+     */
+    /** 
+     * @ref bx_base_notifications-add_handlers "add_handlers"
+     */
 	public function serviceAddHandlers($sModuleUri)
     {
         $this->_updateModuleData('add_handlers', $sModuleUri);
     }
 
+    /**
+     * @page service Service Calls
+     * @section bx_base_notifications Base Notifications
+     * @subsection bx_base_notifications-other Other
+     * @subsubsection bx_base_notifications-delete_handlers delete_handlers
+     * 
+     * @code bx_srv('bx_notifications', 'delete_handlers', [...]); @endcode
+     * 
+     * Unregister handlers for specified module.
+     *
+     * @param $sModuleUri string with module URI.
+     * 
+     * @see BxBaseModNotificationsModule::serviceDeleteHandlers
+     */
+    /** 
+     * @ref bx_base_notifications-delete_handlers "delete_handlers"
+     */
     public function serviceDeleteHandlers($sModuleUri)
     {
         $this->_updateModuleData('delete_handlers', $sModuleUri);
     }
 
+    /**
+     * @page service Service Calls
+     * @section bx_base_notifications Base Notifications
+     * @subsection bx_base_notifications-other Other
+     * @subsubsection bx_base_notifications-delete_module_events delete_module_events
+     * 
+     * @code bx_srv('bx_notifications', 'delete_module_events', [...]); @endcode
+     * 
+     * Delete all events for specified module.
+     *
+     * @param $sModuleUri string with module URI.
+     * 
+     * @see BxBaseModNotificationsModule::serviceDeleteModuleEvents
+     */
+    /** 
+     * @ref bx_base_notifications-delete_module_events "delete_module_events"
+     */
 	public function serviceDeleteModuleEvents($sModuleUri)
     {
         $this->_updateModuleData('delete_module_events', $sModuleUri);
     }
 
+    /**
+     * @page service Service Calls
+     * @section bx_base_notifications Base Notifications
+     * @subsection bx_base_notifications-other Other
+     * @subsubsection bx_base_notifications-get_actions_checklist get_actions_checklist
+     * 
+     * @code bx_srv('bx_notifications', 'get_actions_checklist', [...]); @endcode
+     * 
+     * Get available actions for module settings in Studio.
+     *
+     * @return an array with available actions represented as key => value pairs.
+     * 
+     * @see BxBaseModNotificationsModule::serviceGetActionsChecklist
+     */
+    /** 
+     * @ref bx_base_notifications-get_actions_checklist "get_actions_checklist"
+     */
     function serviceGetActionsChecklist()
     {
     	$sLangPrefix = $this->_oConfig->getPrefix('language');

+ 119 - 43
modules/base/payment/classes/BxBaseModPaymentCart.php

@@ -21,6 +21,24 @@ class BxBaseModPaymentCart extends BxDol
         $this->_oModule = BxDolModule::getInstance($this->MODULE);
     }
 
+    /**
+     * @page service Service Calls
+     * @section bx_base_payment Base Payment
+     * @subsection bx_base_payment-integration Integration
+     * @subsubsection bx_base_payment-get_cart_url get_cart_url
+     * 
+     * @code bx_srv('bx_payment', 'get_cart_url', [...], 'Cart'); @endcode
+     * 
+     * Get shopping cart URL.
+     *
+     * @param $iVendor (optional) integer value with vendor ID.
+     * @return string with shopping cart URL.
+     * 
+     * @see BxBaseModPaymentCart::serviceGetCartUrl
+     */
+    /** 
+     * @ref bx_base_payment-get_cart_url "get_cart_url"
+     */
 	public function serviceGetCartUrl($iVendor = 0)
     {
     	if(!$this->_oModule->isLogged())
@@ -32,11 +50,51 @@ class BxBaseModPaymentCart extends BxDol
     	return  bx_append_url_params($this->_oModule->_oConfig->getUrl('URL_CART'), array('seller_id' => $iVendor));
     }
 
+    /**
+     * @page service Service Calls
+     * @section bx_base_payment Base Payment
+     * @subsection bx_base_payment-integration Integration
+     * @subsubsection bx_base_payment-get_cart_url get_cart_url
+     * 
+     * @code bx_srv('bx_payment', 'get_cart_url', [...], 'Cart'); @endcode
+     * 
+     * Get shopping cart URL.
+     *
+     * @param $iVendor (optional) integer value with vendor ID.
+     * @return string with shopping cart URL.
+     * 
+     * @see BxBaseModPaymentCart::serviceGetCartUrl
+     */
+    /** 
+     * @ref bx_base_payment-get_cart_url "get_cart_url"
+     */
     public function serviceGetCartJs($sType = '')
     {
         return $this->_oModule->_oTemplate->displayCartJs($sType);
     }
 
+    /**
+     * @page service Service Calls
+     * @section bx_base_payment Base Payment
+     * @subsection bx_base_payment-integration Integration
+     * @subsubsection bx_base_payment-get_add_to_cart_js get_add_to_cart_js
+     * 
+     * @code bx_srv('bx_payment', 'get_add_to_cart_js', [...], 'Cart'); @endcode
+     * 
+     * Get JavaScript code to use in OnClick attributes. 
+     *
+     * @param $iVendor integer value with vendor ID.
+     * @param $mixedModuleId mixed value (ID, Name or URI) determining a module from which the action was initiated.
+     * @param $iItemId $iItemId integer value with item ID. 
+     * @param $iItemCount integer value with a number of items for purchasing. 
+     * @param $bNeedRedirect (optional) boolean value determining whether redirect is needed after add action or not.
+     * @return string with JavaScript code to use in OnClick attributes of HTML elements.
+     * 
+     * @see BxBaseModPaymentCart::serviceGetAddToCartJs
+     */
+    /** 
+     * @ref bx_base_payment-get_add_to_cart_js "get_add_to_cart_js"
+     */
     public function serviceGetAddToCartJs($iVendorId, $mixedModuleId, $iItemId, $iItemCount, $bNeedRedirect = false)
     {
 		$iModuleId = $this->_oModule->_oConfig->getModuleId($mixedModuleId);
@@ -46,6 +104,28 @@ class BxBaseModPaymentCart extends BxDol
         return $this->_oModule->_oTemplate->displayAddToCartJs($iVendorId, $iModuleId, $iItemId, $iItemCount, $bNeedRedirect);
     }
 
+    /**
+     * @page service Service Calls
+     * @section bx_base_payment Base Payment
+     * @subsection bx_base_payment-integration Integration
+     * @subsubsection bx_base_payment-get_add_to_cart_link get_add_to_cart_link
+     * 
+     * @code bx_srv('bx_payment', 'get_add_to_cart_link', [...], 'Cart'); @endcode
+     * 
+     * Get HTML code for "Add to Cart" link. 
+     *
+     * @param $iVendorId integer value with vendor ID.
+     * @param $mixedModuleId mixed value (ID, Name or URI) determining a module from which the action was initiated.
+     * @param $iItemId $iItemId integer value with item ID. 
+     * @param $iItemCount integer value with a number of items for purchasing. 
+     * @param $bNeedRedirect (optional) boolean value determining whether redirect is needed after add action or not.
+     * @return HTML string with link to display on the site.
+     * 
+     * @see BxBaseModPaymentCart::serviceGetAddToCartLink
+     */
+    /** 
+     * @ref bx_base_payment-get_add_to_cart_link "get_add_to_cart_link"
+     */
 	public function serviceGetAddToCartLink($iVendorId, $mixedModuleId, $iItemId, $iItemCount, $bNeedRedirect = false)
     {
         $iModuleId = $this->_oModule->_oConfig->getModuleId($mixedModuleId);
@@ -55,54 +135,50 @@ class BxBaseModPaymentCart extends BxDol
 		return $this->_oModule->_oTemplate->displayAddToCartLink($iVendorId, $iModuleId, $iItemId, $iItemCount, $bNeedRedirect);
     }
 
-	public function serviceGetSubscriptionsUrl($iVendor = 0)
-    {
-    	if(!$this->_oModule->isLogged())
-            return '';
-
-		if($iVendor == 0)
-    		return $this->_oModule->_oConfig->getUrl('URL_SUBSCRIPTIONS');
-
-    	return  bx_append_url_params($this->_oModule->_oConfig->getUrl('URL_SUBSCRIPTIONS'), array('seller_id' => $iVendor));
-    }
-
-	public function serviceGetSubscribeUrl($iVendorId, $sVendorProvider, $mixedModuleId, $iItemId, $iItemCount = 1)
-    {
-    	if(!$this->_oModule->isLogged())
-            return '';
-
-    	return  bx_append_url_params($this->_oModule->_oConfig->getUrl('URL_SUBSCRIBE'), array(
-    		'seller_id' => $iVendorId,
-    		'seller_provider' => $sVendorProvider,
-    		'module_id' => $mixedModuleId, 
-    		'item_id' => $iItemId,
-    		'item_count' => $iItemCount
-    	));
-    }
-
-	public function serviceGetSubscribeJs($iVendorId, $sVendorProvider, $mixedModuleId, $iItemId, $iItemCount = 1, $sRedirect = '')
-    {
-		$iModuleId = $this->_oModule->_oConfig->getModuleId($mixedModuleId);
-        if(empty($iModuleId))
-            return '';
-
-        return $this->_oModule->_oTemplate->displaySubscribeJs($iVendorId, $sVendorProvider, $iModuleId, $iItemId, $iItemCount, $sRedirect);
-    }
-
-	public function serviceGetSubscribeLink($iVendorId, $sVendorProvider, $mixedModuleId, $iItemId, $iItemCount = 1, $sRedirect = '')
-    {
-        $iModuleId = $this->_oModule->_oConfig->getModuleId($mixedModuleId);
-        if(empty($iModuleId))
-            return '';
-
-		return $this->_oModule->_oTemplate->displaySubscribeLink($iVendorId, $sVendorProvider, $iModuleId, $iItemId, $iItemCount, $sRedirect);
-    }
-
+    /**
+     * @page service Service Calls
+     * @section bx_base_payment Base Payment
+     * @subsection bx_base_payment-integration Integration
+     * @subsubsection bx_base_payment-get_cart_item_descriptor get_cart_item_descriptor
+     * 
+     * @code bx_srv('bx_payment', 'get_cart_item_descriptor', [...], 'Cart'); @endcode
+     * 
+     * Get cart item descriptor: 1-2-3-1. 
+     *
+     * @param $iVendorId integer value with vendor ID.
+     * @param $iModuleId integer value with module ID determining a module from which the action was initiated.
+     * @param $iItemId $iItemId integer value with item ID. 
+     * @param $iItemCount integer value with a number of items for purchasing. 
+     * @return string with item descriptor.
+     * 
+     * @see BxBaseModPaymentCart::serviceGetCartItemDescriptor
+     */
+    /** 
+     * @ref bx_base_payment-get_cart_item_descriptor "get_cart_item_descriptor"
+     */
 	public function serviceGetCartItemDescriptor($iVendorId, $iModuleId, $iItemId, $iItemCount)
 	{
 		return $this->_oModule->_oConfig->descriptorA2S(array($iVendorId, $iModuleId, $iItemId, $iItemCount));
 	}
 
+	/**
+     * @page service Service Calls
+     * @section bx_base_payment Base Payment
+     * @subsection bx_base_payment-integration Integration
+     * @subsubsection bx_base_payment-get_cart_items_count get_cart_items_count
+     * 
+     * @code bx_srv('bx_payment', 'get_cart_items_count', [...], 'Cart'); @endcode
+     * 
+     * Get items count in member's shopping cart. 
+     * 
+     * @param $iUserId (optional) integer value with user ID. If empty value is provided then currently logged in user will be used.
+     * @return integer value with items count.
+     * 
+     * @see BxBaseModPaymentCart::serviceGetCartItemsCount
+     */
+    /** 
+     * @ref bx_base_payment-get_cart_items_count "get_cart_items_count"
+     */
     public function serviceGetCartItemsCount($iUserId = 0)
     {
     	$iUserId = !empty($iUserId) ? $iUserId : $this->_oModule->getProfileId();

+ 17 - 0
modules/base/payment/classes/BxBaseModPaymentDetails.php

@@ -21,6 +21,23 @@ class BxBaseModPaymentDetails extends BxDol
         $this->_oModule = BxDolModule::getInstance($this->MODULE);
     }
 
+    /**
+     * @page service Service Calls
+     * @section bx_base_payment Base Payment
+     * @subsection bx_base_payment-integration Integration
+     * @subsubsection bx_base_payment-get_details_url get_details_url
+     * 
+     * @code bx_srv('bx_payment', 'get_details_url', [...], 'Details'); @endcode
+     * 
+     * Get payment providers' configuration settings page URL.
+     * 
+     * @return string with page URL.
+     * 
+     * @see BxBaseModPaymentDetails::serviceGetDetailsUrl
+     */
+    /** 
+     * @ref bx_base_payment-get_details_url "get_details_url"
+     */
 	public function serviceGetDetailsUrl()
     {
     	if(!$this->_oModule->isLogged())

+ 71 - 0
modules/base/payment/classes/BxBaseModPaymentModule.php

@@ -22,6 +22,24 @@ class BxBaseModPaymentModule extends BxBaseModGeneralModule
         $this->_sLangsPrefix = $this->_oConfig->getPrefix('langs');
     }
 
+    /**
+     * @page service Service Calls
+     * @section bx_base_payment Base Payment
+     * @subsection bx_base_payment-integration Integration
+     * @subsubsection bx_base_payment-update_dependent_modules update_dependent_modules
+     * 
+     * @code bx_srv('bx_payment', 'update_dependent_modules', [...]); @endcode
+     * 
+     * Get payments dependent modules and save them. 
+     *
+     * @param $sModule (optional) string value with module name. All modules are used by default.
+     * @param $bInstall (optional) boolean value determining whether the install or uninstall operation is performed.
+     * 
+     * @see BxBaseModPaymentModule::serviceUpdateDependentModules
+     */
+    /** 
+     * @ref bx_base_payment-update_dependent_modules "update_dependent_modules"
+     */
 	public function serviceUpdateDependentModules($sModule = 'all', $bInstall = true)
     {
     	$aModules = $sModule == 'all' ? $this->_oDb->getModulesBy(array('type' => 'modules'), false) : array($this->_oDb->getModuleByName($sModule, false));
@@ -39,6 +57,23 @@ class BxBaseModPaymentModule extends BxBaseModGeneralModule
         }
     }
 
+    /**
+     * @page service Service Calls
+     * @section bx_base_payment Base Payment
+     * @subsection bx_base_payment-other Other
+     * @subsubsection bx_base_payment-get_currency_info get_currency_info
+     * 
+     * @code bx_srv('bx_payment', 'get_currency_info', [...]); @endcode
+     * 
+     * Get default currency info (sign and code). 
+     *
+     * @return an array with currency info.
+     * 
+     * @see BxBaseModPaymentModule::serviceGetCurrencyInfo
+     */
+    /** 
+     * @ref bx_base_payment-get_currency_info "get_currency_info"
+     */
     public function serviceGetCurrencyInfo()
     {
         return array(
@@ -47,6 +82,24 @@ class BxBaseModPaymentModule extends BxBaseModGeneralModule
         );
     }
 
+    /**
+     * @page service Service Calls
+     * @section bx_base_payment Base Payment
+     * @subsection bx_base_payment-other Other
+     * @subsubsection bx_base_payment-get_option get_option
+     * 
+     * @code bx_srv('bx_payment', 'get_option', [...]); @endcode
+     * 
+     * Get value of payment provider configuration option. 
+     *
+     * @param $sOption string value with option name. 
+     * @return string with option value.
+     * 
+     * @see BxBaseModPaymentModule::serviceGetOption
+     */
+    /** 
+     * @ref bx_base_payment-get_option "get_option"
+     */
 	public function serviceGetOption($sOption)
     {
     	$sMethod = 'get' . bx_gen_method_name($sOption);
@@ -56,6 +109,24 @@ class BxBaseModPaymentModule extends BxBaseModGeneralModule
     	return $this->_oDb->getParam($this->_oConfig->getPrefix('options') . $sOption);
     }
 
+    /**
+     * @page service Service Calls
+     * @section bx_base_payment Base Payment
+     * @subsection bx_base_payment-other Other
+     * @subsubsection bx_base_payment-get_providers_cart get_providers_cart
+     * 
+     * @code bx_srv('bx_payment', 'get_providers_cart', [...]); @endcode
+     * 
+     * Get list of available payment providers which can process single time payments via Shopping Cart. 
+     *
+     * @param $iVendorId integer value with vendor ID. 
+     * @return an array with special format.
+     * 
+     * @see BxBaseModPaymentModule::serviceGetProvidersCart
+     */
+    /** 
+     * @ref bx_base_payment-get_providers_cart "get_providers_cart"
+     */
 	public function serviceGetProvidersCart($iVendorId)
 	{
 		$aVendorProviders = $this->_oDb->getVendorInfoProvidersSingle($iVendorId);

+ 36 - 0
modules/base/payment/classes/BxBaseModPaymentOrders.php

@@ -21,6 +21,23 @@ class BxBaseModPaymentOrders extends BxDol
         $this->_oModule = BxDolModule::getInstance($this->MODULE);
     }
 
+    /**
+     * @page service Service Calls
+     * @section bx_base_payment Base Payment
+     * @subsection bx_base_payment-integration Integration
+     * @subsubsection bx_base_payment-get_orders_url get_orders_url
+     * 
+     * @code bx_srv('bx_payment', 'get_orders_url', [...], 'Orders'); @endcode
+     * 
+     * Get orders page URL.
+     *
+     * @return string with orders page URL.
+     * 
+     * @see BxBaseModPaymentOrders::serviceGetOrdersUrl
+     */
+    /** 
+     * @ref bx_base_payment-get_orders_url "get_orders_url"
+     */
 	public function serviceGetOrdersUrl()
     {
     	if(!$this->_oModule->isLogged())
@@ -29,6 +46,25 @@ class BxBaseModPaymentOrders extends BxDol
     	return $this->_oModule->_oConfig->getUrl('URL_ORDERS');
     }
 
+    /**
+     * @page service Service Calls
+     * @section bx_base_payment Base Payment
+     * @subsection bx_base_payment-integration Integration
+     * @subsubsection bx_base_payment-get_orders_count get_orders_count
+     * 
+     * @code bx_srv('bx_payment', 'get_orders_count', [...], 'Orders'); @endcode
+     * 
+     * Get processed orders count by type.
+     *
+     * @param $sType string value with type. For now 'new' type is available only.
+     * @param $iProfileId (optional) integer value with profile ID. If empty value is provided then currently logged in profile will be used.
+     * @return integer value with orders count.
+     * 
+     * @see BxBaseModPaymentOrders::serviceGetOrdersCount
+     */
+    /** 
+     * @ref bx_base_payment-get_orders_count "get_orders_count"
+     */
     public function serviceGetOrdersCount($sType, $iProfileId = 0)
     {
         if(!in_array($sType, array('new')))

+ 90 - 4
modules/base/payment/classes/BxBaseModPaymentSubscriptions.php

@@ -21,6 +21,24 @@ class BxBaseModPaymentSubscriptions extends BxDol
         $this->_oModule = BxDolModule::getInstance($this->MODULE);
     }
 
+    /**
+     * @page service Service Calls
+     * @section bx_base_payment Base Payment
+     * @subsection bx_base_payment-integration Integration
+     * @subsubsection bx_base_payment-get_subscriptions_url get_subscriptions_url
+     * 
+     * @code bx_srv('bx_payment', 'get_subscriptions_url', [...], 'Subscriptions'); @endcode
+     * 
+     * Get subscriptions page URL.
+     *
+     * @param $iVendor (optional) integer value with vendor ID.
+     * @return string with URL.
+     * 
+     * @see BxBaseModPaymentSubscriptions::serviceGetSubscriptionsUrl
+     */
+    /** 
+     * @ref bx_base_payment-get_subscriptions_url "get_subscriptions_url"
+     */
 	public function serviceGetSubscriptionsUrl($iVendor = 0)
     {
     	if(!$this->_oModule->isLogged())
@@ -32,6 +50,28 @@ class BxBaseModPaymentSubscriptions extends BxDol
     	return  bx_append_url_params($this->_oModule->_oConfig->getUrl('URL_SUBSCRIPTIONS'), array('seller_id' => $iVendor));
     }
 
+    /**
+     * @page service Service Calls
+     * @section bx_base_payment Base Payment
+     * @subsection bx_base_payment-integration Integration
+     * @subsubsection bx_base_payment-get_subscribe_url get_subscribe_url
+     * 
+     * @code bx_srv('bx_payment', 'get_subscribe_url', [...], 'Subscriptions'); @endcode
+     * 
+     * Get action URL to initialize subscription.
+     *
+     * @param $iVendor integer value with vendor ID.
+     * @param $sVendorProvider string value with a name of payment provider to be used for processing.
+     * @param $mixedModuleId mixed value (ID, Name or URI) determining a module from which the action was initiated.
+     * @param $iItemId integer value with item ID.
+     * @param $iItemCount (optional) integer value with a number of items for purchasing. It's equal to 1 in case of subscription.
+     * @return string with URL.
+     * 
+     * @see BxBaseModPaymentSubscriptions::serviceGetSubscribeUrl
+     */
+    /** 
+     * @ref bx_base_payment-get_subscribe_url "get_subscribe_url"
+     */
 	public function serviceGetSubscribeUrl($iVendorId, $sVendorProvider, $mixedModuleId, $iItemId, $iItemCount = 1)
     {
     	if(!$this->_oModule->isLogged())
@@ -46,22 +86,68 @@ class BxBaseModPaymentSubscriptions extends BxDol
     	));
     }
 
-	public function serviceGetSubscribeJs($iVendorId, $sVendorProvider, $mixedModuleId, $iItemId, $iItemCount = 1)
+    /**
+     * @page service Service Calls
+     * @section bx_base_payment Base Payment
+     * @subsection bx_base_payment-integration Integration
+     * @subsubsection bx_base_payment-get_subscribe_js get_subscribe_js
+     * 
+     * @code bx_srv('bx_payment', 'get_subscribe_js', [...], 'Subscriptions'); @endcode
+     * 
+     * Get JavaScript code to use in OnClick attributes of HTML elements.
+     *
+     * @param $iVendor integer value with vendor ID.
+     * @param $sVendorProvider string value with a name of payment provider to be used for processing.
+     * @param $mixedModuleId mixed value (ID, Name or URI) determining a module from which the action was initiated.
+     * @param $iItemId integer value with item ID.
+     * @param $iItemCount (optional) integer value with a number of items for purchasing. It's equal to 1 in case of subscription.
+     * @param $sRedirect (optional) string value with redirect URL, if it's needed.
+     * @return string with JavaScript code.
+     * 
+     * @see BxBaseModPaymentSubscriptions::serviceGetSubscribeJs
+     */
+    /** 
+     * @ref bx_base_payment-get_subscribe_js "get_subscribe_js"
+     */
+    public function serviceGetSubscribeJs($iVendorId, $sVendorProvider, $mixedModuleId, $iItemId, $iItemCount = 1, $sRedirect = '')
     {
 		$iModuleId = $this->_oModule->_oConfig->getModuleId($mixedModuleId);
         if(empty($iModuleId))
             return '';
 
-        return $this->_oModule->_oTemplate->displaySubscribeJs($iVendorId, $sVendorProvider, $iModuleId, $iItemId, $iItemCount);
+        return $this->_oModule->_oTemplate->displaySubscribeJs($iVendorId, $sVendorProvider, $iModuleId, $iItemId, $iItemCount, $sRedirect);
     }
 
-	public function serviceGetSubscribeLink($iVendorId, $sVendorProvider, $mixedModuleId, $iItemId, $iItemCount = 1)
+    /**
+     * @page service Service Calls
+     * @section bx_base_payment Base Payment
+     * @subsection bx_base_payment-integration Integration
+     * @subsubsection bx_base_payment-get_subscribe_link get_subscribe_link
+     * 
+     * @code bx_srv('bx_payment', 'get_subscribe_link', [...], 'Subscriptions'); @endcode
+     * 
+     * Get "Subscribe" link including HTML tag and cart JavaScript code.
+     *
+     * @param $iVendor integer value with vendor ID.
+     * @param $sVendorProvider string value with a name of payment provider to be used for processing.
+     * @param $mixedModuleId mixed value (ID, Name or URI) determining a module from which the action was initiated.
+     * @param $iItemId integer value with item ID.
+     * @param $iItemCount (optional) integer value with a number of items for purchasing. It's equal to 1 in case of subscription.
+     * @param $sRedirect (optional) string value with redirect URL, if it's needed.
+     * @return HTML string with link to display on the site.
+     * 
+     * @see BxBaseModPaymentSubscriptions::serviceGetSubscribeLink
+     */
+    /** 
+     * @ref bx_base_payment-get_subscribe_link "get_subscribe_link"
+     */
+    public function serviceGetSubscribeLink($iVendorId, $sVendorProvider, $mixedModuleId, $iItemId, $iItemCount = 1, $sRedirect = '')
     {
         $iModuleId = $this->_oModule->_oConfig->getModuleId($mixedModuleId);
         if(empty($iModuleId))
             return '';
 
-		return $this->_oModule->_oTemplate->displaySubscribeLink($iVendorId, $sVendorProvider, $iModuleId, $iItemId, $iItemCount);
+		return $this->_oModule->_oTemplate->displaySubscribeLink($iVendorId, $sVendorProvider, $iModuleId, $iItemId, $iItemCount, $sRedirect);
     }
 }