Jump to content
lost_in_normalcy

First Data Global Gateway e4 AIM - New Module release

Recommended Posts

if (version_compare(PHP_VERSION, '5.3.11') == -1) {
        ini_set("user_agent", "PHP-SOAP/" . PHP_VERSION . "\r\nAuthorization: GGE4_API " . $keyid . ":" . $authstr . "\r\nx-gge4-date: " . $hashtime . "\r\nx-gge4-content-sha1: " . sha1($request));
    } else {
        stream_context_set_option($context,array("http" => array("header" => "authorization: GGE4_API " . $keyid . ":" . $authstr . "\r\nx-gge4-date: " . $hashtime . "\r\nx-gge4-content-sha1: " . sha1($request))));
    }
    return parent::__doRequest($request, $location, $action, $version, $one_way);
  }
}

class gge4_cc_aim extends SoapClientHMAC {
  var $code, $title, $description, $enabled;
 

Edited by fiodh

Share this post


Link to post
Share on other sites

I am reading this to say something like:

 

If version of php is not 5.3.1 then initialize SOAP

 

else otherwise LINE 43 - "stream context set option"  whatever...

 

obviously I don't know what I am talking about except that the error may lie in the php version.

Edited by fiodh

Share this post


Link to post
Share on other sites

I downgraded the php version from 5.5 to 5.3 and received a different error:

 

Fatal error: Uncaught SoapFault exception: [HTTP] Unauthorized in /home/website/public_html/includes/modules/payment/gge4_cc_aim.php:45 Stack trace: #0 /home/website/public_html/includes/modules/payment/gge4_cc_aim.php(45): SoapClient->__doRequest('<?xml version="...', 'https://api.glo...''http://secure2....' 1, 0) #1 [internal function]: SoapClientHMAC->__doRequest('<?xml version="...', 'https://api.glo...' 'http://secure2....' 1, 0) #2 /home/website/public_html/includes/modules/payment/gge4_cc_aim.php(185): SoapClient->__call('SendAndCommit', Array) #3 /home/website/public_html/includes/modules/payment/gge4_cc_aim.php(185): SoapClientHMAC->SendAndCommit(Array) #4 /home/website/public_html/includes/classes/payment.php(208): gge4_cc_aim->before_process() #5 /home/website/public_html/checkout_process.php(83): payment->before_process() #6 {main} thrown in /home/website/public_html/includes/modules/payment/gge4_cc_aim.php on line 45

Share this post


Link to post
Share on other sites

turns out that error isn't really different. I switched back to php 5.5   I am thinking that the error is saying that the wrong number of variables are being passed in this array. I am now off to educate myself on arrays and will have a look to see maybe we could cut the variables because the first data is really only looking for the gateway and password, right?

Share this post


Link to post
Share on other sites

also I made sure to set the CVS variables in the terminal at first data ..  they have a setting on the first terminal info page that shows the password, ID, etc and also an option for expecting the card code verification number... Our old terminal was not using this CVS so it needed to be enabled for the new module instead of the SIM.

 

 

this is the deal I am thinkin:

 

 

 

Warning: stream_context_set_option(): called with wrong number or type of parameters; please RTM in /home/website/public_html/includes/modules/payment/gge4_cc_aim.php on line 43

 

"wrong number or type of parameters"

Edited by fiodh

Share this post


Link to post
Share on other sites
stream_context_set_option

(PHP 4 >= 4.3.0, PHP 5, PHP 7)

stream_context_set_optionSets an option for a stream/wrapper/context

Description
bool stream_context_set_option ( resource $stream_or_context , string $wrapper , string $option , mixed $value )
bool stream_context_set_option ( resource $stream_or_context , array $options )

Sets an option on the specified context. value is set to option for wrapper

Parameters stream_or_context

The stream or context resource to apply the options to.

options

The options to set for the default context.

Note:

options must be an associative array of associative arrays in the format $arr['wrapper']['option'] = $value.

Refer to context options and parameters for a listing of stream options.

Return Values

Returns TRUE on success or FALSE on failure.

Share this post


Link to post
Share on other sites

Well this finally appears to be working.

 

Gary the famous osCommerce developer helped me out with this. He pointed out the module was only able to accept a 16 character password. First Data generates passwords that are too long - you can abridge it, or you can select your own - if you select your own, make it complex, capitals, numbers, underlines, etc.

