in

AlertPay Developers Community

Problems with IPN Post Return

Last post 05-15-2008 1:29 PM by AlertPay_Hanif. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 05-06-2008 6:13 PM

    Problems with IPN Post Return

      Hi, I need help with the integration of you payments notification with our site. I'll paste some code and images to try and illustrate my problem.

    First of all i have this page to test the transaction a customer could do from our site. alertpay.asp


    <%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>AlertPay Payment</title>
    </head>

    <body>
        <form method="post" action="https://www.alertpay.com/PayProcess.aspx"
            <input type="hidden" name="ap_purchasetype" value="service"/> 
            <input type="hidden" name="ap_merchant" value="eve@lazerwager.com"/> 
            <input type="hidden" name="ap_itemname" value="LazerWager Deposit"/> 
            <input type="hidden" name="ap_currency" value="USD"/> 
            <input type="hidden" name="ap_returnurl" value="http://www.lazerwager.com/"/> 
            <input type="hidden" name="ap_quantity" value="1"/> 
            <input type="hidden" name="ap_cancelurl" value="http://www.lazerwager.com/cancel.asp"/>
            <input type="text" name="ap_amount" value=""/>
            <input type="image" name="ap_image" src="https://www.alertpay.com/Images/BuyNow/big_pay_01.gif"/>
            <input type="hidden" name="apc_1" value="lzw1042" />
        </form>
    </body>
    </html>

    Next you can see my IPN setup at the moment
    IPN Setup

    and alert_return.asp code next

    <%@LANGUAGE="javascript" CODEPAGE="1252"%>
    <!--#INCLUDE file="confirmfunctions.asp"-->
    <%        
    var merchant, itemname, currency, totalAmount, referencenumber, status, securitycode;

    function initVars(){
        merchant = Request.Form("ap_merchant");
        itemname = Request.Form("ap_itemname");
        currency = Request.Form("ap_currency");
        amount = Request.Form("ap_amount");
        account = Request.Form("apc_1");
        totalAmount = Request.Form("ap_totalamount");
        referencenumber = Request.Form("ap_referencenumber");
        status = Request.Form("ap_status");
        securitycode = Request.Form("ap_securitycode");   
    }

    initVars();

    var pdescription = "Test by Carlos";
    var preference = "";
    var pamount = "";
    var ptransid = "";
    amount = 15;

        InsertAlertPayDeposit('lzw1042', amount, pdescription, "TransId:");   
    %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    </head>
    <body>
    <table width="300" border="0" cellspacing="1" cellpadding="1">
      <tr>
            <th scope="col">account</th>
        <th scope="col">merchant</th>
        <th scope="col">itemname</th>
        <th scope="col">currency</th>
        <th scope="col">amount</th>
        <th scope="col">totalAmount</th>
        <th scope="col">referencenumber</th>
        <th scope="col">status</th>
        <th scope="col">securitycode</th>
      </tr>
      <tr>
        <td><%= account %></td>
        <td><%= merchant %></td>
        <td><%= itemname %></td>
        <td><%= currency %></td>
        <td><%= amount %></td>
        <td><%= totalAmount %></td>
        <td><%= referencenumber %></td>
        <td><%= status %></td>
        <td><%= securitycode %></td>
      </tr>
    </table>

    </body>
    </html>

    Test Transaction

    in alertpay.asp i put http://www.lazerwager.com/ as the returnurl
    <input type="hidden" name="ap_returnurl" value="http://www.lazerwager.com/"/>

    even if I change it to <input type="hidden" name="ap_returnurl" value="http://www.lazerwager.com/alert_return.asp"/> won't help at all, because on your code you make a javascript redirect

    function updateSeconds() {
    var ctlSecondsRemaining = document.getElementById("secondsRemaining");

    second--;

    ctlSecondsRemaining.innerHTML = second;

    if (second>0)
    queueNextUpdate();
    else
    window.location = 'http://www.lazerwager.com/';

    }
    Please let me know how to get the info in order to validate the transactions.

    Thanks, Carlos Jimenez
    Developer - LazerWager.com
  • 05-15-2008 1:29 PM In reply to

    Re: Problems with IPN Post Return

    Hi 

    we do not redirect the customers to alerturl but we post the data on it - and for sample IPN code for asp please see http://67.205.87.232/files/folders/asp/default.aspx
    and you can also find this by clicking 'Downloads' on dev.alertpay.com
    If you want to show to your customers that they have successfully purchased the items and some info about the purchase - you would need to save the information that we are posting on your AlertUrl in your database and then retrieve it from your database when the customers are redirected to your return Url

Page 1 of 1 (2 items)

  AlertPay - Verified by Visa AlertPay - secure credit card and checking services BBBOnline Reliability Program