How to use API

Last post 06-24-2008 12:27 PM by jholland99. 6 replies.

Sort Posts:

  • How to use API

    06-20-2008, 3:02 PM
    • Member
      508 point Member
    • stevesimon
    • Member since 08-07-2004, 12:25 AM
    • Texas
    • Posts 168

    Hello,

    This is driving me bonkers!

    I'm trying to use the Authorize.Net automatic recurring billing API. I downloaded the sample code, and I'm at a loss. Then I tried to connect to their SOAP service, which VWD made short work off, but I don't know how to proceed. I can see the properties and functions in the Intellisense, but I'm totally clueless.

    The pdf for the SOAP integration is here: http://www.authorize.net/support/ARB_SOAP_guide.pdf

    The sample code is here: http://developer.authorize.net/dscode/vbnet_arb.zip

    I'm a complete dummy when it comes to SOAP and APIs. Is there a resource that will give me a crash course, so that I can crack this nut?

    Please help! Confused

     

    Thank you! Smile 

    No Guts, No Glory
  • Re: How to use API

    06-22-2008, 8:32 PM
    • Member
      586 point Member
    • ScottR27
    • Member since 02-14-2008, 3:27 PM
    • Maryland
    • Posts 104

    You may have already checked this... but there is a decent tutorial on web services @ w3schools.com  http://www.w3schools.com/webservices/default.asp.  If that doesn't help post a sample of the code you are working with.

     Hope this helps,

     Scott

  • Re: How to use API

    06-23-2008, 10:13 AM
    • Member
      508 point Member
    • stevesimon
    • Member since 08-07-2004, 12:25 AM
    • Texas
    • Posts 168

    Thanks, but the sample code is several hundred lines of code, and I don't know which portion I should paste here.

    If it helps, here is the actual .asmx file for the web service: https://api.authorize.net/soap/v1/Service.asmx

    There is one operation called "AuthenticateTest." It's a simple function that checks if the API is available. Can you give me a simple code sample on how to access that and how to capture the response?

    Thanks! Smile

    No Guts, No Glory
  • Re: How to use API

    06-23-2008, 3:30 PM
    Answer
    • Member
      586 point Member
    • ScottR27
    • Member since 02-14-2008, 3:27 PM
    • Maryland
    • Posts 104

      Add using for web service.. mine was using WindowsFormsApplication1.net.authorize.api;

    1    public bool CheckApi()
    2 {
    3 //Instatiate the Service
    4 Service service = new Service();
    5
    6 //Set Auth Transaction Values
    7 MerchantAuthenticationType myAuth = new MerchantAuthenticationType();
    8
    9 myAuth.name = "Your_NAME";
    10 myAuth.transactionKey = "YOUR_TRANSACTION_KEY";
    11
    12 //Use the service to return a response type
    13 ANetApiResponseType response = service.AuthenticateTest(myAuth);
    14
    15 //Run through the messages
    16 foreach(MessagesTypeMessage mess in response.messages)
    17 {
    18 Console.WriteLine(mess.text);
    19 Console.WriteLine(mess.code);
    20 }
    21
    22 //Check the response result code against the MessageTypeEnum
    23 //Return Bool

    24 if(response.resultCode = MessageTypeEnum.Ok)
    25 {
    26 return true;
    27 }
    28 else if(response.resultCode = MessageTypeEnum.Error)
    29 {
    30 return false;
    31 }
    32 }
     
    Hope this helps,
     
    Scott 
     
  • Re: How to use API

    06-23-2008, 4:43 PM
    • Member
      508 point Member
    • stevesimon
    • Member since 08-07-2004, 12:25 AM
    • Texas
    • Posts 168

    Awesome, thanks!! 

    No Guts, No Glory
  • Re: How to use API

    06-24-2008, 12:22 PM
    • Member
      14 point Member
    • jholland99
    • Member since 03-27-2008, 1:27 AM
    • Posts 24

     Hey Steve,

    I'm trying to get this same thing going with authorize.net too. I'm having difficulty getting a working example going. The vbnet_arb file appears to be in the 1.1 framework I think. If you have an asp.net 2.0 version working could you post your code here? Or email it to me at yacadoo at cox dot net (trying to limit spam bots)?

    Thanks,

    Jason

     

  • Re: How to use API

    06-24-2008, 12:27 PM
    • Member
      14 point Member
    • jholland99
    • Member since 03-27-2008, 1:27 AM
    • Posts 24

     Wait a sec, a second look at this maybe it is not .net 1.1 but these files are classes maybe? Anyhow, if you get a working example I would still appreciate it if you could post your code.

    Later,

    Jason

Page 1 of 1 (7 items)