Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

First Data Global Gateway e4 AIM - New Module release


Guest

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
Link to comment
Share on other sites

  • Replies 54
  • Created
  • Last Reply

Top Posters In This Topic

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
Link to comment
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

Link to comment
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?

Link to comment
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
Link to comment
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.

Link to comment
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
Link to comment
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
Link to comment
Share on other sites

  • 1 month later...

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
 
Link to comment
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

Link to comment
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.

Link to comment
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??

Link to comment
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));
Link to comment
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?
 

Link to comment
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.

Link to comment
Share on other sites

  • 3 months later...

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: [email protected], thank you

 

   

 

 

 

 

 

 

 

uch as the community has helped me.

 

Problems? Message me or post here! :D

Link to comment
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: [email protected], thank you

Link to comment
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?

Link to comment
Share on other sites

  • 9 months later...

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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...