Author Topic: CardGate plugin - Callback response not working  (Read 345 times)

EIF

  • Jr. Member
  • **
  • Posts: 89
CardGate plugin - Callback response not working
« on: June 08, 2021, 23:44:52 pm »
I am trying to use a new payment provider CardGate. The have a plugin for virtuemart. I have installed their plugin and I am able to test some payments, simulation payments.

But when I try to test the callback, there is no callback response received. So Virtuemart is not getting a signal to change the order. it doens't know it is a succes, failure, cancel, etc.

Cardgate says their plugin works, but at my webshops (tried 2 different ones) I can't get it to work. Cardgate are not willing to help me. They say it is wrong at my side.

But I have no clue what could be wrong. I have disabled most of my plugins, tested on a old virtuemart version and the most recent one. Checked the rights of the folders and files, but no succes.

The only thing the say, it could be wrong in the callback proces, which is the following code:

Code: [Select]
protected function _process_callback() {


defined( 'DS' ) or define( 'DS', DIRECTORY_SEPARATOR );

if ( !class_exists( 'VmConfig' ) ) {
require(VMPATH_ADMIN .DS. 'helpers' . DS . 'config.php');
}

if ( !class_exists( 'vmPSPlugin' ) ) {
require(VMPATH_ADMIN .DS.'plugins'.DS.'vmpsplugin.php');
}

if ( !class_exists( 'VirtueMartCart' ) ) {
require(VMPATH_SITE . DS . 'helpers' . DS . 'cart.php');
}

if ( !class_exists( 'VirtueMartModelOrders' ) ) {
require( VMPATH_SITE. DS . 'models' . DS . 'orders.php' );
}

JPluginHelper::importPlugin( 'vmpayment' );

$dispatcher = JEventDispatcher::getInstance();

$returnValues = $dispatcher->trigger( 'plgVmOnCgpCallback', array( $_POST ) );

return $_POST['transaction_id'] . "." . $_POST['status'];
}

But I don't have a clue what could be wrong.

Can someone help me to figure this out?

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3535
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: CardGate plugin - Callback response not working
« Reply #1 on: June 09, 2021, 09:26:17 am »
What VM version has cardgate used for development?

Jörgen
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

EIF

  • Jr. Member
  • **
  • Posts: 89
Re: CardGate plugin - Callback response not working
« Reply #2 on: June 09, 2021, 09:46:10 am »
I am not sure for, but they say their plugin works with Joomla 3.9.23 and Virtuemart 3.8.8. I tried older version and the latest versions: 3.9.27 with 3.8.8.


Do you think there is a compatibilty issue?

EIF

  • Jr. Member
  • **
  • Posts: 89
Re: CardGate plugin - Callback response not working
« Reply #3 on: June 09, 2021, 16:50:42 pm »
I have installed the plugin on a different domain, but with the same extensions, same plugin, same servers and even the samen versions.

With this domain it works, but on the other not.

When looking in the server log I see a 500 error: 500   POST /index.php?option=com_cgp&task=callback HTTP/1.0
That url is correct, that is the callback url.

But why it doesn't work here, but does work on the other domain.

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10173
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: CardGate plugin - Callback response not working
« Reply #4 on: June 09, 2021, 22:04:44 pm »
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

EIF

  • Jr. Member
  • **
  • Posts: 89
Re: CardGate plugin - Callback response not working
« Reply #5 on: June 09, 2021, 22:48:10 pm »
Thank you for the link.

The server log files doesn't say much. But I have turned the error reporting to maximum.

Now I see a more detailed error for the callback response. Its says:

Quote
Fatal error: Declaration of TableUsergroups::check($nrOfValues) must be compatible with VmTable::check() in /var/www/vhosts/mydomain.com/domains/mydomain.coml/public_html/administrator/components/com_virtuemart/tables/usergroups.php on line 60

Strangly, my other domain with a virtuemart installation doesn't have this php file. Anyone have an idea why that is? What is this file for?

Do anyone understand what this error means and how I can fix this?

EDIT: When I remove this "usergroups.php" file, the callback receives a response, so it is working now. BUT... can I just remove this file? Where is it for? Does it break something else now?


jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28147
  • Always on vacation
    • Jenkin Hill Internet
Re: CardGate plugin - Callback response not working
« Reply #6 on: June 10, 2021, 11:24:33 am »
My VM 3.8.x installations do not have administrator/components/com_virtuemart/tables/usergroups.php but it was present in VM2. Is this a site that has been updated from very old versions?

Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart 3.8.9.10473 on Joomla 3.9.24 PHP 7.4.14

EIF

  • Jr. Member
  • **
  • Posts: 89
Re: CardGate plugin - Callback response not working
« Reply #7 on: June 10, 2021, 14:43:04 pm »
Actually it does, a long time ago.

I am not sure if other files and scripts are related to this usergroups.php file. In other words: I don't know if I break something else when deleting it.

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10173
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: CardGate plugin - Callback response not working
« Reply #8 on: June 10, 2021, 15:56:30 pm »
its not even in com_virtuemart.2.0.26 so IMHO safe to delete  -- last appears in com_virtuemart.2.0.24
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

EIF

  • Jr. Member
  • **
  • Posts: 89
Re: CardGate plugin - Callback response not working
« Reply #9 on: June 14, 2021, 16:53:28 pm »
That is very old. I've checked the file itself and the first comment copyright tags reffers to year 2010. Hmmzz... very old.

I have deleted the file, which also excists in 3 other folders. Also removed the reference to it from the script.php.