Examples of BillingManager


Examples of org.wso2.carbon.billing.core.BillingManager

        UserRegistry registry = (UserRegistry) getGovernanceRegistry();
        return getCurrentInvoiceOfCustomer(registry);
    }

    public int addPayment(Payment payment, String amount) throws Exception {
        BillingManager billingManager = Util.getBillingManager();
        BillingEngine billingEngine =
                billingManager.getBillingEngine(StratosConstants.MULTITENANCY_SCHEDULED_TASK_ID);
        Cash cashAmount = new Cash(amount);
        payment.setAmount(cashAmount);
        if(payment.getInvoice()!=null){
            payment.setSubscriptions(billingEngine.getInvoiceSubscriptions(payment.getInvoice().getId()));
        }
View Full Code Here

Examples of org.wso2.carbon.billing.core.BillingManager

        }
        return paymentId;
    }

    public PaginatedBalanceInfoBean getPaginatedBalances(int pageNumber) throws Exception {
        BillingManager billingManager = Util.getBillingManager();
        BillingEngine billingEngine =
                billingManager.getBillingEngine(StratosConstants.MULTITENANCY_SCHEDULED_TASK_ID);
        List<OutstandingBalanceInfoBean> balanceBeans = billingEngine.getAllOutstandingBalances(null); //no tenant domain
        PaginatedBalanceInfoBean paginatedBalanceBean = new PaginatedBalanceInfoBean();
        DataPaginator.doPaging(pageNumber, balanceBeans, paginatedBalanceBean);

        return paginatedBalanceBean;
View Full Code Here

Examples of org.wso2.carbon.billing.core.BillingManager

        return paginatedBalanceBean;
    }

    public OutstandingBalanceInfoBean[] getOutstandingBalance(String tenantDomain) throws Exception {
        BillingManager billingManager = Util.getBillingManager();
        BillingEngine billingEngine =
                billingManager.getBillingEngine(StratosConstants.MULTITENANCY_SCHEDULED_TASK_ID);
        List<OutstandingBalanceInfoBean> balanceBeans = billingEngine.getAllOutstandingBalanceInfoBeans(tenantDomain);
        return balanceBeans.toArray(new OutstandingBalanceInfoBean[balanceBeans.size()]);
    }
View Full Code Here

Examples of org.wso2.carbon.billing.core.BillingManager

        return balanceBeans.toArray(new OutstandingBalanceInfoBean[balanceBeans.size()]);
    }

    private MultitenancyInvoice getPastInvoiceById(UserRegistry registry,
                                               int invoiceId) throws Exception {
        BillingManager billingManager = Util.getBillingManager();
        BillingEngine billingEngine =
                billingManager.getBillingEngine(StratosConstants.MULTITENANCY_SCHEDULED_TASK_ID);

        Invoice invoice = billingEngine.getInvoice(invoiceId);
        if (invoice == null) {
            return null;
        }
View Full Code Here

Examples of org.wso2.carbon.billing.core.BillingManager

    private MultitenancyInvoice getCurrentInvoiceOfCustomer(UserRegistry registry) throws Exception {
        // we have to generate the invoice for this.
       

        BillingManager billingManager = Util.getBillingManager();
        BillingEngine billingEngineViewer =
                billingManager.getBillingEngine(StratosConstants.MULTITENANCY_VIEWING_TASK_ID);
        Customer customer = getCurrentCustomer(registry, billingEngineViewer);
        if (customer == null) {
            // no customer => no invoices
            return null;
        }
View Full Code Here

Examples of org.wso2.carbon.billing.core.BillingManager

        }
        return customers.get(0);
    }

    private BillingPeriod[] getAvailableBillingPeriods(UserRegistry registry) throws Exception {
        BillingManager billingManager = Util.getBillingManager();
        BillingEngine billingEngine =
                billingManager.getBillingEngine(StratosConstants.MULTITENANCY_SCHEDULED_TASK_ID);
       
        Customer customer = getCurrentCustomer(registry, billingEngine);
        if (customer == null) {
            return new BillingPeriod[0];
        }
View Full Code Here

Examples of org.wso2.carbon.billing.core.BillingManager

        }
        return billingPeriods;
    }

    private void sendPaymentReceivedEmail(Payment payment) throws Exception{
        BillingManager billingManager = Util.getBillingManager();
        BillingEngine billingEngine =
                billingManager.getBillingEngine(StratosConstants.MULTITENANCY_SCHEDULED_TASK_ID);
        if(payment.getInvoice()!=null){
            Invoice invoice = billingEngine.getInvoice(payment.getInvoice().getId());
            if(invoice!=null){
                Customer customer = invoice.getCustomer();
                if(customer!=null){
View Full Code Here

Examples of org.wso2.carbon.billing.core.BillingManager

        String configFile = CarbonUtils.getCarbonConfigDirPath() + "/" + BILLING_CONFIG;
        BillingConfiguration billingConfiguration = new BillingConfiguration(configFile);

        DataSource dataSource = billingConfiguration.getDataSource();
        assertNotNull("data should be not null", dataSource);
        BillingManager billingManager = new BillingManager(billingConfiguration);
        try {
            if (BillingManager.getInstance() != null) {
                BillingManager.destroyInstance();
            }
        } catch (Exception e) {

        }

        //billingManager.scheduleBilling();
        billingEngine = billingManager.getBillingEngine(SELLER_ID);
    }
View Full Code Here

Examples of org.wso2.carbon.billing.core.BillingManager

                BillingManager.destroyInstance();
            }
        } catch (Exception e) {

        }
        BillingManager billingManager = new BillingManager(billingConfiguration);
        //billingManager.scheduleBilling();
        billingEngine = billingManager.getBillingEngine(SELLER_ID);
    }
View Full Code Here

Examples of org.wso2.carbon.billing.core.BillingManager

                BillingManager.destroyInstance();
            }
        } catch (Exception e) {

        }
        BillingManager billingManager = new BillingManager(billingConfiguration);
        //billingManager.scheduleBilling();
        billingEngine = billingManager.getBillingEngine(SELLER_ID);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.