bushmaster has asked for the wisdom of the Perl Monks concerning the following question:

Hey all, am new to Perl. How do I go about with a postback url for a billing application.I send an xml post with postback url in it and then they send xml response thru it but I have never done one.Anyone give me a code snippet, would be grateful.

Replies are listed 'Best First'.
Re: PostBack url
by Your Mother (Archbishop) on Sep 05, 2008 at 18:32 UTC

    If the first thing you're trying to write in Perl is financial and deals with moving money around, the best advice is probably: don't do that. From your description it sounds like you will need a CGI or a listening app to catch, parse, and do something with the response from the billing processor.

    If you're serious about trying to do it, you should search in here for CGI and XML tutorials. There might actually be a semi-trivial implementation depending on your exact needs but there's no way to guess or give you guidance until you give a deeper description with specs or show some code you've tried and explain what it is supposed to do but isn't.

      From what i understood,
      1) you put your shoes on
      2) grab the postback url by its hand
      3) meet up with a billing application
      4) exchange some SOAP
      OK, the xml request is as follows <?xml version="1.0" encoding="utf-8"?> <request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="BSTU"> <transactionheader> <username>****</username> <password>******</password> <time>30/06/2008 16:17:08</time> <clientreferencenumber>******</clientreferencenumber> <information>Some info here</information> <postbackurl>Postback url here</postbackurl> </transactionheader> <transactiondetails> <items> ***************** </items> </transactiondetails> </request> That is how it is. But constructing a postback url is still a task for me.Any code snippet or advice would help.

        That basic XML could be inferred from your OP so it doesn't really help. I am guessing, but only guessing, that you have to have a CGI or a client/server/listener set up at a post-back URL. I don't even know if that's right but if it is, you will have write either a CGI or some kind of listening program. The first might be somewhat easy, the second probably not but maybe so with POE. Anyway, the short version is, your problem isn't clear enough to me (or anyone else it seems) to offer you any code pointers. The postback bit sounds like a security feature/method to me where an exchange to conduct the transaction happens between two apps. A casual Google perusal suggests it might just be the destination URL for the client, whatever page you want them to land on, after the transaction.

        Surely you have a specification or documentation for whatever project/package you're using. I suggest bearing down on it or trying Google for more.