|
|
|
|
|
|
|
|
 |
|
Interface X2. Sending Funds from One Purse to Another
Only registered members are permitted to use this interface. If you wish to register and get access to this interface, please send information on your online project, your IP and URL of your website, and purpose for use of this interface to WM-ID 941977853154 (technical support) via WM Keeper messenger. In addition, you have to receive a personal WM passport.
| Requests using WM Keeper Classic key authorization should be sent to: |
https://w3s.webmoney.ru/asp/XMLTrans.asp |
| Requests using WM Keeper Light certificate authorization should be sent to: |
https://w3s.wmtransfer.com/asp/XMLTransCert.asp |
| Method |
POST |
| Request format |
|
| Request properties |
| name |
purpose |
description |
| reqn |
Request number |
An integer, maximum 15 digits. It should always be larger than the number of previous request submitted |
| wmid |
Signer's WM-ID |
Is used for WM Keeper Classic authorization |
| sign |
Request's signature Uses the following parameters: reqn + tranid + pursesrc + pursedest + amount +period + pcode + desc + wminvid |
Is used for WM Keeper Classic authorization |
| trans |
Transaction data |
|
| trans\tranid |
Transaction number |
Transaction number set by the sender; an integer; it should be unique for each trasaction (the same tranid should not be used for two transactions) |
| trans\pursesrc |
Sender's purse number |
|
| trans\pursedesc |
Recipient's purse number |
|
| trans\amount |
Amount |
A floating-point number, for example, 10.5; 9; 7.36 |
| trans\period |
Protection period in days |
An integer in the range: 0 - 255; zero means that no protection should be used |
| trans\pcode |
Protection code |
In the range 0 - 255 characters; without spaces in the beginning and in the end |
| trans\desc |
Description of product or service |
In the range 0 - 255 characters; without spaces in the beginning and in the end |
| trans\wminvid |
Invoice number (in the WebMoney system) |
An integer > 0; 0 means that transfer is made without invoice |
| Response properties |
| name |
purpose |
description |
| reqn |
Request number |
|
| retval |
Execution code |
0 means that the request was executed all the rest codes are described below |
| retdesc |
Code interpretation |
|
| operation |
Transaction attributes |
id defines a unique number of a transaction in the WebMoney System ts defines a service number of a transaction in the WebMoney System
|
| operation\tranid |
Transaction number |
Serial transaction number set by the sender; an integer; it should be unique for each trasaction (the same tranid should not be used for two transactions) |
| operation\pursesrc |
Sender's purse number |
|
| operation\pursedesc |
Recipient's purse number |
|
| operation\amount |
Amount |
A floating-point number, for example, 10.5; 9; 7.36 |
| operation\comiss |
Fee charged |
A floating-point number, for example, 10.5; 9; 7.36 |
| operation\opertype |
Transfer type |
0 - simple4 - code-protected |
| operation\period |
Protection period in days |
An integer in the range: 0 - 255; zero means that transfer is simple |
| operation\wminvid |
Invoice number (in the WebMoney system) |
An integer > 0; 0 means that transfer is made without invoice |
| operation\orderid |
Serial invoice number set by the store |
An integer > 0; 0 means that transfer is made without invoice |
| operation\desc |
Description of product or service |
|
| operation\datecrt |
Date and time of transaction |
|
| operation\dateupd |
Date and time of transaction status change |
|
| Execution code |
| Code |
Description |
| -100 |
General error. Bad command format |
| -1 |
Incorrect value of w3s.request/reqn |
| -2 |
Incorrect value of w3s.request/sign |
| -3 |
Incorrect value of w3s.request/trans/tranid |
| -4 |
Incorrect value of w3s.request/trans/pursesrc |
| -5 |
Incorrect value of w3s.request/trans/pursedest |
| -6 |
Incorrect value of w3s.request/trans/amount |
| -7 |
Incorrect value of w3s.request/trans/desc |
| -8 |
Field w3s.request/trans/pcode is too long |
| -9 |
w3s.request/trans/pcode is required if the value of w3s.request/trans/period > 0 |
| -10 |
w3s.request/trans/pcode should be omitted if w3s.request/trans/period = 0 |
| -11 |
Incorrect value of w3s.request/trans/wminvid |
| -12 |
WM-ID passed in the w3s.request/wmid field was not found |
| -14 |
Signature verification failed |
| -15 |
Incorrect value of w3s.request/wmid |
| 102 |
Each new value of w3s.request/reqn must be larger than the previous one |
| 103 |
This value of w3s.request/trans/tranid has already been used |
| 110 |
Access denied |
| 4, 15, 19, 23 |
Internal error |
| 5 |
Sender's WM-ID was not found |
| 7 |
Recipient's purse was not found |
| 11 |
Sender's purse was not found |
| 13 |
Amount should be > 0 |
| 17 |
Insufficient amount of funds in the purse |
| 21 |
The invoice for this transaction was not found |
| 22 |
Code-protected transfer is not possible |
| 25 |
The invoice validity period expired |
| 26 |
Different purses should be used for this operation |
| 29 |
Types of purses are different |
| 30 |
Purse does not support direct transfers |
Sample (IIS, ASP, JScript, MSXML)<%@ Language=JScript %>
<%
try
{
var AuthorizeType = 'light' // 'classic'
var url;
if ('classic'== AuthorizeType)
url = 'https://w3s.webmoney.ru/asp/XMLTrans.asp'
else
url = 'https://w3s.wmtransfer.com/asp/XMLTransCert.asp'
var pursesrc = 'R111111111111'
var pursedest = 'R222222222222'
var tranid = 89
var wminvid = 0
var amount = 1.0
var desc = 'product'
var period = 0
var pcode = ''
var reqwmid = '111111111111'
var signstr // only for 'classic'
var reqn = (new Date()).valueOf()
if ('classic'== AuthorizeType)
{
var planstr = '' + reqn
+ tranid
+ pursesrc
+ pursedest
+ amount
+ period
+ pcode
+ desc
+ wminvid
var reqwmpwd = 'password'
var reqwmfilename = 'c:\\wmkeeperclassickeyfile.kwm'
var Signer = Server.CreateObject("WMSignerX.Signer")
Signer.Login = reqwmid
Signer.Passwd = reqwmpwd
Signer.KeyFName = reqwmfilename
signstr = Signer.SignString(planstr)
}
var s = ''
s += ''+reqn+''
if ('classic' == AuthorizeType)
{
s += ''+reqwmid+''
s += ''+signstr+''
}
s += ''
s += ' '+tranid+''
s += ' '+pursesrc+''
s += ' '+pursedest+''
s += ' '+amount+''
s += ' '+desc+''
s += ' '+pcode+''
s += ' '+period+''
s += ' '+wminvid+''
s += ''
s += ''
var xmlhttp = Server.CreateObject ("MSXML2.ServerXMLHTTP");
if ('light' == AuthorizeType)
{
xmlhttp.setOption(3, 'WM id: '+reqwmid)
}
xmlhttp.open('POST', url, false);
xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlhttp.send(s);
var texttes = xmlhttp.responseText;
// Response.Write(texttes) //
var xmlres = Server.CreateObject ('Microsoft.XMLDOM');
xmlres.loadXML(texttes);
var retcode = -1
var Node = xmlres.selectSingleNode("w3s.response/retval")
if (null!=Node)
retcode = parseInt(Node.text)
if (0==retcode)
{
// successful
}
}
catch(e)
{
Response.Write('error:'+(new Number(e.number)).toString(16)+' \r\n')
Response.Write('desc:'+e.description+'\r\n')
}
%>
|
 |
|
|
|
|
|
|
|
|
|
|
|
|
|