Kaynağa Gözat

Ticket #5021 - Payments: PayPal API integration doesn't pass the subscription price correctly. For Group Based.

AntonLV 1 yıl önce
ebeveyn
işleme
86aac45161

+ 1 - 1
modules/base/groups/classes/BxBaseModGroupsGridPricesManage.php

@@ -113,7 +113,7 @@ class BxBaseModGroupsGridPricesManage extends BxBaseModGroupsGridPrices
             if(!empty($aPrice) && is_array($aPrice))
                 return ($sMsg = _t($CNF['T']['err_price_duplicate'])) && $this->_bIsApi ? [bx_api_get_msg($sMsg)] : echoJson(['msg' => $sMsg]);
 
-            $iId = (int)$oForm->insert(['profile_id' => $this->_iGroupProfileId, 'order' => $this->_oModule->_oDb->getPriceOrderMax($this->_iRoleId) + 1]);
+            $iId = (int)$oForm->insert(['profile_id' => $this->_iGroupProfileId, 'added' => time(), 'order' => $this->_oModule->_oDb->getPriceOrderMax($this->_iRoleId) + 1]);
             if($iId != 0)
                 $aRes = ['grid' => $this->getCode(false), 'blink' => $iId];
             else

+ 10 - 9
modules/base/groups/classes/BxBaseModGroupsModule.php

@@ -1301,22 +1301,22 @@ class BxBaseModGroupsModule extends BxBaseModProfileModule
         $CNF = &$this->_oConfig->CNF;
 
         if(!$mixedItemId)
-            return array();
+            return [];
 
         if(is_numeric($mixedItemId))
-            $aItem = $this->_oDb->getPrices(array('type' => 'by_id', 'value' => (int)$mixedItemId));
+            $aItem = $this->_oDb->getPrices(['type' => 'by_id', 'value' => (int)$mixedItemId]);
         else 
-            $aItem = $this->_oDb->getPrices(array('type' => 'by_name', 'value' => $mixedItemId));
+            $aItem = $this->_oDb->getPrices(['type' => 'by_name', 'value' => $mixedItemId]);
 
         if(empty($aItem) || !is_array($aItem))
-            return array();
+            return [];
 
         if(!$this->isPaidJoinByProfile($aItem['profile_id']))
-            return array();
+            return [];
 
         $oGroupProfile = BxDolProfile::getInstance($aItem['profile_id']);
         if(!$oGroupProfile)
-            return array();
+            return [];
 
         $aGroupProfile = $this->_oDb->getContentInfoById($oGroupProfile->getContentId());
         
@@ -1328,7 +1328,7 @@ class BxBaseModGroupsModule extends BxBaseModProfileModule
         else
             $sTitle = _t($CNF['T']['txt_cart_item_title_lifetime'], $oGroupProfile->getDisplayName(), $aRoles[$aItem['role_id']]);
 
-        return array (
+        return [
             'id' => $aItem['id'],
             'author_id' => $aGroupProfile[$CNF['FIELD_AUTHOR']],
             'name' => $aItem['name'],
@@ -1339,8 +1339,9 @@ class BxBaseModGroupsModule extends BxBaseModProfileModule
             'price_recurring' => $aItem['price'],
             'period_recurring' => $aItem['period'],
             'period_unit_recurring' => $aItem['period_unit'],
-            'trial_recurring' => 0
-        );
+            'trial_recurring' => 0,
+            'added' => $aItem['added']
+        ];
     }
 
     public function serviceGetCartItems($iSellerId)

+ 1 - 0
modules/boonex/courses/install/sql/install.sql

@@ -361,6 +361,7 @@ CREATE TABLE IF NOT EXISTS `bx_courses_prices` (
   `period` int(11) unsigned NOT NULL default '1',
   `period_unit` varchar(32) NOT NULL default '',
   `price` float unsigned NOT NULL default '1',
+  `added` int(11) NOT NULL default '0',
   `order` int(11) NOT NULL,
   PRIMARY KEY (`id`),
   UNIQUE KEY `name` (`name`),

+ 1 - 0
modules/boonex/events/install/sql/install.sql

@@ -376,6 +376,7 @@ CREATE TABLE IF NOT EXISTS `bx_events_prices` (
   `period` int(11) unsigned NOT NULL default '1',
   `period_unit` varchar(32) NOT NULL default '',
   `price` float unsigned NOT NULL default '1',
+  `added` int(11) NOT NULL default '0',
   `order` int(11) NOT NULL,
   PRIMARY KEY (`id`),
   UNIQUE KEY `name` (`name`),

+ 1 - 0
modules/boonex/groups/install/sql/install.sql

@@ -307,6 +307,7 @@ CREATE TABLE IF NOT EXISTS `bx_groups_prices` (
   `period` int(11) unsigned NOT NULL default '1',
   `period_unit` varchar(32) NOT NULL default '',
   `price` float unsigned NOT NULL default '1',
+  `added` int(11) NOT NULL default '0',
   `order` int(11) NOT NULL,
   PRIMARY KEY (`id`),
   UNIQUE KEY `name` (`name`),

+ 1 - 0
modules/boonex/jobs/install/sql/install.sql

@@ -336,6 +336,7 @@ CREATE TABLE IF NOT EXISTS `bx_jobs_prices` (
   `period` int(11) unsigned NOT NULL default '1',
   `period_unit` varchar(32) NOT NULL default '',
   `price` float unsigned NOT NULL default '1',
+  `added` int(11) NOT NULL default '0',
   `order` int(11) NOT NULL,
   PRIMARY KEY (`id`),
   UNIQUE KEY `name` (`name`),

+ 1 - 0
modules/boonex/organizations/install/sql/install.sql

@@ -309,6 +309,7 @@ CREATE TABLE IF NOT EXISTS `bx_organizations_prices` (
   `period` int(11) unsigned NOT NULL default '1',
   `period_unit` varchar(32) NOT NULL default '',
   `price` float unsigned NOT NULL default '1',
+  `added` int(11) NOT NULL default '0',
   `order` int(11) NOT NULL,
   PRIMARY KEY (`id`),
   UNIQUE KEY `name` (`name`),

+ 1 - 0
modules/boonex/spaces/install/sql/install.sql

@@ -334,6 +334,7 @@ CREATE TABLE IF NOT EXISTS `bx_spaces_prices` (
   `period` int(11) unsigned NOT NULL default '1',
   `period_unit` varchar(32) NOT NULL default '',
   `price` float unsigned NOT NULL default '1',
+  `added` int(11) NOT NULL default '0',
   `order` int(11) NOT NULL,
   PRIMARY KEY (`id`),
   UNIQUE KEY `name` (`name`),