cancel
Showing results for 
Search instead for 
Did you mean: 

Coming from PayPal and Need guidance

We are new to authorize.net and would like to go this foute in favor of our current paypal process.

 

We are a youth sports group where parents register their children for tournaments.

 

1. enter player information and select tournaments on first page (ASP)

2. save entered information on previous form in access db, presents payment page with paypal paynow button

3. paynow button when clicked routes the customer to paypal via the following code:

 

  <input type="hidden" name="cmd" value="_xclick">
  <input type="hidden" name="business" value="paypal@xxxx.com">
  <input type="hidden" name="item_name" value="<%=Request.Form("email")%>">
  <input type="hidden" name="amount" value="<%=(feeplus)%>">
  <input type="hidden" name="item_number" value="<%=(REGID)%>">
  <input type="hidden" name="no_shipping" value="0">
  <input type="hidden" name="no_note" value="1">
  <input type="hidden" name="currency_code" value="USD">
  <input type="hidden" name="notify_url" value="http://www.xxxx.com/register/ipnPayPal.asp">
  <input type="hidden" name="return" value="http://www.xxxx.com">

 

When the transaction is complete in paypal, the ipnpaypal.asp is executed automatically on our site to post paid to the transaction.

 

Can we do this with authorize.net and are there any practice native ASP examples we can use?

pinkstonm
Contributor
29 REPLIES 29

Yes, the most similar API would be SIM. ASP isn't officially supported by Authorize.net any more, but there are code examples for ASP Classic which may work for you, or which you can convert:

https://developer.authorize.net/resources/files/samplecode/asp_sim.zip

 

Also take a look at the documentation PDF:

http://www.authorize.net/support/SIM_guide.pdf

 

<!--#INCLUDE FILE=”simlib.asp”--> 
<FORM METHOD=POST ACTION= "https://secure.authorize.net/gateway/
transact.dll">
<% ret = InsertFP (APIloginid, sequence, amount, txnkey) %>
<INPUT TYPE=HIDDEN NAME="x_version" VALUE="3.1">
<INPUT TYPE=HIDDEN NAME="x_login" VALUE="the merchant’s API Login
ID">
<INPUT TYPE=HIDDEN NAME="x_show_form" VALUE="PAYMENT_FORM">
<INPUT TYPE=HIDDEN NAME="x_method" VALUE="CC">
<INPUT TYPE=HIDDEN NAME="x_amount" VALUE="9.95">
<INPUT TYPE=SUBMIT VALUE="Click here for the secure payment form">
</FORM>
TJPride
Expert

So how does my system know that payment was made?

Part of the registration system is that we update our access file with the players that have registered and currently when paypal processing is complete they execute the IPN module on our site that updates the record paid.  How do I obtain status information as to the result of the trasaction and update my access DB?

Well, the easiest way would probably be to turn on relay response.

 

<!--#INCLUDE FILE= "simlib.asp"--> 
<FORM METHOD=POST ACTION=
"https://secure.authorize.net/gateway/transact.dll">
<% ret = InsertFP (APIloginid, sequence, amount, txnkey) %>
<INPUT TYPE=HIDDEN NAME="x_login" VALUE="the merchant’s API Login ID">
<INPUT TYPE=HIDDEN NAME="x_version" VALUE="3.1">
<INPUT TYPE=HIDDEN NAME="x_method" VALUE="CC">
<INPUT TYPE=HIDDEN NAME="x_show_form" VALUE="PAYMENT_FORM">
<INPUT TYPE=HIDDEN NAME="x_amount" VALUE="9.95">
<INPUT TYPE=HIDDEN NAME="x_relay_response" VALUE="TRUE">
<INPUT TYPE=HIDDEN NAME="x_relay_url" VALUE="Any valid URL">
<INPUT TYPE=SUBMIT VALUE="Click here for the secure payment form">
</FORM>

Note that you have to also go into your control panel and set the relay response URL there to match the one you specify here, otherwise it will be rejected. The relay URL then receives the POST, determines if it's a valid transmission from Authorize.net and if the transaction went through ok, then sends back another URL that Authorize.net forwards the customer to for their receipt. Here is the PHP version so you can get a basic idea of the structure. I've added some notes and cleaned it up slightly.

 

<?php
require_once 'anet_php_sdk/AuthorizeNet.php'; // The SDK 
$redirect_url = "http://YOUR_DOMAIN.com/receipt_page.php"; // Where the user will end up. 
$api_login_id = 'YOUR_API_LOGIN_ID'; 
$md5_setting = ""; // Your MD5 Setting 
$response = new AuthorizeNetSIM($api_login_id, $md5_setting); 
if ($response->isAuthorizeNet()) {   // Can ignore this if not using MD5 setting
if ($response->approved)       // Check response code to see if it's 1
   { 
       // Update your database
       $redirect_url .= '?response_code=1&transaction_id=' . $response->transaction_id; 
   } 
   else 
   {
       $redirect_url .= '?response_code='.$response->response_code . '&response_reason_text=' . $response->response_reason_text; 
   } 
   // Send the Javascript back to AuthorizeNet, which will redirect user back to your site. 
   echo AuthorizeNetDPM::getRelayResponseSnippet($redirect_url); 
} 
else 
{ 
echo "Error. Check your MD5 Setting."; 
}
?> 

 

does anyone have a sample asp version of the response url?

Under "DOWNLOADS" on top of the page then "sample code".

I guess my biggest concern is that we are not sure which process we should use and try and integration with our registration DB which is  access.

 

We are most familiar with ASP

 

All we need to do is be able to have our parents fil out a registration form then be given a payment page, once they pay we just need something to update our registration db that they have in fact paid.

 

Very simple with paypal, but does not seem to be with authorize.net.

 

am I wrong????

Just like TJPride said, sound like PayPal is close to SIM.

Have you read the SIM documentation? Personal, I think they are very simple. And they have sample code in ASP classic code.

Form Post -> Authorize.net CC entry -> relay response.

 

Just pass registration info along as merchant defined fields to authorize.net and get it back in the relay response post.

tried to run the code but am getting include file not found

https://secure.authorize.net/gateway/ transact.dll