Integrate with DRM-X - Add Money to DRM-X Users PHP Guide (Call UserAddMoney function)


DRM-X XML Web service provides the interface you can add money through your website by calling UserAddMoney function.

It is usually calling the UserAddMoney function in Shopping cart after customer pay you online.

Here we show you an example, how it works with the popular shopping cart Virtuemart in Joomla.

The UserAddMoney function needs the following parameters:

You can visit the standard DRM-X Web service from here:

The following parameter,blue text is required field. For not require black field, you can set "N/A" (means empty) or with the correct value.

AdminEmail. AdminEmail is your login Email of DRM-X Account.
WebServiceAuthStr. WebServiceAuthStr is the Web Service Authenticate String for DRM-X web service. You can set this value in Profile - Website Integration Preferences of your DRM-X Account.
UserEmail. UserEmail is the Email of user in your user database. UserEmail is for identify users at So you have to make sure the UserEmail in your website matches the UserEmail on
Money Money is the add money amount of user at 

After you call UserAddMoney function, it will return 1 (means add new user successfully) or return error message to you.


Step 1: The web service URL is :

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 after customer done payment online.

Here is the sample code:

        * Insert the Order payment info


       $client=new soapclient2($wsdl, 'wsdl');
       $client->soap_defencoding = 'UTF-8';
       $client->decode_utf8 = false;
       $param = array(
          'AdminEmail' =>  $AdminEmail,
          'WebServiceAuthStr' => $WebServiceAuthStr,
          'Money' => $Money,
          'UserEmail' =>  $my->email       
      $result = $client->call('UserAddMoney', array('parameters' => $param), '', '', true, true);
      $license= $result['UserAddMoneyResult'];
        echo "License:" . $license;

Step 3: Run your Virtuemart.  Make sure you set the WebServiceAuthStr Web Service Authenticate String at Profile - Website Integration Preferences of your DRM-X account. If it returns Message to 1, it means money added to user successfully. If it fails, please check the returned message and all the parameters, and try again.

nusoap.php class. Please download it from here:  (rename the file name to php when you use the code)

To integrate with Joomla 1.5.x, you don't need to write code. Haihaisoft provides the Haihaisoft DRM-X Plugin For Joomla.  You can download it from here:

For Virtuemart, you will need to insert code manually.

If you have any questions about this article, please feel free to contact us.

Was this information helpful?

You may also be interested in...

Integrate with DRM-X - Custom Login Page Integration VB Guide (Call getLicenseRemote function)

Integrate with DRM-X - Custom Login Page Integration PHP Guide (Call getLicenseRemote function)

What is .hup files?

Disable User Account Control (UAC) the Easy Way on Windows Vista or Windows 7

Haihaisoft Universal Player

Ask about Haihaisoft products, pricing, implementation, or anything else — our highly trained reps are standing by, ready to help.