Search in This Blog

Orbital chase paymentech gateway Mark for Capture

Orbital Chase Paymentech Gateway Mark for Capture

Chase Orbital is one of the complex Payment Gateway. It's authorization process is very complex.
Here is the code for Orbital Chase Paymentech Gateway Mark for Capture Request in PHP.
You can frequently use it as free.

If you want to implement Orbital chase paymentech by me then Please contact me and I will let you know my charges.

$url = ""; // testing
//$url = ""; // production
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
    $header= "POST /authorize/ HTTP/1.0\r\n";
    $header.= "MIME-Version: 1.0\r\n";
    $header.= "Content-type: application/PTI\r\n";
    $header.= "Content-length: "  .strlen($post_string) . "\r\n";
    $header.= "Content-transfer-encoding: text\r\n";
    $header.= "Request-number: 1\r\n";
    $header.= "Document-type: Request\r\n";
    $header.= "Interface-Version: Test 1.4\r\n";
    $header.= "Connection: close \r\n\r\n";
    $header.= $post_string;
   //// just initialize curl here and post the data to the orbital server.


Download image without cURL and with cURL in PHP

 Download image without cURL and with cURL in PHP

// without cURL
////// Using without CURL
$img = file_get_contents($downloadImageUrl);
$file1 = dirname(__file__).'/aaa.jpg';
file_put_contents($file1, $img);

////// // with cURL
$header = array(
            "Accept-Encoding: gzip,deflate",
            "Accept-Charset: utf-8;q=0.7,*;q=0.7",
            "Connection: close"
$useragent = 'Amit Kumar Gaur';
$file2 = dirname(__file__).'/bbb.jpg';
curl_setopt($curlObj, CURLOPT_HTTPHEADER, $header);
curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curlObj, CURLOPT_HEADER, false);
curl_setopt($curlObj, CURLOPT_USERAGENT, $useragent);
curl_setopt($curlObj, CURLOPT_CONNECTTIMEOUT, 999);
curl_setopt($curlObj, CURLOPT_TIMEOUT, 9999);
curl_setopt($curlObj, CURLOPT_URL, $downloadImageUrl);
$response = curl_exec($curlObj);
$return = false;
if(!curl_errno($curlObj)) {
    file_put_contents($file2, $response);

Extract Corrupt Zip File By Java

Extract Corrupt Zip File By Java

I received an zip file from customer. I have tried to extract with WinZip, but unable to extract zip file because that zip file was corrupt.

So I have tried to extract with Java Zip API and got the success. The code is listed below:

I am sure that the zip file having 5% to 10% part corrupt will be unzip with this code, but if it is having more corrupt then the code will not work.


class ExtractCorruptZip {
public void extractZipFiles(String fileName) {
try {
String zipDir = "c:\\zip\\";
//String zipDir = "/home/usr/amit/zip/";
byte[] by = new byte[2048];
ZipInputStream ziStream = null;
ZipEntry zipEntry;
ziStream = new ZipInputStream(new FileInputStream(fileName));

zipEntry = ziStream.getNextEntry();
int count=1;
while (zipEntry != null) {
String entry = zipDir + zipEntry.getName();
entry = entry.replace('/', File.separatorChar).replace('\\', File.separatorChar);
int n;
FileOutputStream fOTStream;
File newFile = new File(entry);
if (zipEntry.isDirectory()) {
if (!newFile.mkdirs()) {
zipEntry = ziStream.getNextEntry();
fOTStream = new FileOutputStream(entry);
while ((n =, 0, 2048)) > -1) {
fOTStream.write(by, 0, n);
zipEntry = ziStream.getNextEntry();
} catch(IOException ioe) {

public static void main(String[] ss) {
try {
String fileName = "";
ExtractCorruptZip extractCorruptZip = new ExtractCorruptZip();
} catch (Exception ex) {

Google chart api 3d

Google chart api 3d

Here is the simple example of Google 3d chart. just use listed below code.
I have everything explained in commented.

Google chart api 3d

<script type='text/javascript' src=''></script>
<script type="text/javascript">
    // Load Google Visualization API with piechart package.
    google.load('visualization', '1', {'packages':['piechart', 'imagepiechart', 'barchart','imageBarChart','linechart']});
    // load API.
    // Populates datas and draw it.
    function initChart() {
        var dTable = new google.visualization.DataTable();
        // Add two columns
        dTable.addColumn('string', 'Names');
        dTable.addColumn('number', 'Percentage');
        //Add fie rows
        //set the 5 values
        dTable.setValue(0, 0, 'Java');
        dTable.setValue(0, 1, 50);
        dTable.setValue(1, 0, 'ASP.Net');
        dTable.setValue(1, 1, 30);
        dTable.setValue(2, 0, 'PHP');
        dTable.setValue(2, 1,10);
        dTable.setValue(3, 0, 'ASP');
        dTable.setValue(3, 1, 7);
        dTable.setValue(4, 0, 'Java Applet');
        dTable.setValue(4, 1, 3);
        //draw it
        var pChart = new google.visualization.PieChart(document.getElementById('programmingLanguages3DChart'));
        pChart.draw(dTable, {width: 400, height: 240, is3D: true, title: 'Programming Languages 3D Chart'});
    <div id='programmingLanguages3DChart' ></div>

Multiple step OLE DB operation generated errors Check each OLE DB status value if available No work was done

Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done

If you are working with MS Access database then you encounter with the "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done" error.
There are many reasons that produce the above error.
But the common error is Ms Access database password is mismatching. the 2007 Ms Access database password length is 20 characters and if you mistakenly set 21 characters as a password then last 21th character will automatically suppressed by Ms Access Database. for example you have types password as:

then last "u" will automatically deleted and Ms Access will not inform you about it and set the password as:

You will not aware this Ms Access activity and while working with C# or VB.Net you will used the password as:
then you can face the "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done" error.

So just check the password and you will not face this types of error.

TIFF Reader in java

TIFF File Reader

If you have a multiple pages TIFF file and want to see it in java then listed below code will help you.

import java.awt.Frame;
import java.awt.image.RenderedImage;

public class ReadTiff extends Frame {
    ScrollingImagePanel panel;
    public ReadTiff(String filename) throws IOException {
        File file = new File(filename);
        SeekableStream s = new FileSeekableStream(file);
        TIFFDecodeParam param = null;
        ImageDecoder dec = ImageCodec.createImageDecoder("tiff", s, param);
        System.out.println("Number of images in this TIFF: " +
        // 0 means the first, 1 for second and so on.
        int imageToLoad = 0;
        RenderedImage op =
            new NullOpImage(dec.decodeAsRenderedImage(imageToLoad),
        panel = new ScrollingImagePanel(op, 800, 800);

    public static void main(String [] args) {
        String filename = "C:\\java\\tiff\\car1.tif";
        try {
            ReadTiff window = new ReadTiff(filename);
        } catch ( ioe) {