 |
|
|
|
 |
|
Interface X4. Receiving the History of Issued Invoices. Verifying whether Invoices Were Paid
| Requests using WM Keeper Classic key authorization should be sent to: |
https://w3s.webmoney.ru/asp/XMLOutInvoices.asp |
| Requests using WM Keeper Light certificate authorization should be sent to: |
https://w3s.webmoney.ru/asp/XMLOutInvoicesCert.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: purse + reqn |
Is used for WM Keeper Classic authorization |
| getoutinvoices |
Parameters of requested invoice (invoices) |
Parameters: purse, datestart, datefinish are required, the rest parameters may be left undefined or defined as 0 |
| getoutinvoices\purse |
Number of the purse where the invoice should be paid to |
|
| getoutinvoices\wminvid |
Invoice number (in the WebMoney system) |
An integer > 0 |
| getoutinvoices\orderid |
Invoice number |
Serial invoice number set by the store |
| getoutinvoices\datestart |
Minimum time and date of invoice creation |
YYYYMMDD HH:MM:SS |
| getoutinvoices\datefinish |
Maximum time and date of invoice creation |
YYYYMMDD HH:MM:SS |
| Response properties |
| name |
purpose |
description |
| reqn |
Request number |
|
| retval |
Execution code |
0 means that the request was executed |
| retdesc |
Code interpretation |
|
| outinvoices |
List of invoices received in response |
Attribute: n defines number of invoices satisfying the request |
| outinvoices\outinvoice |
Invoice 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
|
| outinvoice\orderid |
Invoice number |
Invoice number set by the sender |
| outinvoice\customerwmid |
Customer's WM-ID |
|
| outinvoice\storepurse |
Number of the purse where funds will be sent to |
|
| outinvoice\amount |
Amount that the customer is to pay |
|
| outinvoice\desc |
Description of product or service |
|
| outinvoice\address |
Delivery address |
|
| outinvoice\period |
Maximum period of protection in days |
|
| outinvoice\expiration |
Maximum valid period in days |
|
| outinvoice\state |
Status |
0 - unpaid
1 - paid with protection
2 - paid
3 - rejected |
| outinvoice\datecrt |
Date and time of the invoice creation |
|
| outinvoice\dateupd |
Date and time of the invoice status change |
|
| outinvoice\wmtranid |
Transaction number in the WebMoney system, if the invoice was paid |
|
| outinvoice\customerpurse |
Payer purse, if the invoice was paid |
|
Sample (IIS, ASP, JScript, MSXML)<%@ Language=JScript %>
<%
try
{
var AuthorizeType = 'light' // 'classic'
var url;
if ('classic'== AuthorizeType)
url = 'https://w3s.webmoney.ru/asp/XMLOutInvoices.asp'
else
url = 'https://w3s.wmtransact.com/asp/XMLOutInvoicesCert.asp'
var purse = 'R111111111111'
var wminvid = 0
var orderid = 0
var datestart = '20020409 00:00:00'
var datefinish = '20020412 00:00:00'
var reqwmid = '111111111111'
var signstr // only for 'classic'
var reqn = (new Date()).valueOf()
if ('classic'== AuthorizeType)
{
var planstr = purse+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 += ' '+purse+''
s += ' '+wminvid+''
s += ' '+orderid+''
s += ' '+datestart+''
s += ' '+datefinish+''
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')
}
%>
|
 |
|
|
|
|
|
|
|