I am currently integrating ccavenue with site.which is successfully happened.Now i like to know how many traqnsaction of ccavenue happen successfully and how many failure transaction happen.ccavenue show this data on his own account but i want it on infusionsoft.so for that purpose i add code to redirecturl page where if transaction occur successfully user will add too infusionsoft add but when i execute it it wont show the exact output that i want like show successfull users details on infusionsoft.here is the code that i tried.any help will appreciated.
<? require("libfuncs.php");
require("isdk.php");
include "Barcode39.php";
session_start();
$app = new iSDK;
if ($app->cfgCon("connectionName"))
{
/*
This is the sample RedirectURL PHP script. It can be directly used for integration with CCAvenue if your application is developed in PHP. You need to simply change the variables to match your variables as well as insert routines for handling a successful or unsuccessful transaction.
return values i.e the parameters namely Merchant_Id,Order_Id,Amount,AuthDesc,Checksum,billing_cust_name,billing_cust_address,billing_cust_country,billing_cust_tel,billing_cust_email,delivery_cust_name,delivery_cust_address,delivery_cust_tel,billing_cust_notes,Merchant_Param POSTED to this page by CCAvenue.
*/
$WorkingKey = "my key" ; //put in the 32 bit working key in the quotes provided here
$Merchant_Id= $_REQUEST['Merchant_Id'];
$Amount= $_REQUEST['Amount'];
$Order_Id= $_REQUEST['Order_Id'];
$Merchant_Param= $_REQUEST['Merchant_Param'];
$Checksum= $_REQUEST['Checksum'];
$AuthDesc=$_REQUEST['AuthDesc'];
$Checksum = verifyChecksum($Merchant_Id, $Order_Id , $Amount,$AuthDesc,$Checksum,$WorkingKey);
if($Checksum=="true" && $AuthDesc=="Y")
{
echo "<br>Thank you for shopping with us. Your credit card has been charged and your transaction is successful. We will be shipping your order to you soon.";
$contactId =$_SESSION["contactId"];
$groupId = 384;
$result = $app->grpAssign($contactId, $groupId);
$bc = new Barcode39($_SESSION["contactId"]);
// set text size
$bc->barcode_text_size = 5;
// set barcode bar thickness (thick bars)
$bc->barcode_bar_thick = 4;
// set barcode bar thickness (thin bars)
$bc->barcode_bar_thin = 2;
// save barcode GIF file
$bc->draw($arr['ContactId'].".png");
//Here you need to put in the routines for a successful
//transaction such as sending an email to customer,
//setting database status, informing logistics etc etc
}
else if($Checksum=="true" && $AuthDesc=="B")
{
echo "<br>Thank you for shopping with us.We will keep you posted regarding the status of your order through e-mail";
//Here you need to put in the routines/e-mail for a "Batch Processing" order
//This is only if payment for this transaction has been made by an American Express Card
//since American Express authorisation status is available only after 5-6 hours by mail from ccavenue and at the "View Pending Orders"
}
else if($Checksum=="true" && $AuthDesc=="N")
{
echo "<br>Thank you for shopping with us.However,the transaction has been declined.";
$contactId =$_SESSION["contactId"];
$groupId = 386;
$result = $app->grpAssign($contactId, $groupId);
//Here you need to put in the routines for a failed
//transaction such as sending an email to customer
//setting database status etc etc
}
else
{
echo "<br>Security Error. Illegal access detected";
$contactId =$_SESSION["contactId"];
$groupId = 386;
$result = $app->grpAssign($contactId, $groupId);
//Here you need to simply ignore this and dont need
//to perform any operation in this condition
}
}
?>
Since in your comment you stated that you want to send an email through infusionsoft when a transaction is successful you can use the EmailService to do this.
Details on the emailService can be found here:
http://help.infusionsoft.com/api-docs/emailservice
If you want to send an email template you can use this:
$app->sendTemplate(array(12,16,22), 3380);
If you want to send a non-email template use this:
$clist = array(123,456,789);
$status = $app->sendEmail($clist,"Test@test.com","~Contact.Email~", "","","Text","Test Subject","","This is the body");
Depending on which one you want you will need to put it in your success if statement and supply it with the correct parameters.