News:

Looking for documentation? Take a look on our wiki

Main Menu

VM3 upgrade payment plugin does not load parameters

Started by leahshanz, September 23, 2016, 08:42:22 AM

Previous topic - Next topic

leahshanz

Hi all
I have just upgraded a payment plugin from VM2 to VM 3 following the instructions provided by VM. There were only minor changes. I installed the plugin and everything looks good so far. When i update the configuration parameters (select the plugin, save it and then click configuration) i do not see the updated parameters. I checked the database table virtumart_paymentmethods and the parameters (varsToPush) are there they just do not load in the backend, in other words  it only loads the default values from the constructor.

The old site (J25/VM2) it works so i figure its something to do with the VM3 version loading the plugin parameters. The field in the table that stores  the varsToPush is 'payment_params' i could not find customfield_params as documented (not sure if this is relevant) however payment_params does store the data when i make a change, i just cant see it in the BE after save.

Any ideas why this would be happening, i have spent the last few days trying to solve it. I am not an expert on VM plugins so any help is appreciated.

Thanks in advance for any help


Below is the first part of the file

defined ('_JEXEC') or die('Restricted access');
if (!class_exists ('vmPSPlugin')) {
   require(JPATH_VM_PLUGINS . DS . 'vmpsplugin.php');
}


class plgVmpaymentOncefinance extends vmPSPlugin {
function __construct (& $subject, $config) {

      parent::__construct ($subject, $config);
      
      $jlang = JFactory::getLanguage ();
      $jlang->load ('plg_vmpayment_oncefinance', JPATH_ADMINISTRATOR, NULL, TRUE);
      $this->_loggable = TRUE;
      $this->_debug = TRUE;
      $this->tableFields = array_keys ($this->getTableSQLFields ());
      $this->_tablepkey = 'id';
      $this->_tableId = 'id';

      $varsToPush (my vars here )

      if(!defined('VM_VERSION') or VM_VERSION < 3){
        $this->setConfigParameterable ('custom_params', $varsToPush);
      } else {
        $this->setConfigParameterable ($this->_configTableFieldName, $varsToPush);
      }
}
   //added new triggers
   function plgVmDeclarePluginParamsCustomVM3(&$data){
     return $this->declarePluginParams('custom', $data);
   }
   function plgVmGetTablePluginParams($psType, $name, $id, &$xParams, &$varsToPush){
     return $this->getTablePluginParams($psType, $name, $id, $xParams, $varsToPush);
   }
   public function getVmPluginCreateTableSQL () {

      return $this->createTableSQL ('Payment Once Finance Table');
   }



GJC Web Design

the new trigger should be

function plgVmDeclarePluginParamsPaymentVM3( &$data) {
      return $this->declarePluginParams('payment', $data);
   }
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

leahshanz

Thank you I am very grateful, fixed the problem. I never would have figured that out

GJC Web Design

Use the current bundled payment plugs as your guide.. pick a simple one like authorize
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