|
|
|
|
|
|
|
|
 |
|
Interface X1. Sending Invoices from the Seller's WMID to the Customer's WMID.
| Requests using WM Keeper Classic key authorization should be sent to: |
https://w3s.webmoney.ru/asp/XMLInvoice.asp |
| Requests using WM Keeper Light certificate authorization should be sent to: |
https://w3s.wmtransfer.com/asp/XMLInvoiceCert.asp |
| Method |
POST |
| Request format |
|
| 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: orderid + customerwmid + storepurse + amount + desc + address + period + expiration + reqn |
Is used for WM Keeper Classic authorization |
| invoice |
Invoice attributes |
|
| invoice\orderid |
Invoice serial number |
Should be set by the store. An integer |
| invoice\customerwmid |
Customer's WM-ID |
|
| invoice\storepurse |
Number of the purse where funds will be sent to |
|
| invoice\amount |
Amount that the customer is to pay |
A floating-point number, for example, 10.5; 9; 7.36 |
| invoice\desc |
Description of product or service |
In the range 0 - 255 characters; without spaces in the beginning and in the end |
| invoice\address |
Delivery address |
In the range 0 - 255 characters; without spaces in the beginning and in the end |
| invoice\period |
Maximum period of protection in days |
An integer in the range: 0 - 255; zero means that no protection should be used |
| invoice\expiration |
Maximum valid period in days |
An integer in the range: 0 - 255; zero means that the valid period is not defined |
| properties |
| name |
purpose |
description |
| reqn |
Request number |
|
| retval |
Execution code |
Zero means that the request was executed |
| retdesc |
Code interpretation |
|
| invoice |
Invoice's attributes |
id defines a unique number of a invoice in the WebMoney system ts defines a service number of a invoice in the WebMoney system
|
| invoice\orderid |
Invoice number |
Serial invoice number set by the Merchant; a 32-bit integer |
| invoice\customerwmid |
Customer's WM-ID |
|
| invoice\storepurse |
Number of the purse where funds will be sent to |
|
| invoice\amount |
Amount that the customer is to pay |
A floating-point number, for example, 10.5; 9; 7.36 |
| invoice\desc |
Description of product or service |
In the range 0 - 255 characters; without spaces in the beginning and in the end;
WIN-1251 encoding is to be used for all text fields. |
| invoice\address |
Delivery address |
In the range 0 - 255 characters; without spaces in the beginning and in the end |
| invoice\period |
Maximum period of protection in days |
An integer in the range: 0 - 255; zero means that no protection should be used |
| invoice\expiration |
Maximum valid period in days |
An integer in the range: 0 - 255; zero means that the valid period is not defined |
| invoice\state |
Status |
0 - unpaid 1 - paid with protection 2 - paid 3 - rejected |
| invoice\datecrt |
Date and time of the invoice creation |
YYYYMMDD HH:MM:SS |
| invoice\dateupd |
Date and time of the invoice status change |
YYYYMMDD HH:MM:SS |
Sample (IIS, ASP, JScript, MSXML)<%@ Language=JScript %>
<%
try
{
var AuthorizeType = 'light' // 'classic'
if ('classic'== AuthorizeType)
url = 'https://w3s.webmoney.ru/asp/XMLInvoice.asp'
else
url = 'https://w3s.wmtransfer.com/asp/XMLInvoiceCert.asp'
var storepurse = 'Z111111111111'
var customerwmid = '222222222222'
var orderid = 1
var amount = 1.0
var desc = 'product'
var address = 'http://www.com'
var period = 0
var expiration = 1
var reqwmid = '111111111111'
var signstr // only for 'classic'
var reqn = (new Date()).valueOf()
if ('classic'== AuthorizeType)
{
var planstr = '' + orderid
+ customerwmid
+ storepurse
+ amount
+ desc
+ address
+ period
+ expiration
+ reqn
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 += ' '+orderid+''
s += ' '+customerwmid+''
s += ' '+storepurse+''
s += ' '+amount+''
s += ' '+desc+''
s += ' '+address+''
s += ' '+period+''
s += ' '+expiration+''
s += ''
s += ''
var xmlhttp = Server.CreateObject ("MSXML2.ServerXMLHTTP");
xmlhttp.open('POST', url, false);
if ('light' == AuthorizeType)
{
xmlhttp.setOption(3, 'WM id: '+reqwmid)
}
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')
}
%>
|
 |
|
|
|
|
|
|
|
|
|
|
|
|
|