Using IBiz PayPal Integrator with PayPal Merchant Account

Discussion in 'ASP.NET / ASP.NET Core' started by wcn2k, Dec 14, 2006.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Dear dASP community,

    I could really use your help and appreciate your assistance in advance.

    I am working on a website located at www.gemsafeplastics.com that is implemented using classic ASP. The page extensions are .html, but don't let that confuse you. The dASP server is set up to run all .html pages through the asp DLL.

    Here's my problem:

    I need to connect to my PayPal Merchant account for credit card processing through the IBiz PayPal Integrator from /n Software that is available on dASP's server. So far, so good. However, I discovered that dASP only supports the ASP.NET version of this control and not the classic ASP COM object that I need. It was suggested to me that I create a couple ASP.NET pages within my site to just process the credit card transaction and then switch back to classic ASP for the rest of the site's operation. This sounded good to me, so I did a little research and other than having to save a few Session variables in my database so that I can share them between ASP.NET and classic ASP, this solution sounded doable.

    This is where my ignorance of ASP.NET comes in. I loaded a couple demo pages available from /n Software for using their object in ASP.NET. I have set up a couple html pages to show you the source code of the main page and the code behind page. They are located here:

    www.gemsafeplastics.com/Test/directpayment.html
    www.gemsafeplastics.com/Test/directpaymentcodebehind.html

    The actual live page is located here:

    www.gemsafeplastics.com/Test/directpayment.aspx

    The problem I'm having is that the code behind page does not appear to get compiled or activated when the submit button is clicked.

    Here is some other information:

    The /n Software demo directory also includes a web.config file that if I include it in the directory with the directpayment.aspx file, dASP's server will choke on it and generate an error.

    I'm hoping that one of you ASP.NET jocks might take a look at what I've done and tell me that I've got my head up my butt and the solution is simple. I'll take my lumps if some of the bleariness in my eyes will go away. /emoticons/smile.gif

    Questions:

    1) Is there any reason why classic ASP and ASP.NET pages cannot run side by side?

    2) Does dASP need to specially configure my account to allow this? Does some kind of virtual directory need to be set up?

    3) Any ideas on why my code behind page appears to be ignored?

    Again, thank you for your time. Though I'm new to this forum, I promise to come back and contribute. I'm not all take and no give. /emoticons/smile.gif

    Kind regards,
    David
     
  2. 1>The same process handles both asp and aspx pages,so you could have both asp and aspx for the same site.
    2>If you include the web.confg in the sub directory,you will have to use the 'Control Panel>Web Application Tool' to create the sub directory as a web application.
    3>Since you have specified the codebehind file in the page directive('<@Page.. Codebehind="directpayment.aspx.vb' ),it will not be ignored.


    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Bruce

    Bruce DiscountASP.NET Staff

    if you are just using 1 page for payment processing, i would just use inline code (sorta like asp) rather than code behind. By far simpler to implement.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  4. Hi Bruce,

    Thank you for this suggestion. It does seem a lot simpler. The trick now is to figure out how to do this given that the only example code available is the tutorial code from IBiz, which is actually very hard to follow for an old ASP person such as myself.

    I have tried to instantiate the nsoftware.IBizPayPal control inline, but the ASP.NET compiler doesn't like the way I'm doing it. I have set up an .html page to show the code that I'm using:

    www.gemsafeplastics.com/Test/cc.html

    It's short and sweet. Could someone look at it and tell me what I'm doing wrong?

    Many thanks,
    David
     
  5. I was able to inline the code and get it all working. I'm posting this for anyone in the future that may
    have a similar need.

    Be sure to put the IBiz DLL file in a 'bin' directory off the directory where the aspx files reside, not in the root of your website.

    --David

    <%
    dim Directpayment1 As new nsoftware.IBizPayPal.Directpayment

    Directpayment1.URL = 'https://api.sandbox.paypal.com/2.0/'

    Directpayment1.User = 'your_username'
    Directpayment1.Password = 'your_password'
    Directpayment1.Signature = 'your_signature'

    Directpayment1.OrderTotal = '12.88'
    Directpayment1.OrderDescription = 'Fake Sale'

    Directpayment1.CardType = 1 'DirectpaymentCardTypes.ccVisa
    Directpayment1.CardNumber = '4444333322221111'
    Directpayment1.CardExpMonth = 2
    Directpayment1.CardExpYear = Convert.ToInt32(2007)
    Directpayment1.CardCVV = '123'

    Directpayment1.PayerFirstName = 'David'
    Directpayment1.PayerLastName = 'Cooper'
    Directpayment1.PayerStreet1 = '123 Anystreet'
    Directpayment1.PayerCity = 'Anytown'
    Directpayment1.PayerState = 'MO'
    Directpayment1.PayerPostalCode = '65355'
    Directpayment1.PayerIPAddress = Request.ServerVariables('REMOTE_ADDR')

    Directpayment1.Sale()
    Dim result As String = 'Ack : ' + Directpayment1.Ack + ''
    result += 'Amt : ' + Directpayment1.ResponseAmount + ''
    result += 'AVS : ' + Directpayment1.ResponseAVS + ''
    result += 'CVV : ' + Directpayment1.ResponseCVV + ''
    result += 'TxnId: ' + Directpayment1.ResponseTransactionId

    Response.Write(result)
    %>
     
  6. Bruce

    Bruce DiscountASP.NET Staff

    yeah.. ipworks sample code and doc are not the greatest in the world. We spent a lot of time going through their docs and sample code in our internal testing and found that some of the sample code just doens't work.


    Anyway, glad you got it to work!





    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  7. Hi Bruce,

    Yes, I found a lot of errors in their code as well. Also, I emailed their support about possibly having an example of simple inline calls to their routines and they replied saying they had nothing. The solution code I posted is far simpler than any of their documentation.

    Kind regards,
    David
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page