Forums / Addon Payment Modules / Bridgeway Pay/GPS Payment module

Bridgeway Pay/GPS Payment module

Views: 5,774

Results 1 to 8 of 8
23 Jun 2016, 4:14 PM
#1
gwynwyffar avatar

gwynwyffar

New Zenner

Join Date:
Dec 2006
Location:
Hudson Valley, New York USA
Posts:
93
Plugin Contributions:
0

Bridgeway Pay/GPS Payment module

Our bank recently transferred us to using Bridgeway Pay as our payment gateway and Bridgeway has their own Zen Cart payment module plugin. It seems we are able to process transactions successfully but I've received several debug logs with the following error:

 PHP Warning:  Creating default object from empty value in /xxx/catalog/includes/modules/payment/gps.php on line 627

Lines 624-630 of the reference file contain this function:

  function admin_notification($zf_order_id) {
    global $db;
    $output = '';
    $aimdata->fields = array();
    require(DIR_FS_CATALOG . DIR_WS_LANGUAGES . 'english/modules/payment/gps_admin_notification.php');
    return $output;
  }

Bridgeway Pay integration states that the problem lies with Zen Cart and not their plugin. Any insight into what the problem is and what the possible solution is would be appreciated.

23 Jun 2016, 5:47 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Bridgeway Pay/GPS Payment module

The error message is very similar to errors that happen when the site is using a newer version of PHP than what the module was designed for.

Judging from the code you posted, they've built a clone of the Authorize.net module. And in recent versions of Zen Cart that segment of code was updated for compatibility with newer PHP versions. So their module should also get updated.
The change to deal with that isolated error is shown on line 494 as highlighted here: https://github.com/zencart/zencart/blob/v155/includes/modules/payment/authorizenet_aim.php#L494

There might be other changes they should make too.

But, the problem is indeed in their plugin module, and not in Zen Cart itself.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

23 Jun 2016, 6:35 PM
#3
gwynwyffar avatar

gwynwyffar

New Zenner

Join Date:
Dec 2006
Location:
Hudson Valley, New York USA
Posts:
93
Plugin Contributions:
0

Re: Bridgeway Pay/GPS Payment module

Thank you! I believe you are correct, their system is set up to work on the Authorize.net AIM system so they probably cloned that payment module. I made the correction you provided and notified them of the need to update their plugin.

30 Jun 2016, 2:27 PM
#4
gwynwyffar avatar

gwynwyffar

New Zenner

Join Date:
Dec 2006
Location:
Hudson Valley, New York USA
Posts:
93
Plugin Contributions:
0

Re: Bridgeway Pay/GPS Payment module

You were so helpful last time, maybe you can help me with this one. I received this debug log this morning:

[29-Jun-2016 18:08:17 America/New_York] PHP Fatal error:  Uncaught  exception 'Exception' with message 'String could not be parsed as XML'  in /usr/www/users/xxx/catalog/includes/modules/payment/gps.php:298
Stack trace:
#0 /usr/www/users/xxx/catalog/includes/modules/payment/gps.php(298): SimpleXMLElement->__construct('')
#1 /usr/www/users/xxx/catalog/includes/modules/payment/gps.php(150): gps->get_post_url()
#2 /usr/www/users/xxx/catalog//includes/classes/payment.php(146): gps->javascript_validation()
#3 /usr/www/users/xxx/catalog/includes/templates/exodus/templates/tpl_checkout_payment_default.php(15):  payment->javascript_validation()
#4  /usr/www/users/xxx/catalog/includes/templates/exodus/common/tpl_main_page.php(151):  require(/usr/www/users/...')
#5 /usr/www/users/xxx/catalog/index.php(97): require('/usr/www/users/...')
#6 {main}
  thrown in /usr/www/users/xxx/catalog/includes/modules/payment/gps.php on line 298

Line 298 is ```
$gwResponse = @new SimpleXMLElement($response);

    $xmlRequest->appendChild($xmlSale);

    unset($response);
    $response = $this->_makeRequest($xmlRequest);

    $gwResponse = @new SimpleXMLElement($response);
    if((string)$gwResponse->result == 1) {
        $formURL = $gwResponse->{'form-url'};
        $_SESSION['trans_id'] = (string)$gwResponse->{'transaction-id'};
    } else {
        print('<h2 style="color:red;">' . htmlentities((string)$gwResponse->{'result-text'}, ENT_COMPAT, "UTF-8") . ': </h2>');
        print('<h3 style="color:red;"> Please fix account information.</h3>');
    }
    return $formURL;
}

I've gone back and forth with Bridgeway pay and basically they tell me, this is the module they have and when they will get around to updating it is unknown.  In the meantime, the bank we use insists that Bridgeway is their new payment provider so I have no choice but to try to make this work.  

I've attached the full gps.php file for you in case I didn't provide enough code above.  Any and all assistance is GREATLY appreciated!
[Attachment no longer available]
30 Jun 2016, 4:50 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Bridgeway Pay/GPS Payment module

To figure out why "can't be parsed as XML" you'll need to find out what's in $response and probably also in $xmlRequest, probably by doing some logging. I suspect something's encountering incoming data in a bad format but then doesn't fix it before trying to transmit the bad data.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

30 Jun 2016, 5:02 PM
#6
gwynwyffar avatar

gwynwyffar

New Zenner

Join Date:
Dec 2006
Location:
Hudson Valley, New York USA
Posts:
93
Plugin Contributions:
0

Re: Bridgeway Pay/GPS Payment module

As we've processed plenty of payments without this error previously, I wonder if it's possible that a customer was a bad typist and used some strange character in their name or address and that threw the error. I've informed Bridgeway as I don't know if I'm competent enough to set up the logging to gather the data on my own. Thanks for the insight Dr. Byte!

5 Jul 2016, 2:19 PM
#7
gwynwyffar avatar

gwynwyffar

New Zenner

Join Date:
Dec 2006
Location:
Hudson Valley, New York USA
Posts:
93
Plugin Contributions:
0

Re: Bridgeway Pay/GPS Payment module

Here's another one:

PHP Warning:  DOMElement::__construct(): unterminated entity reference Mark in /usr/www/users/xxx/xxx/catalog/includes/modules/payment/gps.php on line 229

The referenced line is within this function:

function appendXmlNode($parent, $name, $value) {
          unset($tmp);
          $tmp = new DOMElement($name, $value);
          $parent->appendChild($tmp);
    }
27 Nov 2019, 5:18 PM
#8
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,721
Plugin Contributions:
56

Re: Bridgeway Pay/GPS Payment module

I just posted an update to the GPS integration.

https://www.zen-cart.com/downloads.php?do=file&id=2265

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.