Home PHP JavaScript CSS WordPress APIs .htaccess Other How-To Useful Scripts What I Recommend
Posted on by Aleksandar Gichevski ()
JVZoo is a great affiliate platform where vendors can sell products while internet marketers can promote that products and earn affiliate commission. It is similar to ClickBank but with more features that make the process of selling products lot easier. Because the popularity of JVZoo in last years I will show you below how to use JVZoo IPN to process the payments and store transaction information to an application.

Get JVZoo Secret Key

Every JVZoo IPN action is connected with your Account Secret Key, so here are the steps how to get it. Step.1 Create JVzoo.com Account Step.2 After creating account please login and visit below page: https://www.jvzoo.com/myaccount You should see your Account Information. Search for Click here to edit JVZIPN Secret Key link as shown on below image:

get-secret-key

Step.3 Click on that link, Enter your Secret Key and click Save. That's it your JVZoo IPN secret key has been successfully saved.

Process JVZoo Payment with IPN

Here is simple script for processing JVZoo Payment:
if(!isset($_POST['ctransaction']))
	die('unathorized access.');

function jvzipnVerification() {
    $secretKey = "";
    $pop = "";
    $ipnFields = array();
    foreach ($_POST AS $key => $value) {
        if ($key == "cverify") {
            continue;
        }
        $ipnFields[] = $key;
    }
    sort($ipnFields);
    foreach ($ipnFields as $field) {
        // if Magic Quotes are enabled $_POST[$field] will need to be
        // un-escaped before being appended to $pop
        $pop = $pop . $_POST[$field] . "|";
    }
    $pop = $pop . $secretKey;
    $calcedVerify = sha1(mb_convert_encoding($pop, "UTF-8"));
    $calcedVerify = strtoupper(substr($calcedVerify,0,8));
    return $calcedVerify == $_POST["cverify"];
}

if(jvzipnVerification() == 1)
{
        //register sale
	if($_POST['ctransaction'] == 'SALE')
	{
            //execute code when sale has been made
        }
}
Let's analyze what this simple script does... First we check if there is POST parameter 'ctransaction' that is part from JVZoo IPN. If that parameter does not exist then the request is not sent from JVZoo. If 'ctransaction' parameter exists then we verify if the request really came from JVZoo using predefined function for verification. If verification is passed then we can execute whatever code we want. In our case there is IF clause that checks if the transaction was SALE then it executes code. Other types of transaction are:

Type

Description

SALE

The purchase of a standard product or the initial purchase of recurring billing product.

BILL

A rebill for a recurring billing product.

RFND

The refunding of a standard or recurring billing product. Recurring billing products that are refunded also result in a “CANCEL-REBILL” action.

CGBK

A chargeback for a standard or recurring product.

INSF

An eCheck chargeback for a standard or recurring product.

CANCEL-REBILL

The cancellation of a recurring billing product. Recurring billing products that are canceled do not result in any other action.

UNCANCEL-REBILL

Reversing the cancellation of a recurring billing product.

JVZoo IPN Sent Parameters

Here is a list of parameters that are sent from JVZoo IPN after specific transaction has been executed:

Parameter

Description

Detail

ccustname

customer name

1-510 Characters

ccuststate

customer state

0-2 Characters

ccustcc

customer country code

0-2 Characters

ccustemail

customer email

1-255 Characters

cproditem

JVZoo product number

1-5 Characters

cprodtitle

title of product at time of purchase

0-255 Characters

cprodtype

type of product on transaction (STANDARD, and RECURRING)

8-11 Characters

ctransaction

action taken

4-15 Characters

ctransaffiliate

affiliate on transaction

0-10 Characters

ctransamount

amount paid to party receiving notification (in pennies (1000 = $10.00))

3-10 Characters

ctranspaymentmethod

method of payment by customer

0-4 Characters

ctransvendor

vendor on transaction

5-10 Characters

ctransreceipt

JVZoo Payment Id

16-22 Characters

cupsellreceipt

Parent receipt number for upsell transaction

8-13 Characters

caffitid

affiliate tracking id

0 – 24 Characters

cvendthru

extra information passed to order form with duplicated information removed

0-1024 Characters

cverify

the “cverify” parameter is used to verify the validity of the previous fields

8 Characters

ctranstime

the Epoch time the transaction occurred (not included in cverify)

10 Characters

Enter an Instant Notification URL

After completing your IPN script you need to to one more thing to make it work properly. Step.1 Click the Sellers tab Step.2 Click your product in the sub nav Step.3 Enter an Instant Notification URL in the JVZIPN URL field (ports 80 or 443 – SSL Recommended) and click 'Save Changes' Now you are all set and all JVZoo transactions will be processed and sent to your Instant Notification URL.

Other Posts You Might Like

Get a fast, free website audit

Enter your URL below to get full in-depth SEO report and tips.

Useful Scripts

Most Popular Posts

Recent Posts

June 14th, 2014
Website Optimization Using Gzip Compression

June 10th, 2014
Google Search AutoComplete API

May 14th, 2014
What is a Tag Cloud and How to Calculate it by Formula

March 27th, 2014
Error writing file /tmp (errcode 28) Solved!

February 15th, 2014
Fixed CSS & HTML Navigation Bar

February 9th, 2014
Benchmark Your Server (CPU, File IO, MySQL) with SysBench

February 8th, 2014
JavaScript Array Basics

January 29th, 2014
JVZoo IPN API in PHP

January 25th, 2014
Payoneer Debit Card for Freelancers to receive money online

January 24th, 2014
How HTML Color Codes are generated?

Read Latest Posts directly on Facebook

Archive

X

Get a fast, free website audit

Enter your URL below to get full in-depth SEO report and tips.