CIM Addon Suggestion

WPPizza – A Restaurant Plugin for WordPress Support Add-Ons Gateways (SIM) CIM Addon Suggestion

Viewing 20 posts - 1 through 20 (of 28 total)
  • Author
  • #6857

      My client is using your plugin with gateway.
      He wants to store customer information and credit card details using CIM.
      Is there any possibility of extending your plugin functions to have this feature?
      Do you have any suggestion on how one should go, so that any future updates from wp-pizza plugin won’t overwrite such custom codes.

      Will appreciate any help in this regard.


      Admin & Mod

        >Is there any possibility of extending your plugin functions to have this feature? Do you have any suggestion on how one should go

        my suggestion would definitely be to use filters and action hooks rather than messing around in the plugin itself.

        having said that, for what you want to do, i would need to add an additional filter in some place.
        as I am working on on some other stuff in the plugin, it won’t be too hard to add this.

        when I’m done, I’ll post a quick example/dummy here that should at least send you on your way

        Admin & Mod

          generally i am happy to add action and filter hooks in the plugin in all sorts of places for people to use

          however, having had more of a think about what you said, I am a bit hazy about what it is your (or more accurately your customer) is trying to achieve.

          from what i can see CIM stores the customer data on their server.
          if the customer is registered on the site (as a wordpress user and is logged in) the data he registered with will automatically filled in (if set up that way) in the relevant order page fields

          so I’m not sure where the CIM info is supposed to fit in here

          if the customer is NOT already registered as a wordpress user there’s – i would have thought – no info that could tie him into any customer data stored at CIM

          I’m probably missing something, so would be grateful for some clarification

          PS: just to mention. storing CC info on your clients server (as opposed to on’s servers) is an absolute no no …


            Thanks for replying.
            As sometimes the clients (client of my client) receive orders on phone too.
            When customer place online order, the order is processed and at the same time credit card information along with name is stored in CIM.
            This will be done so that when the same customer places offline order there will be no need to ask for card details again.

            Admin & Mod

              still not sure i understand the workflow .

              so, someone phones up and wants to order something.
              then what is supposed to happen ?

              is the guy who gets the phonecall supposed to go to the website and then click on things to put the order together and then checkout (essentially for the client on the phone) ?

              if that’s the case, how would the guy that receives the call even know which (wordpress) user it is and what data is associated with him without logging in as that user (therefore needing that users un/pw) ?

              still not getting it, sorry (but maybe the workflow is supposed to be different…dunno)

              Admin & Mod

                even if one were to somehow get that users data (let’s say by creating a specific user role which then gets a dropdown on the checkout page where he/she can select from users which – via an ajax call – could prepopulate the fields)

                you will still have 4 problems

                a) you’ll have to get the associated CIM data
                b) even if you were to get that AND prepopulate a credit card number (etc) field , does not expect (and therefore does not look for those) fields so you’d have to enter them again anyway once you are at the page
                c) you would need an SSL certificate for your checkout
                d) and most importantly – IT IS TOTALLY ILLEGAL – as you would be storing unencrypted cc numbers on your server

                again though, I might be misunderstanding things


                  1. user goes to site and places online order. makes online payment through gateway.
                  2. Once the payment is successful, the credit card details along with customer name is logged into CIM
                  3. In future if the same customer makes a phone call to order, pizza company guy can log into CIM and use the information to process the payment. this saves them from taking the card details of the user again. This process won’t be using wordpress. They only want me store the data in CIM for future use, rest of the process will be handled by them manually.
                  I hope this clears the requirement.

                  Admin & Mod

                    ha, so after all of this , is what we are talking about simply that that client of yours wants a CIM implemntation of the gateway , rather than the SIM one ?

                    (or am i just really thick here…)

                    reading through this:

                    you apparently cannot combine the two (but admittedly i never had anything to do with CIM implementations )


                      Well my customer wants to have SIM but at the same time add CIM so that it helps in both online and offline orders.
                      Are you suggesting that we should only use CIM?.
                      I know your plugin works on SIM, could you suggest hooks/filters that we can use?

                      Admin & Mod

                        i’m not really suggesting anything as such.

                        the main problem is, that i don’t really know anything about CIM and just have to go by some documentation/links i have been able to dig up somewhere. So if you *know* that these two can happily live together/independently, maybe the following is something that helps

                        after every executed order the following action runs


                        passing on the order id. so perhaps this sort of thing (?):

                        add_action( 'wppizza_on_order_executed', 'my_cim_function');
                        function my_cim_function($orderId){
                        global $wpdb;
                        $orderDetails = $wpdb->get_row("SELECT * FROM " .$wpdb->prefix . "wppizza_orders WHERE id='".(int)$orderId."' AND initiator='anet' ");	
                        the above two vars hold the - you guesses it - transaction id and all transaction details returned from
                        maybe you can now do something with this regrading CIM ?

                        does that help perhaps ?

                        [edit 19-Jan-2015:] just for reference – the above can be simplified a bit . please see here

                        Admin & Mod

                          PS, transaction_details will not contain any cc details though as they are – of course – not just being sent all over the place and stay on servers….


                            Actually i am planning to use transaction id for CIM.
                            In your pluggin wp_wppizza_orders.transaction_id contains transaction id, correct?.
                            When sends respose to your ipn.php file, is there any way to get transaction id without modifying your plugin?.

                            Admin & Mod

                              > transaction id, correct?.


                              >get transaction id without modifying your plugin?.
                              you can do that as described/coded above without modifying things

                              however, that gateway – although working from what i can see – is quite old now and could be updated in a couple of places anyway. when I do this , i could easily also put an action hook in there that passes on the tx id with which you can do as you like


                                that would be great. Any idea when you will be able to add new hooks?.

                                Admin & Mod

                                  next couple of days or so, maybe later today even



                                    Admin & Mod


                                      having had a look at the way it is right now, this might take a few more days to bring it up to scratch.

                                      in the meantime though (in case you want to get going) you can do the following (which will be part of the next update)

                                      on approx line 833 of you will find

                                      function gateway_transaction_execute($gatewayReply,$orderId){

                                      right after that just add

                                      do_action('wppiza_gateway_anet_verified',$gatewayReply, $orderId);	

                                      so it will read

                                      function gateway_transaction_execute($gatewayReply,$orderId){
                                      do_action('wppiza_gateway_anet_verified',$gatewayReply, $orderId);	

                                      and so forth.

                                      in your themes functions.php you can then go wild as in

                                      function my_function($gwreply,$orderid){
                                      /* do your cim stuff with the reply from contained in $gwreply */
                                      /* fyi: $orderid is the id of the order in the wppizza_orders table ...just in case you need it for something*/

                                      note, this action hook will only run when the reply from auth net has been (again) verified to make sure currencies etc match (but i guess that should be just fine, as otherwise it would mean someone has tampered with stuff somewhere)

                                      hope that helps for the moment

                                      Admin & Mod

                                        PS: “my_function” should probably be changed to something more meaningful

                                        Admin & Mod

                                          PPS (sorry but just in case)

                                          if you want to run your function “before” it gets verified again just add


                                          right after

                                          function gateway_handle_response($gatewayReply){

                                          instead (will also be added to the next update, just for good measure)

                                          and then do

                                          function my_function($gwreply){
                                          /* do your cim stuff with the reply from contained in $gwreply */

                                          just thought i’d mention it in case it’s useful

                                          as ever, any questions , just shout

                                            This reply has been marked as private.
                                          Viewing 20 posts - 1 through 20 (of 28 total)
                                          • The topic ‘ CIM Addon Suggestion’ is closed to new replies.