How to integrate your PHP site with USA ePay payment gateway?

Contributors: Vidya Poulose and Shivendra Singh

USA ePay  has been helping merchants process their credit card and check transactions with speed and security since 1998. Currently the USA ePay gateway supports all of the major platforms in the credit card industry and works with some of the leading check platforms. We had an opportunity to integrate it with several web sites ownded by one of customers. We would like to share our experience. If you have any questions or need help, feel free to contact us.

REQUIREMENTS

-PHP 4.3.x or higher (http://www.php.net)

-HTTPs streams support in PHP

or

-Curl/ssl module installed (http://curl.haxx.se/)

 

Step:1->Download  The USAePay PHP Library from http://wiki.usaepay.com/developer/phplibrary

The USAePay PHP library is a class for running transactions on the USAePay gateway.

Step:2-> Download Certificate Authority (CA) bundle file from  https://www.usaepay.com/topics/curl-ca-bundle.crt .

This is a file (Certificate Authority (CA) ) that validates all the popular “root” certificate authorities, and this in turn is used to verify that you are in fact correctly communicating with the New Relic servers, and that there is little to no chance of there being a “man in the middle” attack on your data.

Steps3-> Run “verify_install.php”

A “verify_install.php” script has been included in library that will help you check that your server is properly configured to use the php library. To use this script you must first edit it, filling in the correct path to usaepay.php. If you upload both usaepay.php and verify_install.php to the same directory, you can usually set the include to: include ”./usaepay.php”;

Note: If the SSL certificate path test failed, it’s possible that curl is not correctly configured to use this bundle. You can correct the problem by adding the following code to your script:

 $tran->cabundle='<?php echo $certpath?>’; (Path of Certificate Authority (CA) file)

Steps 4-> If  the file: “verify_install.php” runs with no errors and shows an “OK” in each category, Now we can start with following input arguments.

<?php

include “./usaepay.php”;    (First Add usaepay class. Path of usaepay class should be correct)

$tran=new umTransaction;           (Instantiate USAePay client object)

$tran->key=”Your_source_key_here“;   (Source key must be generated within the console)

$tran->ip=$REMOTE_ADDR; (This allows fraud blocking on the customer’s IP address)

$tran->testmode=1;         (Change this to 0 for the transaction to process)

$tran->card=”1234567890987654″;   (card number, no dashes, no spaces)

$tran->exp=”1234″;                            (expiration date 4 digits no)

$tran->amount=”23.00″;                     (charge amount in dollars)

$tran->invoice=”1234″;                       (invoice number.  Must be unique)

$tran->cardholder=”name”;   (name of card holder)

$tran->street=”address”;        (street address)

$tran->zip=”560068″;                          (zip code)

$tran->description=”description”;      (description of charge)

$tran->cvv2=”123″;                             (cvv2 code (Security Code))   

echo “<h1>Please wait one moment while we process your card…<br>\n”;

flush();

if($tran->Process())

{

            echo “<b>Card Approved</b><br>”;

            echo “<b>Authcode:</b> ” . $tran->authcode . “<br>”;

            echo “<b>AVS Result:</b> ” . $tran->avs . “<br>”;

            echo “<b>Cvv2 Result:</b> ” . $tran->cvv2 . “<br>”;

} else {

            echo “<b>Card Declined</b> (” . $tran->result . “)<br>”;

            echo “<b>Reason:</b> ” . $tran->error . “<br>”;      

            if(@$tran->curlerror) echo “<b>Curl Error:</b> ” . $tran->curlerror . “<br>”;        }

 

Note:

If Specified source key available, Card Number, Expiry date and cvv2 (Security Code) are valid then (after process of the card) we will get message for Card Approveal. Otherwise we will get message for Card Decline.

How generate Sources key?

We can generate key at http://www.usaepay.com. When you  logon to your USAePay Merchant Console (https://sandbox.usaepay.com/login).

Steps for generating Source Key.

Setting->Sources Keys->Add Sources->Fill-up Source Info->Apply

After clicking “apply” button, source key will be generated. Now we can use this source key for transaction.

For More information please read  http://wiki.usaepay.com/developer/phplibrary.

Recent Developments @ KNS

AWS Partner: KNS became the partner of Amazon Web Services (AWS). AWS is the leader in cloud computing and in order to help its clients KNS became the partner of AWS. Here are some of the cloud solutions KNS has expertise in:

Talend Partner: Talend is the leading open source platform for Data Integration. KNS has become the partner of Talend to build solutions in following areas:

Jaspersoft Partner: Jaspersoft is one of the leading open source Business Intelligence platforms. 

SugarCRM Partner: SugarCRM is world’s fastest growing Customer Relationship Management (CRM) software company. It has the modules for Sales, Marketing and Service management. It has a freely available community edition too.

SWAM Certification: KNS Technologies obtained SWAM certification from Commonwealth of Virginia. This will help KNS in competing better for state and local government project in Commonwealth of Virginia.

 

WordPress Multisite Vs Drupal Multisite

WordPress and Drupal are two of the popular content management systems available for web development. Here is an analysis on mutlisite features of WordPress and Drupal.

WordPress:

  1. Multi-site feature built into it’s core
  2. Users can register for their own site and be up and running with their own theme, plug-ins and more in only a few minutes
  3. Sites built aren’t too complex in their data
  4. Multi-site can allow a single WordPress installation manage 1,000s of sites or more with the same 1-click updates and other features that make WordPress so attractive for any smaller site or blog.
  5. Administrator WordPress multi-site can allow for the control and moderation of many sites from a single point
  6.  The built-in user registration system allows for completely hands-off scalability and site creation but doesn’t really allow much control for individuality within individual sites.  Example all themes and plug-ins that a site owner can use must first be installed by an administrator and cannot be edited or modified in any way by the owner of an individual site
  7. If your sites are related such as sites of faculty members in a university department or something similar then we can use WordPress multisite feature. Check http://WordPress.org/showcase/flavor/WordPress-ms/ for a show case of sites developed using multisite feature. 

Drupal:

  1. Multisites are completely different sites, using different databases, but sharing the source code. Then you can’t share content or configuration.
  2. Users can’t just register for a site and be up and running in a few seconds. Instead an administrator must manually set up the site and may in fact go as far as allowing custom themes, modules, and more. 
  3. You have a need for multiple complex sites or a small amount of very different sites than Drupal’s multi-site is preferred
  4. Each site in a Drupal multi-site is a completely separate site

 

Purpose:

The key thing to remember is that the WordPress and Drupal multisite features have different purposes. The main purpose of WordPress Multiuser is to establish a network of interconnected blogs with features like following and reblogging. Drupal multisite, on the other hand, is to make maintenance of many sites simple. There is no interconnectedness built in.

Technical:

The database structure for network in WordPress is single database with different prefixed tables. Drupal gives you two options, single database with different prefixed tables or seperate database for each site.

Conclusion:

Both WordPress and Drupal can be excellent choices depending on what you want to do. If you’re going for a blog or smaller site, then WordPress is probably better choice. If however you need complex data or workflows or you are going to taking in data from your users, then Drupal might be better.

 

 

logo
logo

Chat

Hi! Welcome to KNS Technologies Chatbot.