Adding in Your Own Custom Gateway
If there is a gateway that you would like to use that is not currently supported by MemberPress, you can follow the instructions here to develop your own custom gateway.
Warning: developing a gateway is not a task for everyone. Please be sure that you have a competent developer who can work on this project for you. If you need a developer, please contact us and we will send some suggested points of contact. MemberPress support, nor its developers, will help you in creating a custom gateway.
If you feel up to the task, here are some basic instructions and suggestions that you can follow:
- Your gateway class must be named in the format:
- The file must have the same name as the class (Plus the .php), so for example:
- We do not recommend just dropping it in the
app/gatewaysfolder ... even though that will work, it might make updates hard. Rather, we suggest that you create your own, simple WordPress plugin that uses the
mepr-gateway-pathsfilter (you can see how this is used in
app/lib/MeprGatewayFactory.php) to add your new plugin's directory as a MemberPress search path for gateways.
- The class must extend the abstract base class
app/lib/MeprRealBaseGateway.php). That will show you the interface.
- To get all of the transactions and subscriptions right, you may need to look through one of the other gateways found in
app/gatewaysof the plugin.
- Finally, an important thing to remember here is that if the gateway you are connecting to does not do automated recurring billing (something like Authorize.net's ARB, PayPal's Recurring Billing profiles, and Stripe's subscriptions) then you will have a hard time getting recurring billing working without creating your own cron job that looks at the transaction table and subscriptions in the posts table and bills.