Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Innovative Gateway Solutions PHP script - need help!


Recommended Posts

Posted

Hello. Does anyone any have experience using the PHP scripts provided by Innovative Gateway Solutions (IGS) to send credit card transactions to their gateway? I'm using the code from their own website (http://www.innovativemerchant.com/support/developers/documentation.php).

 

However, when the example.php script calls the PostTransaction function, it doesn't return any useful information as to whether the transaction was successful or not, even though the code is supposed to do this. I've also tried it with a real merchant user ID and password, and I'm still not getting any results.

 

By the way, my code is running on a Linux server with PHP 4.3.11, an SSL certificate installed (by GoDaddy.com), and with cURL support enabled.

 

If you've had this problem before and know a solution (other than switching to another merchant!), please help, as I have a project that needs to be completed in the next day or two. Thanks!

 

BTW, the code I'm using is below, as provided by IGS:

 

<?

 

//---------------------------------------------------------

// Payment Authorization Gateway via PHP (v0.1-0)

// ----------------

// Written by: John M. Brown <[email protected]>

// IWAS2 Tech's Dynamic DNS Services

// http://www.ipupdater.com

// ----------------

// Purpose: Interface with the Payment Gateway in order

// to verify credit card numbers and payments.

//---------------------------------------------------------

//

// Most of this file should be straightforward so make sure

// you read the entire file before sending an email.

//

//---------------------------------------------------------

 

 

include("PostGateway.function"); // REQUIRED:

// This is the location of

// the "function" file.

 

 

//--< SETUP >---------------------------

// You may add as many variables as you need in order

// to post to the authorization gateway. Just add

// them in the form:

//

// $transaction["VARIABLE"] = "VALUE";

//

// All of the data returned from the server is provided

// in an array and passed back from the

// PostTransaction() function.

//

// $response = PostTransaction($transaction);

//

// You can access each of the variables returned from

// the server using:

//

// $response["VARIABLE"]

//

// This will contain the value for the respective

// variable.

 

//--< GLOBAL VARIABLES >-----------------

// These are the required variables for the function

// to work correctly. You may want to include these

// along with your username/password for the gateway

// in a "global" include file (and even possibly

// the include statement above).

 

// Required variables for authorization gateway

$transaction["target_app"] = "WebCharge_v5.06";

$transaction["response_mode"] = "simple";

$transaction["response_fmt"] = "delimited";

$transaction["upg_auth"] = "zxcvlkjh";

$transaction["delimited_fmt_field_delimiter"] = "=";

$transaction["delimited_fmt_include_fields"] = "true";

 

$transaction["delimited_fmt_value_delimiter"] = "|";

// Changing the "delimited_fmt_value_delimiter

// may require a change in the function logic.

// I recommend that you do not make changes

// to the global variables EXCEPT to the

// username and password.

 

//--< LOGIN INFO >----------------------

 

// Your Gateway Authorization Credentials:

$transaction["username"] = "gatewaytest";

$transaction["pw"] = "GateTest2002";

 

//--< PER TRANSACTION DATA >------------

// You should change these variables dynamically

// according to the type of transaction you want to

// complete.

 

$transaction["trantype"] = "sale";

// Allowable Transaction Types:

// Options: preauth, postauth, sale, credit, void

 

$transaction["reference"] = ""; // Blank for new sales...

// required for VOID, POSTAUTH, and CREDITS.

// Will be original Approval value.

 

$transaction["trans_id"] = ""; // Blank for new sales...

// required for VOID, POSTAUTH, and CREDITS.

// Will be original ANATRANSID value.

 

$transaction["authamount"] = ""; // Only valid for POSTAUTH and

// is equal to the original

// preauth amount.

 

$transaction["cardtype"] = "visa";

// Allowable Card Types:

// visa, mc, amex, diners, discover, jcb

 

// Credit Card information

$transaction["ccnumber"] = "0000000000000000";

// CC# may include spaces or dashes.

 

$transaction["month"] = "01"; // Must be TWO DIGIT month.

