AntonLV 5 лет назад
Родитель
Сommit
879091934e

+ 5 - 3
modules/boonex/payment/classes/BxPaymentProviderChargebeeV3.php

@@ -30,13 +30,15 @@ class BxPaymentProviderChargebeeV3 extends BxPaymentProviderChargebee
         );
     }
 
-    public function actionGetHostedPage($iClientId, $iVendorId, $sItemName, $sItemAddons = '')
+    public function actionGetHostedPage($iClientId, $iVendorId, $sItemName)
     {
         $this->initOptionsByVendor($iVendorId);
 
         $aItem = array('name' => $sItemName);
-        if(!empty($sItemAddons)) {
-            $aItemAddons = $this->_oModule->_oConfig->s2a($sItemAddons);
+
+        $mixedItemAddons = bx_process_input(bx_get('addons'));
+        if(!empty($mixedItemAddons)) {
+            $aItemAddons = is_array($mixedItemAddons) ? $mixedItemAddons : $this->_oModule->_oConfig->s2a($mixedItemAddons);
 
             foreach($aItemAddons as $sItemAddon)
                 if(!isset($aItem['addons'][$sItemAddon]))

+ 8 - 1
modules/boonex/payment/js/chargebee_v3.js

@@ -39,6 +39,10 @@ BxPaymentProviderChargebeeV3.prototype.init = function(oOptions) {
 };
 
 BxPaymentProviderChargebeeV3.prototype.subscribe = function(oLink) {
+    return this.subscribeWithAddons(oLink);
+};
+
+BxPaymentProviderChargebeeV3.prototype.subscribeWithAddons = function(oLink, mixedAddons) {
     var $this = this;
     var oDate = new Date();
 
@@ -51,7 +55,10 @@ BxPaymentProviderChargebeeV3.prototype.subscribe = function(oLink) {
     this._rHandler.openCheckout({
         hostedPage: function() {
             return $.post({
-                url: $this._sActionsUrl + 'call/' + $this._sProvider + '/get_hosted_page/' + $this._iClientId + '/' + $this._iSellerId + '/' + $this._sItemName + '/' + $this._sItemAddons + '/',
+                url: $this._sActionsUrl + 'call/' + $this._sProvider + '/get_hosted_page/' + $this._iClientId + '/' + $this._iSellerId + '/' + $this._sItemName + '/',
+                data: {
+                    addons: mixedAddons != undefined ? mixedAddons : $this._sItemAddons
+                }, 
                 dataType: 'json'
             });
         },