0

我目前正在将 ccavenue 与站点集成。这已成功发生。现在我想知道 ccavenue 有多少 traqnsaction 成功发生以及有多少失败交易发生。ccavenue 在他自己的帐户上显示此数据,但我希望它在 infusionsoft.so 上目的我将代码添加到重定向 URL 页面,如果交易成功发生,用户将添加太多 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
    }
}
?>
4

1 回答 1

0

由于在您的评论中您声明您希望在交易成功时通过 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 语句并为其提供正确的参数。

于 2013-10-07T17:14:30.823 回答