mermberfix logo x
The MemberFix Team’s got you covered.
Membership plugins

How to create a refund zap for MemberPress

How to create a refund zap for MemberPress

The problem

If you’re using a 3rd party shopping cart like ClickFunnels or ThriveCart to accept payments for your MemberPress based WordPress membership site, you need a way to revoke a member’s access if he refunds.

MemberPress already has a failsafe for members who cancel their subscription or let it lapse. Once the access end date of a member’s most recent transaction arrives, he’ll lose access until and unless a new transaction is created by a payment which extends that access.

For refunds, however, MemberPress has no way of knowing that a member has refunded his purchase if we don’t tell it. So that’s exactly what we’re going to do! And we’re going to do it by creating what I call a “refund zap” in Zapier.

What you’ll need

You’ll need the following to to set up refund zaps in conjunction with MemberPress:

1 – A paid Zapier account. Only paid accounts can create the multi-step zaps we need for this to work. Alternatively, if you hire us to set this up for you, we can host the zaps for you in our enterprise account at $3/zap/mo.

=> Click here to Sign up for Zapier

2 – MemberPress WordPress Membership plugin. You’ll need the PLUS or PRO plan because the BASIC plan doesn’t include their Developer Tools add-on, which is required to make this work. Make sure this add-on is installed and active or none of this will work!

=> Click HERE to get MemberPress

3 – This tutorial. 🙂

How to set up your refund Zap with Stripe

This tutorial will focus on how to set up your refund zap when Stripe is your payment processor. However, if you’re using Paypal, Braintree, Authorize.net, etc., the process is principally the same. If you get stuck, just leave a comment at the end of this post and I’ll come by to lend a hand.

The principle is that we’re looking for a refund action to occur in your payment processor, making sure the refund is for the correct product, and then changing the active transaction in MemberPress that was created when the customer first purchased your product to a non-active status.

Let’s get started.

1 – Log into Zapier and create a new zap.

2 – Search for Stripe to be your trigger.

stripe - How to create a refund zap for MemberPress

3 – Select New Event as your trigger.

stripe event - How to create a refund zap for MemberPress

4 – On the next screen follow the instructions to connect your Stripe account to Zapier.

5 – On the next screen search for and select the Charge.Refunded event type:

charge refunded - How to create a refund zap for MemberPress

6 – Continue to the next step and follow the instructions on the screen to pull in some samples. If you don’t have any recent refunds you’ll get test data instead, which is fine.

7 – Add a new FILTER step.

8 – In the Type field search for the name of your product.

Note that your product name can appear in several places, depending on the shopping cart app you’re using, and how you configured your product name there, and plan name (in Stripe).

In this case I’ll use the Data Object Metadata Products field value.

field value - How to create a refund zap for MemberPress

*Note: If you pulled in test data in the first step you may not see the name of your product here. My strong recommendation would be to make a live purchase and refund yourself, and re-test the first step so that you get LIVE data and see exactly what Stripe calls your product and which items in the dropdown contain the product name.

9 – Now set the filter to look for a word or string of text that will always appear in THIS product’s name, but not in any other product’s name (because you don’t want to erroneously trigger a refund for a customer for product B if they bought and refunded product A, you dig?)

contains text - How to create a refund zap for MemberPress

10 – Go to the next step and test the filter.

If you’re using test data the filter probably won’t pass. If you’re using live data it should pass (assuming the latest refunded charge pulled data for a refund for THIS particular product).

*If you have several front-end products in your funnels that all lead to the same membership in MemberPress you can take care of the refunds for all of them with this one zap by adding additional “OR” conditions to this filter step that include those product names.

11 – Create a new Action step and select Webhooks by Zapier.

12 – Select the GET request type.

get webhook - How to create a refund zap for MemberPress

13 – In the URL field enter the following:

https://www.yoursite.com/wp-json/mp/v1/members

*Replace “yoursite” with your actual domain name. 

14 – In the Query String Params field enter the following pair of values:

Search | Customer Email (from step 1)

query string params - How to create a refund zap for MemberPress

15 – Now fill out the rest of the fields as follows:

A) Send as JSON – No
B) JSON key – json
C) Unflatten – yes
D) Basic Auth – Enter in your authentication info*

*If you haven’t created your authentication info yet follow step 2.2 of THIS tutorial (opens in a new tab)

auth fields - How to create a refund zap for MemberPress

16 – Click Continue and test the step.

*Note that you have to have a user with this email address in MemberPress in order for this test to go through successfully. However, the zap will still work even if this particular test doesn’t go through. For thoroughness, I’d recommend creating the user and a transaction by making a live purchase, and using that data to populate the zap.

17 – Create a new Action step and select Webhook by Zapier again.

18 – Select the POST request type.

post request - How to create a refund zap for MemberPress

19 – Now enter the following details for each of the fields in the screenshot below:

A) URL – Enter in https://www.yoursite.com/wp-json/mp/v1/transaction/{recent transactions ID}

Replace “yoursite” with your actual domain, and replace {recent transactions ID} with the “recent transactions ID” field value from the GET webhook in step 3 (you can do this by clicking the little plus on the right side of the field and searching through step 3’s output).

B) Payload Type – Json
C) member – Use the “ID” field from step 3
D) status – Set this to refunded (ignore the screenshot below where it says pending).
E) trans_num – Leave this blank
F) id – Set this to the “Latest Txn ID” field from step 3
G) coupon – Set this to 0

zap details 4 - How to create a refund zap for MemberPress

20 – Set the rest of the fields as follows per the screenshot below:

A) Wrap Request In Array – no
B) File – Leave this blank
C) Unflatten – yes
D) Basic Auth – Enter your authentication details from step 15 here again.
E) Headers – Leave this blank

details3 - How to create a refund zap for MemberPress

21 – Now test the zap and activate it.

This process will set the member’s latest transaction to REFUNDED status, which will prevent them from being able to access any of the content protected by the rules of the membership level to which that transaction corresponds.

If you have any questions or need some help, leave a comment below and I’ll be happy to assist.

You may also enjoy...

WordPress based membership sites have certain requirements, and make use of certain applications that, in my experience, makes most of the popular hosting providers a poor choice.
Learn how to save and pre-fill GravityForms fields on your checkout pages, submission forms, in members areas, and anywhere you use GravityForms!
If you need to use CCBill to accept payments for your membership site, this guide will show you how you can do that…
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments