News:

Support the VirtueMart project and become a member

Main Menu

[VM3] Using custom code after payment callback

Started by Cameleon, October 28, 2016, 14:50:42 PM

Previous topic - Next topic

Cameleon

Greetings,

I'm currently rebuilding an old website running Virtuemart 1.1.7 to a brand new with virtuemart 3.

This website use some custom code who create an XML file every time an order is paid (for an external software).

Currently we use this code in :

/administrator/components/com_virtuemart/notify.php
/administrator/components/com_virtuemart/html/checkout.cmcic_cgi2.php

Here is an exemple :
Quotecase "paiement":
   [...]
   if($dbo->next_record()){
       if($dbo->f('order_status')=='A'){
         require_once(CLASSPATH.'SAP_XML/handleXML.php');
         $handleXml= new handleXML('sap'.$dbo->f('order_id').'.xml', $dbo->f('user_id'),$dbo->f('order_id'));
         $handleXml->save();
       }
   }
   break;
   default:
   require_once(CLASSPATH.'ps_checkout.php');
   $ps_checkout= new ps_checkout();
   $ps_checkout->email_receipt_vendor($d['order_id']);
   break;

But these files doesn't exist anymore in VM3. And i don't know where are their equivalent.

Where can i add my custom code when a payment is succesful then ?

Regards,

Bruno


kishoreonwork

Hello Bruno,

You need to look at the code in virtuemart payment plugin. The function  "plgVmConfirmedOrder" is triggered to make a order.
Virtuemart payment plugins are stored in  plugins\vmpayment\ folder.

Mostly at the end of this function you need to insert your code based on the payment status.


Thanks
Kishore
I am available for paid joomla and virtuemart consulting.
http://www.kishoreweblabs.com/
skype kishore2607

Cameleon