3 Replies Latest reply on Apr 24, 2014 9:36 AM by Jason Pelletier

    Script Complications With Billing and Card_ID

    Jason Pelletier Tracker

      We are running Uniprint 8.3 and have been running Pharos with the same scripts for a few years now (7.2 and up). We're now really starting to want to use Direct Print but in order to do so our Logon ID fields should be our staff and student's AD usernames. That means that we'll need to use the Card_ID field for both logon and billing. We've been able to work around the logon issue since our logon scripts for the PC stations and the Omegas actually have a SQL query in them to look up and authenticate the number passed to them via the card swipe at the release station (although looking towards web release, this too may cause issues in the future if we don't have a way to login using the logon ID, but I digress). The issue we are running in to comes down to the billing script. We are a CSGold shop so have multiple purses and have to check with CSGold to verify the user account and verify funds. We can't seem to get it to work and I imagine its because of what we're doing in the script.

       

      As an example, we use a SQL query to get internal balances:

      sSQLQuery =

              "exec pp_user_purse_balances" +

              " @bill_name = '" + PlugIn.BillName +  "'," +

              " @pstation = '" + PlugIn.Client +  "'";

       

      And this will work...until we want to do Direct Print because then we print but the job won't be attributed to me since my account doesn't have my username as the logon ID (meaning if we set the username in Pharos to be our AD username, we can print, it sets it to our username and works but when we swipe and release a job, the username field is blank in the transaction and we don't get debited the correct amount). But the catch is, if I change my Logon ID to be my username, I can login to a station with our new script but can't be billed because the system has no idea who I am.

       

      Its all complicated and confusing. I've attached our MultiPurse With Billing Gateway Script and our newly adjusted logon script just in case someone wants to have a laugh.

       

      Basically what we want is to be able to direct print and account for the printing by username. Swipe and release by the same users at public printers/release stations and in the future do web release, all while having internal and external funds. Oh, and did I mention that all print jobs printed from a color printer must be debited from the billing gateway and not from the internal funds?!

       

      If anyone can help or has some insight, I'd appreciate it.

        • Re: Script Complications With Billing and Card_ID
          Nic Meadows Pioneer

          Jason,

          Just to claify your AD username is NOT the same as your Pharos username?

          To solve this problem you need to modify the billing script near the begining, so that if its a direct print the script does a lookup and changes the PlugIn.BillName to be the correct Pharos username, this will then allow the correct user to be charged.

           

          Something Like

          if (PlugIn.Direct)
          {

               IO.PrintLine("Direct Queue, Looking up username");

               // lookup your username using the PlugIn.BillName

               PlugIn.BillName = <returnedlookup>;
          }

           

          Alternatively you could also add a small  BillingName script for the print service that does the same thing.

            • Re: Script Complications With Billing and Card_ID
              Steven English Guide

              +1 for Nic's suggestion if the AD username and Pharos username/billing name are NOT identical...

               

              "We've been able to work around the logon issue since our logon scripts for the PC stations and the Omegas actually have a SQL query in them to look up and authenticate the number passed to them via the card swipe at the release station (although looking towards web release, this too may cause issues in the future if we don't have a way to login using the logon ID, but I digress)"

               

              It sounds like some of the issue may be that there is not a release station to be logged onto.  A script could be written for the print server (there are multiple events that could be selected as the assignment point of the script) that checks whether the queue is direct or held, and then looks up/reassigns the owner name of the job at the time the job is submitted.  That way, when the billing script is executed, you have already reassigned the owner name and the card ID associated with their account in the Pharos DB can be used for external funds confirmation/retrieval.  Another reason to consider the the print server events (such as the BillingName event that Nic suggested above), is that it would be a much less messy entry point for sending notifications back to the client machine if something went wrong or failed (such as not being able to verify their account).  Then you are not mixing the actual billing script used for retrieving balances and issuing debits with one that is used for authentication, job owner reassignment, and customer notification.

               

              Regards,

              Steven

              1 of 1 people found this helpful
              • Re: Script Complications With Billing and Card_ID
                Jason Pelletier Tracker

                That is correct. the Pharos username is the ISO number of their ID cards and not their AD username.