News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

CardGate plugin - Callback response not working

Started by EIF, June 08, 2021, 23:44:52 PM

Previous topic - Next topic

EIF

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:

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

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

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

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

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

EIF

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:

QuoteFatal 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

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
Lowestoft, Suffolk, UK

Retired from forum life November 2023

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

EIF

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

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 https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

EIF

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.