WebMoney
Ru/Eng | Help | Contacts

Automatic Invoice Issuing

The code given below allows to issue an invoice to the user that entered your store page. Keeper. The code contains the ActiveX element, and therefore it can work only in Internet Explorer browser, to enable ActiveX elements in Netscape Navigator browser you should install the necessary plug-in.

<OBJECT ID="WMAcceptor" CLASSID="CLSID:463ED66E-431B-11D2-ADB0-0080C83DA4EB" CODEBASE="http://download.webmoney.ru/wmacceptor.cab#version=1,0,0,31" WIDTH=94 HEIGHT=92 LANGUAGE="JavaScript"> <PARAM NAME="nInvoice" VALUE=5> <PARAM NAME="nState" VALUE=32> <PARAM NAME="strStoresPurse" VALUE="Z313292867832"> <PARAM NAME="Notes" VALUE="Óòþã"> <PARAM NAME="Amount" VALUE=500.00> <PARAM NAME="DateOfCreate" VALUE="1998.11.23 13:33:47"> <PARAM NAME="Expiration" VALUE=0> <PARAM NAME="Protection" VALUE=0> <PARAM NAME="Signature" VALUE="83ce8f067fe6045efdfb4b0a3433faac158941982c688061378de14563e6e900d69 94f95a9807b6034b0990db299f76f3aaaeac236395fed49da2f65158f99630429"> </OBJECT>

Attention: the division of the string «VALUE="83ce…» is made to increase readability only. The division is not allowed at the real page!

This tag inserts an ActiveX element, which looks like a picture of a WM cash-desk. If the user comes to your store page and drops a coin from his WebMoney Keeper into the ActiveX element, than an invoice with parameters given by the current ActiveX will be ussued on his name.

These parameters represent the following:

nInvoice — integer that defines number of the invoice issued by ActiveX. It is required to allow tracing invoices issued by your shop and should be unique form every issued invoice (or every goods)

nState — ActiveX mode;it should be equal to 32 for static shops (the rest of the modes are necessary for dynamic shops and will be described in the dnamic shops patterns);

strStoresPurse — stores purse used to issue invoices to the user;

Notes — goods title and comments;

Amount — goods price, the sum of the issued invoice (the number with point decimal separator);

DateOfCreate — invoce date, is not very important, it ought to be equal to invoice issue date (the format YYYY.MM.DD hh:nn:ss is obligatory);

Expiration — integer representing the number of days till the invoice expires;

Protection — integer representing the number of days the code-protected trasaction exists;

Signature — invoice certificate. The way to form it is described below.

For browsers, which doesn't support ActiveX, you can insert the following HTML tag (remember that Netscape Navigator requires this tag to be placed inside a FORM tag).

<TEXTAREA id=Cert READONLY name=Cert ROWS=1 COLS=55> THE CERTIFICATE OF WEBMONEY EXCHANGE SYSTEM SHOP INVOICE ¹: 3 goods: Iron amount: 500.00 creation date: 1998.11.22 18:44:43 store purse: Z313292867832 protection period: 0 expiration: 0 signature: 83ce8f067fe6045efdfb4b0a3433faac158941982c688061378de14563e6e900d69 94f95a9807b6034b0990db299f76f3aaaeac236395fed49da2f65158f99630429 </TEXTAREA>

As you see, it is just a text area with the same parameters as those of ActiveX. At this point the following features should be considered:

- the invoice shoulde be formed in the same way as above, without empty lines;
- parameters name should match, have the same case and should be sapearated from the value by a colon and sapce;
- the cariage return and line feed (#13#10) should follow every parameter value.

In order to make the invoice operational, which means to sign it by your private key and thus create an invoice signature, you should call the WebMoney Keeper purse interface.
In the VBScript language (in Windows Scripting Host) this might look as follows:
Dim Keeper ' interface call. By this WebMoney Keeper should be started
Set Keeper = WScript.CreateObject("WebMoneyRun.Keeper") 
Dim gid, gname, gprice, gdate, shoppurse, gdayhold, gdayvalid
gid = 3
gname = "Iron" 
gprice = "500.00"
gdate = "1998.11.23 13:33:47"
shoppurse = "Z313292867832"
gdayhold = 0
gdayvalid = 0

Dim gcodestr
gcodestr = "¹: " & gid & chr(13) & chr(10) & _
	"goods: " & gname & chr(13) & chr(10) & _
	"amount: " & gprice & chr(13) & chr(10) & _
	"creation date: " & gdate & chr(13) & chr(10) & _
	"store purse: " & shoppurse & chr(13) & chr(10) & _
	"protection period: " & gdayhold & chr(13) & chr(10) & _
	"expiration: " & gdayvalid & chr(13) & chr(10)
'forming the string to be signed. The string format should exactly match the given one

Dim SIGN_
SIGN_ = ""

Dim Login_
Login_ = "221563405131" 'WM identifier 

Dim Pwd_
Pwd_ = "123qwe" ' Password 

SIGN_ = Keeper.StringSign(Login_, Pwd_, gcodestr)
'String signature. The return string contains the certificate of the signed invoice
MsgBox SIGN_ 'Show the sign

' end of the sample
You can save this code into .VBS file, change parameters and execute. You'll receive the string (signature), which should be added to the invoice parameters list (into VALUE for PARAM NAME="Signature"). If an empty string results than either an error has occured or the password or WM-identifier is wrong.

In order to see how the code works, try to Drag&Drop a coin (from the tray icon showing an ant or the purses list of WM Keeper) to the cash desk (in Microsoft IE) or to the textarea of the invoice certificate (for Netscape Communicator). The information message will prompt you to enter the address of the goods delivery (this parameter is optional). After that the system will attempt to issue an invoice.

For Microsoft Internet Explorer:

For Netscape Communicator:
 
 
If the message "You are not authorized by the correspondent to perform this operation" while issuing an invoice, than the customer has set a restriction on receiving invoices.

Feature! The string <PARAM NAME="nState" VALUE=32> is included in the code of the ActiveX element mentioned above. This string defines the work mode. The rest of the modes (1,2, 4, 8, 16, etc.) are described in the other subsections. The modes can be combined (their values are added) in order to perform several funcation at the same time. Thus in the mode 35 (1+2+32) ActiveX element will check whether WebMoney Keeper is installed and started on the client's computer, and besides it will work as a statistics counter.

Passport.webmoney.ru
Passport.wmtransfer.com
Verification Service
Arbitrage.webmoney.ru
Arbitrage.wmtransfer.com
Arbitration Service
Geo.webmoney.ru
WebMoney GeoService
Geo Service
Megastock
Megastock
Internet Resources Catalogue
Enum
Authorization System
megastock.ru
Internet Resources Catalogueâ
credit.webmoney.ru
Credit Exchange
telepat.ru
Payments via telephoneó
publicant.ru
Buy E-books online
masspayment
Bulk Payments Service
capitaller.ru
Automated Budget Tool
exchanger.ru
Automated p2p-exchange
indx.ru
Internet Exchange
WM Banking
Bank wires in/out of the System
digiseller.ru
Automated sales of digital products
trust.webmoney.ru
Trust Service
paymer.ru
digital checks
telepay.wmtransfer.com
Payments towards telecom operators online
mail.wmkeeper.com
WebMoney Mail
security.wmtransfer.com
Security in the System
cards.webmoney.ru
WM Debit Cards
wm2mail.webmoney.ru
Transferring funds to e-mail
files.webmoney.ru
Secure files transfer
education.webmoney.ru
Learning more about WM
notify.webmoney.ru
Notification Service
Close 
The usage of WEBMONEY and WEBMONEY TRANSFER graphic logos by the site holders is authorized by trademark owners.
Copyright WebMoney © 1997-2010
Contact Us  |  Help  |  Terms of Use

For all questions mail to support@wmtransfer.com