繁体   English   中英

使用php在ccavenue页面上添加动态内容

[英]Add dynamic content on ccavenue page using php

我目前正在将ccavenue与site。这是成功发生的集成。现在,我想知道ccavenue成功发生了多少笔交易,发生了多少失败事务。ccavenue在自己的帐户上显示此数据,但我希望在infusionsoft.so上进行此操作目的是我将代码添加到redirecturl页面上,如果交易成功完成,用户将添加太多infusionsoft添加,但是当我执行它时,它不会显示我想要的确切输出,就像在infusionsoft上显示成功用户的详细信息。这是我尝试过的代码。任何帮助将不胜感激。

<? 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
    }
}
?>

由于您在评论中表示要在交易成功时通过infusionsoft发送电子邮件,因此可以使用EmailService进行此操作。

关于emailService的详细信息可以在这里找到:

http://help.infusionsoft.com/api-docs/emailservice

如果要发送电子邮件模板,可以使用以下方法:

$app->sendTemplate(array(12,16,22), 3380);

如果要发送非电子邮件模板,请使用以下命令:

$clist = array(123,456,789); 
$status = $app->sendEmail($clist,"Test@test.com","~Contact.Email~", "","","Text","Test Subject","","This is the body");

根据您希望哪一个语句,您需要将它放入成功的if语句中,并为其提供正确的参数。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM