Shopping Cart Software Support

GoEmerchant.com provides all-inclusive merchant account solutions
GoEmerchant Online Merchant Accounts Merchant Account Solutions
 

Apply Online | Merchant Sign-In


1.888.638.7867


  Email Us
  Apply Online
Merchant Account Solutions

Code Samples
Code Samples for the EZ Payment Gateway

  Quick Menu
Online Help
Getting Started
Frequently Asked
Questions
Resources
Marketing
Start Here
  Take a Tour of our E-commerce Solutions and Shopping Cart Software.
  Apply online today!



Code Samples

<< previous page    
back to guide


5. Code Samples

NOTE:
The code provided below is only a sample.   This code has been tested on Windows NT 4.0 servers running IIS 4.0 with Active Server Pages and Perl5.  This can be used but will need to be modified to perform the necessary database operations and any customer invoice notifications.  If any of the code is cut and pasted into a file, their will be formatting characters that will cause errors due to this being an HTML document.  All leading spaces must be deleted and re-spaced in your text editor of choice.

Sample Perl Script to Receive the Transaction Results

#! /perl5/bin
######################################################################
# Program : Sample Receipt.cgi
# Subject : This program will parse all the GET method data.
######################################################################
push (@INC, "perl5/lib");
print "Content-type: text/HTML \n\n";

$FORM_DATA = $ENV{'QUERY_STRING'};
foreach (split(/&/, $FORM_DATA))
{
($NAME, $VALUE) = split(/=/, $_);
$NAME =~ s/\+/ /g;
$NAME =~ s/%([0-9|A-F]{2})/pack(C,hex($1))/eg;
$VALUE =~ s/\+/ /g;
$VALUE =~ s/%([0-9|A-F]{2})/pack(C,hex($1))/eg;

# Find unique Variable Name for every variable coming in from the form input

$NUM = 0;
while ($MYVARS{$NAME} ne "")
    {
    $NUM++;
    $NAME =~ s/\.([0-9]+$)|$/\.$NUM/;
    }

# Store Variable NAME=Variable VALUE pair

$MYVARS{$NAME} = $VALUE;
}

$Success = "$MYVARS{'Status'}";
$OrderID = "$MYVARS{'OrderID'}";
## You can receive the rest of the documented key=value pairs by following the code above.  #

print <<"HTML";
<HTML><HEAD><TITLE>SAMPLE RECEIPT.CGI</TITLE></HEAD>
<BODY>
HTML

if ($Success == 1)
    {
    print "Transaction was a success!<br>\n";
    #  Do your order fulfillment here.  Any emails to customer, merchant and database processing.  #
    }
elsif ($Success == 0)
    {
    print "Transaction was not successful!<br>\n";
    #  Remove the current order information from your database based on the OrderID.  #
    }

print <<"HTML_END";
</BODY>
</HTML>
HTML_END

END OF PERL SAMPLE

Sample ASP (Active Server Page) script to receive the Transaction Results.

<%
' Sample Receipt.asp
Success = Request.QueryString("Status")
OrderID = Request.QueryString("OrderID")
' The rest of the key=value pairs can be received by following the code above.
%>
<HTML><HEAD><TITLE>SAMPLE RECEIPT.ASP</TITLE></HEAD>
<BODY>
<%
If Success = "1" then
    Response.Write "Transaction was a success!<br>"
    '  Do your order fulfillment here.  Any emails to customer, merchant and database processing.
Else
    Response.Write "Transaction was not successful!<br>"
    '  Remove the current order information from your database based on the OrderID.
End If
%>
</BODY>
</HTML>

END OF ASP SAMPLE

<< previous page    
back to guide

 

  Contact Us


Sales:


Toll-free:
888.638.7867

Local:
856.546.3800


sales@goemerchant.com


Support:


Toll-free:
888.711.3800


support@goemerchant.com


Newsletter Signup
GoEmerchant.com publishes a Free monthly newsletter packed with helpful tips and industry updates.

Sign up today!

We value your privacy.
Featured Clients
"I started with GoEmerchant as a reseller of their product and used the service for my customers' websites. Their program made it easy to set up a store front with no programming needs or worries."

- Robert Brody, Global World Design

Solutions | Features/Pricing | Featured Clients | Support | Reseller Program | Company | Contact Us

Copyright © 2005, GoEmerchant.com Credit Card Processing Solutions.

GoEmerchant, LLC is a registered ISO/MSP with Key Bank National Association, Cleveland, Ohio.


Privacy Policy
| Terms & Conditions | Site Map