【问题标题】:Add dynamic content on ccavenue page using php使用 php 在 ccavenue 页面上添加动态内容
【发布时间】:2013-10-04 07:29:49
【问题描述】:

我目前正在将 ccavenue 与站点集成。这已成功发生。现在我想知道 ccavenue 有多少 traqnsaction 成功发生以及有多少失败交易发生。ccavenue 在他自己的帐户上显示此数据,但我希望它在 infusionsoft 上。因此,为此目的,我将代码添加到重定向 URL 页面,如果交易成功发生,用户将添加太多 infusionsoft add 但是当我执行它时,它不会显示我想要的确切输出,例如在 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 中显示信息作为注释吗?或者您想在您的网站上向用户显示信息?你想显示什么信息?你能澄清你的问题吗?
  • 我喜欢向用户发送邮件的邮件ID。谁的交易成功与邮件内容的正文附加动态内容完全取决于用户。不同的用户收到不同类型的邮件..

标签: php ccavenue infusionsoft


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-30
    • 2011-02-25
    • 2013-06-02
    • 1970-01-01
    • 1970-01-01
    • 2019-04-09
    相关资源
    最近更新 更多