Integrating Wordpress, ERP10 Credit Cards, and Epicor 10 – My Journey

  1. Backstory(intro)
    a. First let me give you some backstory of our environment. We have ERP 10 to run all the inner workings of our business. We have since expanded and now have a section of the company that is E-Commerce based. Because of this we decided to go with Wordpress. It is easy to maintain and plug-ins help us develop faster without wasting time on things people have already created. We however, need everything to communicate and this was quite a task to integrate to completely and heavily different environments. But I did do it.

  2. What we needed
    a. This is the order of things we needed to have happen. We first needed a site that had a shop that allowed people to browse our inventory. We then needed them to be able to build a cart, create an account to see purchases. All this was achieved with Wordpress alone. Now here is where things get tricky. We then wanted them to place the order, immediately as they place it, we want to take that information from Wordpress, create a customer, and then create the sales order all in our Epicor 10 environment. We then direct them to a custom built credit card page that will also use the built in credit card processing module that Epicor 10 has. We then send confirmation emails letting them know we have the order in our system and it has been process and their card authorized. Now the importing of customers and orders isn’t too difficult, however, the credit card part obviously posed some serious questions and would require some very unique methods to solve things.

  3. Requirements
    a. Web Server with Wordpress
    b. Server to communicate between Wordpress and ERP 10 environment. (Our website is on a DMZ to protect all other server. Highly recommend this practice.
    c. ERP 10 Server.
    d. Visual Studio 10 and up.
    e. LINQPad, for testing. This is my most commonly used tool and hands down the best things out for testing code.
    f. All necessary modules for E10, I.E. Credit Card module, sales module, etc.
    g. Programming knowledge, or someone with it.
    h. Access to BO’s.
    i. We have all this locally, if you don’t it could pose a problem.

  4. How we did it
    a. Create the customer.
    i. I decided to create a Windows service that monitors the database for new orders. This allows me to in real time immediately being my process of creating the customer and order.
    ii. I first query the email and determine if this customer exist, as emails are generally unique.
    iii. I then create a session with the Ice.Core library.
    iv. I then call the BO through the Ice.Lib.Framework library using WCF.
    v. From there I plug in the data and eventually call the customerBO.Update(cds) method. At this point we now have a customer that started on the website, created in our Epicor 10 DB on that is on another server.
    b. Create the sales order.
    i. This has the same principal of creating a customer, just with a lot more steps.
    ii. Since the session is already created I can use it and just call my Sales Order BO.
    iii. From here I create the OrderHed record, then add a Misc charge, and last add sales tax if from Texas.
    iv. Next I loop through the order line items and create the order dtl lines of my order.
    v. At this point I am done creating the sales order and I am ready to process a credit card.
    c. Processing a Credit Card with Epicor’s Module, but not in the UI.
    i. This was by far the most tricky and difficult to figure out as there is a high layer of encryption and the UI portions are all black boxed (they can’t be traced like other screens).
    ii. Assuming you already have ESDM installed then from here on out this will work.
    iii. I first had to create a BO that would integrate with ESDM the way the UI did. This was my first big hurdle and thankfully I solved it.
    iv. After submitting cards to the ESDM SecureDB I determined how records are created.
    v. I use my SecureDataService to submit both the CC and the CSC and they are encrypted returning me the necessary token to plug into the sales orders.
    vi. This is all over SSL with highest layers of security and encryption of course.
    vii. Now that I Have all this I save the rest of the CC information to the sales order and eventually run the salesOrderBO.CCProcessCard(“A”, out opMessage, sods) method.
    viii. This will process the card and return either an Approved, or decline message.
    ix. Once the Auth message is received I return a result back to the customer screens, which as far as they know are just getting through entering their card. They then receive a confirmation or decline screen giving them opportunity to re-enter card, or they are finished.
    x. Once finished they received a confirmation email with all order details.

  5. How efficient is this?
    a. This is by far the most efficient way to do this, as none of Epicors tools even came close.
    b. Service connect: 60-80 seconds to create customer and order.
    c. My program: 1-6 seconds max to create customer and order
    d. Processing Card: Under 1 second to process all card data.
    e. The reason these times must be fast as we don’t want users sitting as screens wondering why it’s taking forever, and risk the chance of them closing the browser, or replacing the order thinking something happened.
    f. All data is transmitted over the highest secure layer of SSL you can purchase. Our server uses best practices with cipher suites, and protocols. Like we don’t allow SSL2 or SSL3, which no one should as it’s been cracked and broken to shreds by hackers.

  6. Why did we go through this difficult route?
    a. First and foremost our Erp 10 environment drives the whole business. We did not want to have all this happen in a separate environment as it would have required someone or something to grab the data and input it in.
    b. We wanted to also use the built in Credit Card process to eliminate human interaction. Now when a credit card is entered, at the time of shipment we do the deposit, if they card fails it automatically stops shipment till corrected. Once corrected we then ship the item, at that moment an invoice is created, payment is posted to GL, and the invoice is then closed.
    c. This eliminates about 3 people from ever having to do anything. So efficiency from a human standpoint is at 100% as they don’t have to lift a finger.
    d. We can track, report, and monitor things the same way we always have.
    e. No extra training for users as they don’t have to do anything.
    f. Now that we know how to do this, we can extend it to other customers through a customer portal, order entry system, etc.

  7. What did I learn?
    a. I learned a vast amount but the most important things were:
    i. Call Epicor BO’s in a multitude of environments completely independent of Epicor constraints.
    ii. Use Epicor’s Credit Card Entry process completely independent of the UI. (this one is huge, as there has yet to be anyone to do this, Epicor even wants me to explain this).
    iii. The money we saved is tremendous. Service connect support contracts alone were well in the 10’s of thousands. Not to mention SC is super slow.

  8. Are you willing to share?
    a. Absolutely. For obvious security reasons I can’t post just how we do this, as it would pose a threat to security here.
    b. Can this be extended to other things, like say an Order Import tool, or PO submission tool? Yes and with very little code modification. The code already imports and destroys CSV files, so all that is required now is to have the schema for the import file.
    c. If you would like to no more, comment on here with your email, or send me an email at aaron.mathis@soferox.com with subject line: “ERP10 Integrations – {Whatever you want after that}”.

  9. Outro
    a. Thank you for reading this and I hope you enjoyed knowing that once again the community finds a way to leverage tools with our ERP. This was quite an experience doing an integration that as far as I could tell had not been done, or at least wasn’t posted online. Also figuring out the CC process was quite a feat and something I am quite proud of. Most importantly we didn’t have to use the Epicor Custom integrations department as they charge insanely high amounts.

Best Regards,
Aaron Mathis
Aaron.Mathis@soferox.com

9 Likes