Просмотр исходного кода

Ticket #3824 - Payments: ChargeBee Portal doesn't work.

AntonLV 4 лет назад
Родитель
Сommit
55f16bd4f9

+ 1 - 0
modules/boonex/payment/classes/BxPaymentProviderChargebeeV3.php

@@ -11,6 +11,7 @@
 
 require_once('BxPaymentProviderChargebee.php');
 
+use ChargeBee\ChargeBee\Environment;
 use ChargeBee\ChargeBee\Models\PortalSession;
 
 class BxPaymentProviderChargebeeV3 extends BxPaymentProviderChargebee

+ 11 - 7
modules/boonex/payment/js/chargebee_v3.js

@@ -161,22 +161,26 @@ BxPaymentProviderChargebeeV3.prototype.subscribeWithAddons = function(oLink, mix
 };
 
 BxPaymentProviderChargebeeV3.prototype.manage = function(oLink, iPendingId) {
-	var $this = this;
+    var $this = this;
     var oDate = new Date();
 
     $(".bx-popup-applied:visible").dolPopupHide();
 
-	this._rHandler.setPortalSession(function() {
+    this._rHandler.setPortalSession(function() {
     	return $.post({
-    		url: $this._sActionsUrl + 'call/' + $this._sProvider + '/get_portal/' + iPendingId + '/',
-    		dataType: 'json'
+            url: $this._sActionsUrl + 'call/' + $this._sProvider + '/get_portal/' + iPendingId + '/',
+            dataType: 'json'
     	});
     });
 
-	var cbPortal = this._rHandler.createChargebeePortal();
-	cbPortal.open({});
+    var cbPortal = this._rHandler.createChargebeePortal();
+    cbPortal.open({
+        close: function() {
+            $this._rHandler.logout();
+        }
+    });
 
-	return false;
+    return false;
 };
 
 /** @} */