Step 2: Here we add code to Virtuemart as an example.
First, please insert the code to administrator/com_virtuemart/classes/ps_checkout.php, around line 965, calling UserAddMoney function. So it will add credit to user account at DRM-X.com after customer done payment online.
Here is the sample code:
In the virtuemart folder:
require_once('nusoap.php'

;
$drm_wsdl="
http://www.drm-x.com/haihaisoftlicenseservice.asmx?wsdl";
$drm_AdminEmail="
info@ezitunes.com";
$drm_WebServiceAuthStr="123456";
$drm_Money="33.45";
$drm_client=new soapclient2($wsdl, 'wsdl'

;
$drm_client->soap_defencoding = 'UTF-8';
$drm_client->decode_utf8 = false;
$drm_param = array(
'AdminEmail' => $drm_AdminEmail,
'WebServiceAuthStr' => $drm_WebServiceAuthStr,
'Money' => $drm_Money,
'UserEmail' => $my->email
);
$drm_result = $drm_client->call('UserAddMoney', array('parameters' => $drm_param), '', '', true, true);
$license= $drm_result['UserAddMoneyResult'];
// echo "License:" . $license;