$transaction["year"] = "2004"; // Must be TWO or FOUR DIGIT year.

 

$transaction["fulltotal"] = "0.25"; // Total amount WITHOUT dollar sign.

 

$transaction["ccname"] = "Joe Smoe";

$transaction["baddress"] = "123 Somwhere";

$transaction["baddress1"] = "";

$transaction["bcity"] = "MyTown";

$transaction["bstate"] = "NC";

$transaction["bzip"] = "90210";

$transaction["bcountry"] = "US"; // TWO DIGIT COUNTRY (United States = "US")

$transaction["bphone"] = "336.123.1234";

$transaction["email"] = "[email protected]";

 

//--< POST THE TRANSACTION >-----------------------

 

$response = PostTransaction($transaction);

 

//--< PARSE THE RESPONSE >-------------------------

// As stated above. The values are returned in the format:

//

// $response["VARIABLE"]

//

// So if you want to see if you're approved you should check

// for a variable $response["approved"] and if it exists

// then its value is the approval number.

//

// If there was an error it will be in the

// $response["error"] field.

//

// NOTE: All response field names are in lowercase.

 

if ($response["approved"] != "")

{

print "Approved: " . $response["approved"] . "\n";

print "\n";

} else {

print "Error: " . $response["error"] . "\n";

print "\n";

}

 

//--< END >----------------------------------------

?>

Posted

Basically, it turns out that I had to supply the IP address and port number of the proxy server that my hosting provider, GoDaddy, uses for my hosting account.

 

So you actually need to update the PostGateway.function PHP file, even though the documentation tells you not to modify this unless you've got something strange going on.

 

So I merely changed one line of code as follows:

 

Before:

 

$proxy = ""; // If you use a proxy server to connect

 

After:

 

$proxy = "http://64.202.165.131:3128"; // Contact your hosting provider to get the correct IP address and port #

 

I couldn't believe this worked so well!

 

Hope this helps anyone in the future who may be dealing with this.

 

Hello. Does anyone any have experience using the PHP scripts provided by Innovative Gateway Solutions (IGS) to send credit card transactions to their gateway? I'm using the code from their own website (http://www.innovativemerchant.com/support/developers/documentation.php).

 

However, when the example.php script calls the PostTransaction function, it doesn't return any useful information as to whether the transaction was successful or not, even though the code is supposed to do this. I've also tried it with a real merchant user ID and password, and I'm still not getting any results.

 

By the way, my code is running on a Linux server with PHP 4.3.11, an SSL certificate installed (by GoDaddy.com), and with cURL support enabled.

 

If you've had this problem before and know a solution (other than switching to another merchant!), please help, as I have a project that needs to be completed in the next day or two. Thanks!

 

BTW, the code I'm using is below, as provided by IGS:

 

<?

 

//---------------------------------------------------------

// Payment Authorization Gateway via PHP (v0.1-0)

// ----------------

// Written by: John M. Brown <[email protected]>

// IWAS2 Tech's Dynamic DNS Services

// http://www.ipupdater.com

// ----------------

// Purpose: Interface with the Payment Gateway in order

// to verify credit card numbers and payments.

//---------------------------------------------------------

//

// Most of this file should be straightforward so make sure

// you read the entire file before sending an email.

//

//---------------------------------------------------------

 

 

include("PostGateway.function"); // REQUIRED:

// This is the location of

// the "function" file.

 

 

//--< SETUP >---------------------------

// You may add as many variables as you need in order

// to post to the authorization gateway. Just add

// them in the form:

//

// $transaction["VARIABLE"] = "VALUE";

//

// All of the data returned from the server is provided

// in an array and passed back from the

// PostTransaction() function.

//

// $response = PostTransaction($transaction);

//

// You can access each of the variables returned from

// the server using:

//

// $response["VARIABLE"]

//

// This will contain the value for the respective

// variable.

 

//--< GLOBAL VARIABLES >-----------------

// These are the required variables for the function

// to work correctly. You may want to include these

// along with your username/password for the gateway

// in a "global" include file (and even possibly

// the include statement above).

 

// Required variables for authorization gateway