  The longer md5 hash seems to be working fine though.


After that, it turns out the php version check was the culprit. Since we are past version 5.3  I removed the entire version-check from the code - replaced it only with the initialization bit -</p>
 

 

 $show_hkey = implode($hkey);
    $hmackey = "$show_hkey"; // HMAC Key
     $show_key = implode($idkey);
    $keyid = "$show_key"; // API Key ID
    $hashtime = date("c");
    $hashstr = "POST\ntext/xml; charset=utf-8\n" . sha1($request) . "\n" . $hashtime . "\n" . parse_url($location,PHP_URL_PATH);
    $authstr = base64_encode(hash_hmac("sha1",$hashstr,$hmackey,TRUE));
    
        ini_set("user_agent", "PHP-SOAP/" . PHP_VERSION . "\r\nAuthorization: GGE4_API " . $keyid . ":" . $authstr . "\r\nx-gge4-date: " . $hashtime . "\r\nx-gge4-content-sha1: " . sha1($request));
    
    return parent::__doRequest($request, $location, $action, $version, $one_way);
  }
}

class gge4_cc_aim extends SoapClientHMAC {
  var $code, $title, $description, $enabled;

// class constructor

 

 

5 hours later...

Hope this help someone else.

Edited by fiodh

Share this post


Link to post
Share on other sites

Hi Drew,

 

Am I understanding correctly that you have FirstData Payeezy gateway functioning on a 2.3.4 or 2.3.4 BS site?

 

Thanks

Share this post


Link to post
Share on other sites

That answer, I am thrilled to say is "YES"

 

just change that one snippet of code in the module and do everything else right. You should be good.

 

 

 

 

 

 

 

 

Also, please disregard my previous posts rambling on trying to solve the problem, I would delete them if I could.

Edited by fiodh

Share this post


Link to post
Share on other sites

I'm getting the Soap error also. And tried to follow Drew's suggestion.  Is this correct, Drew?

 

 

class SoapClientHMAC extends SoapClient {
 
   function __doRequest($request, $location, $action, $version, $one_way = NULL) {
 
global $context;
 
     $mode_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_GGE4_CC_AIM_TRANSACTION_MODE'");
 
     $trans_mode = tep_db_fetch_array($mode_query);
 
     $show_mode = implode($trans_mode);
 
       if ($show_mode == 'Test') {  // Demo server
 
     $hkey_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_GGE4_CC_AIM_DEMO_MD5_HASH'");
 
     $hkey = tep_db_fetch_array($hkey_query);
 
     $idkey_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_GGE4_CC_AIM_DEMO_TRANSACTION_KEY'");
 
     $idkey = tep_db_fetch_array($idkey_query);
 
       } else {  // Live Server
 
     $hkey_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_GGE4_CC_AIM_MD5_HASH'");
 
     $hkey = tep_db_fetch_array($hkey_query);
 
     $idkey_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_GGE4_CC_AIM_TRANSACTION_KEY'");
 
     $idkey = tep_db_fetch_array($idkey_query);
 
       }
 
     $show_hkey = implode($hkey);
 
$hmackey = "$show_hkey"; // HMAC Key
 
     $show_key = implode($idkey);
 
$keyid = "$show_key"; // API Key ID
 
$hashtime = date("c");
 
$hashstr = "POST\ntext/xml; charset=utf-8\n" . sha1($request) . "\n" . $hashtime . "\n" . parse_url($location,PHP_URL_PATH);
 
$authstr = base64_encode(hash_hmac("sha1",$hashstr,$hmackey,TRUE));
 
 
 
ini_set("user_agent", "PHP-SOAP/" . PHP_VERSION . "\r\nAuthorization: GGE4_API " . $keyid . ":" . $authstr . "\r\nx-gge4-date: " . $hashtime . "\r\nx-gge4-content-sha1: " . sha1($request));
 
 
 
    return parent::__doRequest($request, $location, $action, $version, $one_way);
 
  }
 
}
 
 
 
class gge4_cc_aim extends SoapClientHMAC {
 
