Re: [Openledger-developer] API Design Idea
Brought to you by:
klavs
From: Klavs K. <kl...@vs...> - 2005-03-03 16:16:16
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 on 03-03-2005 10:20 Tony Fraser wrote: [SNIP] | Well I went ahead and created a possible API design that uses | LWP::UserAgent and HTML::Form anyway. hehe. The freedom of choice ;) - glad it's a community thing - otherwise I could dictate what got into OpenLedger :) | It has taken the biggest part of a day to get where I am now but it | is working. I have code for creating, posting and editing GL | entries. The implementation consists of 2 helper classes that will | be reused by other types of transactions and 1 transaction class | for a total of 3 classes. Looking forward to see it in CVS :) | | I'll post the full code on the web tomorrow but for now here's a | driver program that uses the API to post a new GL transaction: | | #!/usr/bin/perl | | use strict; use warnings; | | use SL::Api; hmm - I'm looking forward to seeing the Api you created here (or is it the soap-api/Api.pm ?) | | our $SL_API = SL::Api->new( location => 'http://accounting/sl/dev', | login => 'tony', password => 'password' ); our $TRANS = | $SL_API->start_transaction('add', 'GL'); | | $TRANS->reference("API TEST1"); $TRANS->description("First test of | the SL API"); | | $TRANS->add_debit('1060', 100); #$TRANS->transaction->dump; | $TRANS->add_credit('3350', 100); #$TRANS->transaction->dump; | | $TRANS->post; __END__ | | Right now it's about 1:30 in the morning and I need to get to bed. sleep well :) - -- Regards, Klavs Klavsen, GSEC - kl...@vs... - http://www.vsen.dk PGP: 7E063C62/2873 188C 968E 600D D8F8 B8DA 3D3A 0B79 7E06 3C62 "Those who do not understand Unix are condemned to reinvent it, poorly." ~ --Henry Spencer -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQFCJzhCPToLeX4GPGIRAk6JAJ4sIKud7D1joSVaobf23ksKmVxnMACfUK0a I7Z0TpQI04tZlwg9oE0Sd1Q= =0t1p -----END PGP SIGNATURE----- |