Package org.wso2.carbon.billing.core

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


        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

    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

        }
        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

        }
        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

        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

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

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

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

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

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

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

        // load the configuration and initialize the billing engine + do the
        // necessary scheduling.
        String configFile =
                CarbonUtils.getCarbonConfigDirPath() + "/" + BillingConstants.BILLING_CONFIG;
        BillingConfiguration billingConfiguration = new BillingConfiguration(configFile);
        BillingManager billingManager = new BillingManager(billingConfiguration);

        bundleContext.registerService(BillingManager.class.getName(), billingManager, null);
    }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.billing.core.BillingManager

Copyright © 2018 www.massapicom. 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.