  var $code, $title, $description, $enabled;
 
 
 
// class constructor
 

Share this post


Link to post
Share on other sites

Hello @@MarP

 

My client wants to use payeezy (First Data) and I need your help.

 

I have oscommerce 234BS would you please guid me which module i have to install and what files I need to change.

Also may I ask which host did you change?

 

Thanks for your help

Share this post


Link to post
Share on other sites

I switched to Hostgator. There is only one module and only 1 file you change. If in fact, you do have to change it (you may not have too. The creator of this module says it should work as is but for me it didn't as it didn't for others) and that's the includes/modules/payment/gge4_cc_aim.php file.

Share this post


Link to post
Share on other sites

I switched to Hostgator. There is only one module and only 1 file you change. If in fact, you do have to change it (you may not have too. The creator of this module says it should work as is but for me it didn't as it didn't for others) and that's the includes/modules/payment/gge4_cc_aim.php file.

 

Is it possible you share with me your gge4_cc_aim.php file??

Share this post


Link to post
Share on other sites

I do recall doing some investigation work on this module @@razgre @@MarP - I am pretty sure that this module expects your password to be 16 characters or less.

 

Also there is a potential problem with this (I never got to the bottom of it):

 

if (version_compare(PHP_VERSION, '5.3.11') == -1) {
       ini_set("user_agent", "PHP-SOAP/" . PHP_VERSION . "\r\nAuthorization: GGE4_API " . $keyid . ":" . $authstr . "\r\nx-gge4-date: " . $hashtime . "\r\nx-gge4-content-sha1: " . sha1($request));
   } else {
       stream_context_set_option($context,array("http" => array("header" => "authorization: GGE4_API " . $keyid . ":" . $authstr . "\r\nx-gge4-date: " . $hashtime . "\r\nx-gge4-content-sha1: " . sha1($request))));
   }
   return parent::__doRequest($request, $location, $action, $version, $one_way);
 }
}
Remove it and replace with:

 

ini_set("user_agent", "PHP-SOAP/" . PHP_VERSION . "\r\nAuthorization: GGE4_API " . $keyid . ":" . $authstr . "\r\nx-gge4-date: " . $hashtime . "\r\nx-gge4-content-sha1: " . sha1($request));

This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest Responsive osCommerce CE (community edition) here

Share this post


Link to post
Share on other sites

Actually, I didn't have a problem with the long password, Burt. My password is over 16 characters and the module works. But yes, I did have to remove the code you posted.

Share this post


Link to post
Share on other sites

hello @@fiodh, @@MarP

 

I have changed whatever you suggest to make FirstData module works but I get the same error.

 

Fatal error: Uncaught SoapFault exception: [HTTP] Unauthorized in /home1/******/public_html/***********/includes/modules/payment/gge4_cc_aim.php:47 Stack trace: #0 /home1/******/public_html/***********/includes/modules/payment/gge4_cc_aim.php(47): SoapClient->__doRequest('<?xml version="...', 'https://api.dem...''http://secure2....' 1, 0) #1 [internal function]: SoapClientHMAC->__doRequest('<?xml version="...', 'https://api.dem...' 'http://secure2....' 1, 0) #2 /home1/******/public_html/***********/includes/modules/payment/gge4_cc_aim.php(187): SoapClient->__call('SendAndCommit', Array) #3 /home1/******/public_html/***********/includes/modules/payment/gge4_cc_aim.php(187): SoapClientHMAC->SendAndCommit(Array) #4 /home1/******/public_html/***********/includes/classes/payment.php(181): gge4_cc_aim->before_process() #5 /home1/******/public_html/***********/checkout_process.php(81): payment->before_process() #6 {main} thrown in /home1/******/public_html/***********/includes/modules/payment/gge4_cc_aim.php on line 45

 

line 45 is: return parent::__doRequest($request, $location, $action, $version, $one_way);

 

Please any suggestion? any help?
 

Share this post


Link to post
Share on other sites

Hi Raz,

 

I spoke too soon in my above post but Burt is correct about the password. Try making your password less then 16 characters in your FD demo account and see if that works for you.

Share this post


Link to post
Share on other sites

@@MarP

 

Hi Mark,

 

Thank you for your help. Yes, problem was long password. it works after I made password less that 16 characters.

Share this post


Link to post
Share on other sites

Hey everyone, looking for a payment module for First Data Global Gateway E4? I wrote the following module based on their latest Version 12 API, it is for OsCommerce 2.3 but could easily be adjusted to work in 2.2:

 

First Data Global Gateway e4 AIM

 

In their documentation, First Data put out a hack for the Authorize.net SIM module, which works and is all well and fine for those that do not mind their customers leaving the site, but not so great if you want to keep your customer on your site. There was no way I was going to take customers away from my site, especially with some hacked up module, but no one had written a module with advanced integration for OsCommerce yet...well not until now!

 

