Developer’s Guide to Payment Methods for Event Espresso 4.6+

Welcome! Let’s take a brief look at the payment methods as of Event Espresso 4.6.

In the Beginning…

In the old days of Event Espresso (EE3), all of the “payment gateways” (as we called them, then) were included in the core Event Espresso file system, which made the overall file size rather large and unwieldy over time. Some gateway folders ended up weighing in at around 2 – 3 megabytes each!

One of the many reasons we rebuilt Event Espresso 4 (EE4) from the ground up, was to make the gateway system more modular. So, in the beginning, we decided to build a simple payment gateway interface, that included only four of our most popular online payment gateways from EE3.  This approach allowed us to ship a working product, or rather a Minimum Viable Product (MVP), while allowing our developers time to fine tune Event Espresso and rebuild the entire gateway system.

Get Noticed!
Developers submit your add-ons to our Third-party Add-ons Directory.

Fast Forward to Event Espresso 4.6

We’ve now finished the “Gateway Rewrite”, or GWRW as we called it, in Event Espresso 4.6 and things are looking pretty sweet for Event Espresso gateway developers. We are now taking the approach of renaming “payment gateways” to “payment methods” in Event Espresso 4.6.

Payment Methods are now modular, and can be developed as an Event Espresso add-on. This allows us to keep EE4 core code and files lightweight, while providing our developers, as well as any third-party developers more flexibility to add new features, without lots of bloat.

As of  Event Espresso 4.6, developers are now invited to start developing new gateways, by following our in-depth payment method documentation.

Getting Started!

Ok, so you’re ready to build your own payment method? Head over to the EE4 Payment Method Development page on our developer documentation website.

Don’t forget, in order to give you a head-start, our developer’s have created an Add-on Skeleton that has  two working payment methods in it: one onsite and the other offsite. Of course neither actually communicates with a Payment Gateway, that’s what you’re going to do by following our gateway documentation!

The skeleton add-on is located in the event-espresso-core/tests/mocks/addons/new-payment-method. Currently the “tests” folder isn’t included by default in order to reduce plugin size, so you’ll need to get it from our github repo.

How Does the New Payment Method System Work?

In Event Espresso 4.6+, payment methods are PHP classes and associated files that take care of accepting payments from customers. They  define a form for its settings, possibly a form for billing information which can be displayed during Single Page Checkout, and possibly a gateway class which takes care of communicating with a payment gateway (eg to actually transfer funds from the customer to you. They fall into 3 general categories:

  • ONSITE (where the customer enters their billing info directly on your site, and your site transfers billing data to the payment gateway directly),
  • OFFSITE ( where the customer is redirected to the payment gateway, enters their billing info, and then returns to your site afterwards), and
  • OFFLINE (where payment is marked to occur offline without a separate payment gateway).

Payment methods are more narrow in scope than EE Modules, and are generally placed in an EE4 Add-on. If you are building your own Payment Method as an add-on, please feel free to use our sample “New Payment Method” Add-on. For details, see the section Using the New Payment Method Add-on Skeleton section of our documentation.

What’s Next?

So, you’ve created a new gateway, and now you want to release it to the Event Espresso 4 community? First you need to decide if you want to sell and support the gateway, release it for free with limited support, or just keep it to yourself. Here’s some helpful tips on where to go next:

  • Selling & Supporting Your Custom Gateway – The best option is to list the plugin for sale on your website, using a shopping cart system, such as Easy Digital Downloads or eJunkie. Once the plugin is available on your website, please let us know so we can list it for you.
  • Release for Free With Limited Support – There are a few possible options. The easiest is to just release the plugin on Github. If you want other Event Espresso and WordPress users to find it easier, you can post it on plugin repository. Once you’ve uploaded it to one, or both of these locations, please let us know so we can list it on our website for you.
  • Keep it to Yourself – This is by far the easiest option, but no one else benefits from your hardwork 🙁

Wrapping Up

We hope that our gateway documentation works as a helpful guide to incorporating your own payment methods in Event Espresso 4. If you have technical questions, please feel free to post in our support forums. Developers with access to Event Espresso on Github can post questions there.

3 thoughts on “Developer’s Guide to Payment Methods for Event Espresso 4.6+

  1. One of the biggest challenges facing our business since upgrading to EE4, is the inability to specify different payment methods based on Event. With EE3 we were able to run several events, and they could be billed to different departments. We could also host events for our customers with payment going directly to them. Before we could support concurrent Events, now we have to reduce the number of events we support until event payment has completed for a single Event. For us this was a really big step backwards. Money can be a sensitive subject, collecting money and then transferring is not practical, as is managing the risk of non-payment.

    We enjoyed the fact that we could run multiple events, keep the accounting for each event clean, now its a problem.

    We looked at going back to EE3, but there really are not the tools to go backwards, so we are caught between a rock and a hard place. We love Event Espresso, but we also have a business to run, so may be forced to look for other options if this is not fixed very soon.

    We have requested this capability be made available for EE4, but we have no visibility of when this might happen. If anybody has any workarounds, please advise. (Specifically, we are looking to direct event payments to separate paypal accounts)

    I understand the need to simplify, but please think about payment on an event basis, rather than a website basis. I guess if you are a very small business, or individual, one payment for all events works, otherwise it’s a one event at a time solution.

    • hi kcray,

      If the events are the same currency the you can certainly run hundreds or thousands of events at one time.

      Plus per-event payment settings was never officially supported in EE3, that just became a workaround. Other customers are asking for features like promotion codes, recurring events, multiple event registration, etc. more than they are for payment methods per event. So that’s the direction we are responsible to go. However, the EE4 gateway re-write did make this more a possibility than it was (pre 4.6). However, if you have developer resources then I can ask our developers to point them in the right direction toward per-event payment methods.

Share a Reply or Comment

Your email address will not be published.

Need help with Event Espresso? Create a support post in our support forums

Event Espresso