$transaction["target_app"] = "WebCharge_v5.06";

$transaction["response_mode"] = "simple";

$transaction["response_fmt"] = "delimited";

$transaction["upg_auth"] = "zxcvlkjh";

$transaction["delimited_fmt_field_delimiter"] = "=";

$transaction["delimited_fmt_include_fields"] = "true";

 

$transaction["delimited_fmt_value_delimiter"] = "|";

// Changing the "delimited_fmt_value_delimiter

// may require a change in the function logic.

// I recommend that you do not make changes

// to the global variables EXCEPT to the

// username and password.

 

//--< LOGIN INFO >----------------------

 

// Your Gateway Authorization Credentials:

$transaction["username"] = "gatewaytest";

$transaction["pw"] = "GateTest2002";

 

//--< PER TRANSACTION DATA >------------

// You should change these variables dynamically

// according to the type of transaction you want to

// complete.

 

$transaction["trantype"] = "sale";

// Allowable Transaction Types:

// Options: preauth, postauth, sale, credit, void

 

$transaction["reference"] = ""; // Blank for new sales...

// required for VOID, POSTAUTH, and CREDITS.

// Will be original Approval value.

 

$transaction["trans_id"] = ""; // Blank for new sales...

// required for VOID, POSTAUTH, and CREDITS.

// Will be original ANATRANSID value.

 

$transaction["authamount"] = ""; // Only valid for POSTAUTH and

// is equal to the original

// preauth amount.

 

$transaction["cardtype"] = "visa";

// Allowable Card Types:

// visa, mc, amex, diners, discover, jcb

 

// Credit Card information

$transaction["ccnumber"] = "0000000000000000";

// CC# may include spaces or dashes.

 

$transaction["month"] = "01"; // Must be TWO DIGIT month.

$transaction["year"] = "2004"; // Must be TWO or FOUR DIGIT year.

 

$transaction["fulltotal"] = "0.25"; // Total amount WITHOUT dollar sign.

 

$transaction["ccname"] = "Joe Smoe";

$transaction["baddress"] = "123 Somwhere";

$transaction["baddress1"] = "";

$transaction["bcity"] = "MyTown";

$transaction["bstate"] = "NC";

$transaction["bzip"] = "90210";

$transaction["bcountry"] = "US"; // TWO DIGIT COUNTRY (United States = "US")

$transaction["bphone"] = "336.123.1234";

$transaction["email"] = "[email protected]";

 

//--< POST THE TRANSACTION >-----------------------

 

$response = PostTransaction($transaction);

 

//--< PARSE THE RESPONSE >-------------------------

// As stated above. The values are returned in the format:

//

// $response["VARIABLE"]

//

// So if you want to see if you're approved you should check

// for a variable $response["approved"] and if it exists

// then its value is the approval number.

//

// If there was an error it will be in the

// $response["error"] field.

//

// NOTE: All response field names are in lowercase.

 

if ($response["approved"] != "")

{

print "Approved: " . $response["approved"] . "\n";

print "\n";

} else {

print "Error: " . $response["error"] . "\n";

print "\n";

}

 

//--< END >----------------------------------------

?>

  • 4 weeks later...
Posted

would you please explain what and how you installed this contribution and got it to work? There seems to be so many people struggling with this issue - any help would be great!

  • 3 months later...
Posted

Yes, could you please mention what you did, where this code goes.. niether godadddy or innovative is helpful.

 

thanks

Music is body splash for the soul.

  • 1 year later...
Posted

If you need help with this contribution please contact me. i'm currently doing an implementation.

  • 1 month later...
Posted

thanks for everyone's comments here.

 

I just called Innovative Solutions and they do not provide tech support for osCommerce. So these postings are a great help to our project as well.

 

 

I am assuming everyone here is using the Innovative Gateway Solutions Module, v2.40B. You can find it here: http://addons.oscommerce.com/info/4502

 

 

I think it's time to have a step by step guide on using oscom with Innovative Gateway Solutions. I will post what I can here. thanks for all of your comments!

 

Mike

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...