This new module keeps everything on your site, I have tested it up down and sideways and cannot find any bugs. The instructions are very in depth so setup will be a breeze. I know there were quite a few people looking for this, hope it helps the community as m

 

Hey everyone, looking for a payment module for First Data Global Gateway E4? I wrote the following module based on their latest Version 12 API, it is for OsCommerce 2.3 but could easily be adjusted to work in 2.2:

 

First Data Global Gateway e4 AIM

 

In their documentation, First Data put out a hack for the Authorize.net SIM module, which works and is all well and fine for those that do not mind their customers leaving the site, but not so great if you want to keep your customer on your site. There was no way I was going to take customers away from my site, especially with some hacked up module, but no one had written a module with advanced integration for OsCommerce yet...well not until now!

 

This new module keeps everything on your site, I have tested it up down and sideways and cannot find any bugs. The instructions are very in depth so setup will be a breeze. I know there were quite a few people looking for this, hope it helps the community as much as the community has helped me.

 

Problems? Message me or post here! :D

 

After installation, the payment page does not show the Credit Card word for customer to choose, there is nothing above the below payment choice, e.g. Paypal Express Checkout.

Any advice how to fix this? please email: florlando@126.com, thank you

 

   

 

 

 

 

 

 

 

uch as the community has helped me.

 

Problems? Message me or post here! :D

Share this post


Link to post
Share on other sites

After installation, Payment Method does not show the Credit Card word for customer to choose, but a little round checkbox only. there is nothing else showing Credit Card above the payment choice, e.g. Paypal Express Checkout.

Any advice how to fix this? please email: florlando@126.com, thank you

Share this post


Link to post
Share on other sites

Hey everyone, looking for a payment module for First Data Global Gateway E4? I wrote the following module based on their latest Version 12 API, it is for OsCommerce 2.3 but could easily be adjusted to work in 2.2:

 

First Data Global Gateway e4 AIM

 

In their documentation, First Data put out a hack for the Authorize.net SIM module, which works and is all well and fine for those that do not mind their customers leaving the site, but not so great if you want to keep your customer on your site. There was no way I was going to take customers away from my site, especially with some hacked up module, but no one had written a module with advanced integration for OsCommerce yet...well not until now!

 

This new module keeps everything on your site, I have tested it up down and sideways and cannot find any bugs. The instructions are very in depth so setup will be a breeze. I know there were quite a few people looking for this, hope it helps the community as much as the community has helped me.

 

Problems? Message me or post here! :D

This payment module does show up in the list, but payment checkout process does not seem to work. first on the select payment: the word Credit Card does not display to customer, 2nd, whenever the confirmation is clicked, it goes to the error page, is it the issue that happened to me ONLY?

Share this post


Link to post
Share on other sites

I have just installed this module and am getting the following error:

Warning: stream_context_set_option(): called with wrong number or type of parameters; please RTM in /homepages/17/********/htdocs/includes/modules/payment/gge4_cc_aim.php on line 43

Fatal error: Uncaught SoapFault exception: [HTTP] Unauthorized in /homepages/17/******/htdocs/includes/modules/payment/gge4_cc_aim.php:45 Stack trace: #0 /homepages/17/********/htdocs/includes/modules/payment/gge4_cc_aim.php(45): SoapClient->__doRequest('<?xml version="...', 'https://api.glo...', 'http://secure2....', 1, 0) #1 [internal function]: SoapClientHMAC->__doRequest('<?xml version="...', 'https://api.glo...', 'http://secure2....', 1, 0) #2 /homepages/17/*********/htdocs/includes/modules/payment/gge4_cc_aim.php(185): SoapClient->__call('SendAndCommit', Array) #3 /homepages/17/*******/htdocs/includes/modules/payment/gge4_cc_aim.php(185): SoapClientHMAC->SendAndCommit(Array) #4 /homepages/17/*******/htdocs/includes/classes/payment.php(181): gge4_cc_aim->before_process() #5 /homepages/17/*******/htdocs/checkout_process.php(81): payment->before_process() #6 {main} thrown in /homepages/17/*******/htdocs/includes/modules/payment/gge4_cc_aim.php on line 45

 

I reduced the p/w length to 14

Any help is much appreciated.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×