Posts

Showing posts from July, 2012

Bill & Pay Web API Call Example

What is Bill & Pay? Businesses of any size can affordably send electronic invoices and receive ACH and credit card payments online from their customers. Bill & Pay is the most comprehensive product of its kind on the market today. It is loaded with features and options, while remaining affordable and easy-to-use . Checkout out Bill & Pay for QuickBooks users or Bill & Pay Easy Invoice for non-QuickBooks users. Benefits of Bill & Pay  Here is sample java code for authentication. String xmlRequestData = "<?xml version=\"1.0\"?><request><response><type>xml</type></response><biller><authenticate><id>1111</id><password>password</password></authenticate></biller></request>"; public String xmlPost(String xmlRequestData) {         String result = "";         OutputStream os = null;         try {             URL url = new URL("ht

Configuring Oracle XE connection pool in Glassfish and Using JPA

To setup an Oracle Datasource in Glassfish, follow these steps: 1. Download and copy the Oracle JDBC driver (ojdbc14.jar ) to /glassfish/domains/domain1/lib/ext directory. 2. Start Glassfish. 3. Login to the admin interface and create a JDBC Connection Pool.     Delete all properties, and add following properties:     * user - set this to Oracle userid     * password - set this to Oracle password     * URL - set this to the URL, example jdbc:oracle:thin:@localhost:1521:xe.     * xa-driver-does-not-support-non-tx-operations - set this to true. Test the connection pool using ping. 4. Create a JDBC DataSource using the Connection Pool. If in case of Oracle major version error : javax.persistence.PersistenceException: org.hibernate.HibernateException: unknown Oracle major version [11] The fix for the error is add <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/> in your persistence.xml

Velocity Templating for Email

Library Requirement : velocity-1.7.jar Make template folder under resources and put following template vm file  invoice_email.vm file content <html>        <head>     <style>             *{margin:0; padding:0; outline:none}     </style>     </head>     <body>     <div style="background:#fcdd8c; padding:30px;">             <div style="background:#FFF; border-radius:15px; width:600px; padding:20px; margin:0 auto; box-shadow:0 1px 5px #000">             <p style="font:bold 14px/30px Tahoma, Geneva, sans-serif">Dear ${vp.salutation} ${vp.lastName},</p>             <p style="font:normal 12px/20px Arial, Helvetica, sans-serif; margin-bottom:5px">Please find the attached invoice dated: ${vp.invoiceDate}. Please let us know if you have any question.</p>             <p style="font:normal 12px/18px Arial, Helvetica, sans-serif; margin-bottom:20px">Thank