VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: kaya on December 16, 2016, 11:35:34 AM

Title: problem validate the payment
Post by: kaya on December 16, 2016, 11:35:34 AM
Hi dear
I'm using 2 payment plugin in my site for example plugin A and plugin B and my problem this is in my site when use each plugin only validate with plugin  A
if using plugin B validate with plugin A too. what is problem? why not working selected user plugin when validate?
Title: Re: problem validate the payment
Post by: Jörgen on December 16, 2016, 11:49:35 AM
Hello

Try to make a better description of Your problem and
http://forum.virtuemart.net/index.php?topic=79799.0 (http://forum.virtuemart.net/index.php?topic=79799.0)

regards

Jörgen @ Kreativ Fotografi
Title: Re: problem validate the payment
Post by: kaya on December 16, 2016, 13:15:06 PM
we use virtuemart version: 3.0.18 and joomla 3.6.4
when user select a payment method not have problem and go to the bank but when callback from bank only get data from plugin A payment and not working user selected payment method
Title: Re: problem validate the payment
Post by: GJC Web Design on December 16, 2016, 13:53:57 PM
Are these core payment plugins?
If 3rd party only the dev can help u - prob wrongly coded confirm function

If not then far more info is needed
Title: Re: problem validate the payment
Post by: kaya on December 16, 2016, 19:24:44 PM
It's custom payment plugin and this is my callback url

$callBackUrl = JURI::root() . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component'.'&lang='.  vRequest::getCmd('lang','');

and in this method plgVmOnPaymentNotification only back in plugin A and not work user selected payment
Title: Re: problem validate the payment
Post by: kaya on December 16, 2016, 23:46:48 PM
I'm solved my problem I think it's virtuemart bug and vituemart not check selected payment plugin in plgVmOnPaymentNotification I'm checked it and return if payment method is not user selected payment method. I don't see this code in any virtuemart core payment plugins.
Title: Re: problem validate the payment
Post by: GJC Web Design on December 17, 2016, 10:54:43 AM
your supposed to send back the payment method id  &pm=x

$virtuemart_paymentmethod_id = vRequest::getInt('pm', 0);
      $this->_currentMethod = $this->getVmPluginMethod($virtuemart_paymentmethod_id);
      if (!$this->selectedThisElement($this->_currentMethod->payment_element)) {
         return;
      }