Examples of BillingException


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

                //customer.setAddress();
            }
        } catch (Exception e){
            String msg = "Failed to get customer for customer id: " + customerId + ".";
            log.error(msg, e);
            throw new BillingException(msg, e);
        }

        return customer;
    }
View Full Code Here

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

                return item;
            }
        } catch (SQLException e) {
            String msg = "Failed to get the item with item id: " + itemId + ".";
            log.error(msg, e);
            throw new BillingException(msg, e);

        } finally {
            try {
                if (ps != null) {
                    ps.close();
View Full Code Here

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

            ps.executeUpdate();
        } catch (SQLException e) {
            String msg = "Error in updating the subscription: " + subscription.getId() + ".";
            log.error(msg, e);
            throw new BillingException(msg, e);

        } finally {
            try {
                if (ps != null) {
                    ps.close();
View Full Code Here

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

            //setting the customer id: we dont have the customer id in the customer object
            //which comes with the subscription object. Therefore we have to get it.
            if(subscription.getCustomer().getId()==0){
                int customerId = CustomerUtils.getCustomerId(subscription.getCustomer().getName());
                if(customerId==0){
                    throw new BillingException("No customer found with domain: " +
                            subscription.getCustomer().getName());
                }
                //ps.setInt(6, subscription.getCustomer().getId());
                ps.setInt(6, customerId);
            }else{
                ps.setInt(6, subscription.getCustomer().getId());
            }

            ps.executeUpdate();
            result = ps.getGeneratedKeys();
            if (result.next()) {
                subscriptionId = result.getInt(1);
                subscription.setId(subscriptionId);
            }
        } catch (SQLException e) {
            String msg = "Failed to insert the subscription.";
            log.error(msg, e);
            throw new BillingException(msg, e);

        } finally {
            try {
                if (ps != null) {
                    ps.close();
View Full Code Here

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

                // we will fill the payment details too
            }
        } catch (SQLException e) {
            String msg = "Failed to get the active subscriptions for filter: " + filter + ".";
            log.error(msg, e);
            throw new BillingException(msg, e);

        } finally {
            try {
                if (ps != null) {
                    ps.close();
View Full Code Here

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

                invoice.setTotalPayment(new Cash(totalPaymentsStr));
            }
        } catch (SQLException e) {
            String msg = "Failed to get the invoice for customer: " + customer.getName() + ".";
            log.error(msg, e);
            throw new BillingException(msg, e);

        } finally {
            try {
                if (ps != null) {
                    ps.close();
View Full Code Here

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

                invoices.add(invoice);
            }
        } catch (SQLException e) {
            String msg = "Failed to get invoices for customer: " + customer.getName() + ".";
            log.error(msg, e);
            throw new BillingException(msg, e);

        } finally {
            try {
                if (ps != null) {
                    ps.close();
View Full Code Here

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

            }
        } catch (SQLException e) {
            String msg = "Failed to fill the payment for subscription: "
                    + subscription.getId() + ".";
            log.error(msg, e);
            throw new BillingException(msg, e);

        } finally {
            try {
                if (ps != null) {
                    ps.close();
                }
            } catch (SQLException ex) {
                String msg = RegistryConstants.RESULT_SET_PREPARED_STATEMENT_CLOSE_ERROR
                        + ex.getMessage();
                log.error(msg, ex);
                throw new BillingException(msg, ex);
            }

            try {
                if (results != null) {
                    results.close();
View Full Code Here

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

            ps.executeUpdate();
        } catch (SQLException e) {
            String msg = "Error in associating invoice: " + invoice.getId() +
                    " with payment: " + payment.getId() + ".";
            log.error(msg, e);
            throw new BillingException(msg, e);

        } finally {
            try {
                if (ps != null) {
                    ps.close();
                }
            } catch (SQLException ex) {
                String msg = RegistryConstants.RESULT_SET_PREPARED_STATEMENT_CLOSE_ERROR
                        + ex.getMessage();
                log.error(msg, ex);
                throw new BillingException(msg, ex);
            }
        }
    }
View Full Code Here

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

            }
        } catch (SQLException e) {
            String msg = "Failed to insert the invoice subscription, invoice id: " +
                    invoice.getId() + ", subscription id: " + subscription.getId() + ".";
            log.error(msg, e);
            throw new BillingException(msg, e);
        } finally {
            try {
                if (ps != null) {
                    ps.close();
                }
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.