| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- /**
- * Copyright (c) UNA, Inc - https://una.io
- * MIT License - https://opensource.org/licenses/MIT
- *
- * @defgroup Payment Payment
- * @ingroup UnaModules
- *
- * @{
- */
- function BxPaymentSubscriptions(oOptions) {
- this.init(oOptions);
- }
- BxPaymentSubscriptions.prototype = new BxPaymentMain();
- BxPaymentSubscriptions.prototype.init = function(oOptions) {
- if($.isEmptyObject(oOptions))
- return;
- this._sActionsUrl = oOptions.sActionUrl;
- this._sObjName = oOptions.sObjName == undefined ? 'oPmtSubscriptions' : oOptions.sObjName;
- this._sAnimationEffect = oOptions.sAnimationEffect == undefined ? 'fade' : oOptions.sAnimationEffect;
- this._iAnimationSpeed = oOptions.iAnimationSpeed == undefined ? 'slow' : oOptions.iAnimationSpeed;
- };
- BxPaymentSubscriptions.prototype.getDetails = function(oLink, iId) {
- var $this = this;
- var oDate = new Date();
- this.loadingInButton(oLink, true);
- $.post(
- this._sActionsUrl + 'subscription_get_details/' + iId + '/',
- {
- _t:oDate.getTime()
- },
- function(oData){
- $this.loadingInButton(oLink, false);
- $(".bx-popup-applied:visible").dolPopupHide();
- $this.processResult(oData);
- },
- 'json'
- );
- };
- BxPaymentSubscriptions.prototype.getBilling = function(oLink, iId) {
- var $this = this;
- var oDate = new Date();
- this.loadingInButton(oLink, true);
- $.post(
- this._sActionsUrl + 'subscription_get_billing/' + iId + '/',
- {
- _t:oDate.getTime()
- },
- function(oData){
- $this.loadingInButton(oLink, false);
- $(".bx-popup-applied:visible").dolPopupHide();
- $this.processResult(oData);
- },
- 'json'
- );
- };
- BxPaymentSubscriptions.prototype.changeBilling = function(oLink, iId) {
- var $this = this;
- var oDate = new Date();
- this.loadingInButton(oLink, true);
- $.post(
- this._sActionsUrl + 'subscription_change_billing/' + iId + '/',
- {
- _t:oDate.getTime()
- },
- function(oData){
- $this.loadingInButton(oLink, false);
- $(".bx-popup-applied:visible").dolPopupHide();
- $this.processResult(oData);
- },
- 'json'
- );
- };
- BxPaymentSubscriptions.prototype.requestCancelation = function(oLink, iId) {
- var $this = this;
- var oDate = new Date();
- this.loadingInButton(oLink, true);
- $.post(
- this._sActionsUrl + 'subscription_cancelation/' + iId + '/',
- {
- _t:oDate.getTime()
- },
- function(oData){
- $this.loadingInButton(oLink, false);
- $(".bx-popup-applied:visible").dolPopupHide();
- $this.processResult(oData);
- },
- 'json'
- );
- };
- /** @} */
|