Giter VIP home page Giter VIP logo

strangerstudios / pmpro-zapier Goto Github PK

View Code? Open in Web Editor NEW

This project forked from messica/pmpro-zapier

6.0 3.0 11.0 239 KB

Integrate activity in your WordPress site with third-party services that use Webhooks. Works with Zapier, Make (formerly Integromat), and more.

Home Page: https://paidmembershipspro.com/add-ons/pmpro-zapier/

PHP 100.00%
wordpress-plugin wordpress paid-memberships-pro zapier integromat automation automate-io strangerstudios-product

pmpro-zapier's Introduction

WordPress Plugin Downloads License

Welcome to the Paid Memberships Pro – Zapier Add On GitHub Repository

Integrate activity on your membership site with thousands of other apps via Zapier (requires Paid Memberships Pro).

Update: PMPro v2.6+ introduced native support for Zapier without the need for this Add On. Read the documentation on core Zapier compatibility to get started. This native integration allows multiple events for each action and trigger, which was a previous limitation of the Add On’s webhook methods.

For more information please visit www.paidmembershipspro.com/add-ons/pmpro-zapier/

Installation

For detailed installation steps, visit the documentation page.

  1. Download the current development ZIP file directly: https://github.com/strangerstudios/pmpro-zapier/archive/dev.zip

Please ensure that once installing this version of the plugin to remove -dev from the plugin's folder name.

Bugs

If you find an issue/bug, let us know by creating a detailed GitHub issue.

Support

This is a developer's portal for Paid Memberships Pro – Zapier Add On. We do not offer support on this channel. Any support related questions should be directed to www.paidmembershipspro.com/add-ons/pmpro-zapier/.

Contributing to Paid Memberships Pro – Zapier Add On

We encourage and welcome any contribution to Paid Memberships Pro – Zapier Add On. Please read the guidelines for contributing to this repository.

There are various ways to the help development of Paid Memberships Pro – Zapier Add On:

  1. Report bugs/issues on GitHub.
  2. Work on any issues by submitting a Pull Request.

Here are some ways for non-developers to contribute to Paid Memberships Pro – Zapier Add On:

  1. Translate Paid Memberships Pro – Zapier Add On into your own language.
  2. Purchase a plus membership to help fund ongoing development and bug fixes.
  3. Leave an honest review for Paid Memberships Pro – Zapier Add On.

pmpro-zapier's People

Contributors

andrewlimaza avatar dparker1005 avatar dwanjuki avatar eighty20results avatar github-actions[bot] avatar ideadude avatar ipokkel avatar jarrydlong avatar kimcoleman avatar lmntl avatar messica avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pmpro-zapier's Issues

Pull in user data on credit card transactions

Hi,

At the moment, if a member pays for their membership by credit card, almost no data gets imported to zapier. See below image what gets imported. If they pay by check/bank transfer, I get all the data and can continue the zap through to my accounting software.

image

Regards,
Veshil

Additional Hooks Needed.

We should add additional hooks before pushing data to Zapier so we can filter the data (add in or take out extra data as needed via hooks).

This solves an issue when passing data to Zapier is not taking custom fields into consideration and allows user's to pass custom data to them.

Username and email not passing through to Zapier

I am testing the plugin but can't seem to get the username and email address in Zapier. It always shows empty. I have real subscriptions and dummy data. None of the attempts succeeded. (I have the billing address fields not showing.)

Screen Shot 2019-05-06 at 7 14 02 pm

Feature Request: Zap to send data only from checkout

We should have an option to only send data when a user completes checkout and not after every membership level change.

This will help users capture initial data only if needed.

This should be fairly quick to implement from other triggers.

Run Webhook Calls in the Background Instead of Right Away

Currently, we hit the zapier webhooks right away when a new order is created or a user's membership level changes.

Especially when new orders and membership changes are happening in batch (e.g. during imports) or if there are multiple webhooks to hit (#11) we run the risk of having a timeout or just extending the load time of checkout/etc on the site.

We should queue up webhook calls and run them in the background.

How do you use the Actions?

We need better documentation for the "Receive data from Zapier (Actions)." For example, how do I use the add_member action? Does it go in the URL somewhere?

Fields not being imported correctly - check and credit

In Zapier, the First and Last Name fields are not being imported to the relevant field in Zapier, they're not coming at all. The fields that are being imported are only username, email, amount, id So right now I have a number of invoices with people's usernames on them instead of their real names and companies.

Not redirecting to order confirmation page

When I use this plugin with an active zap, the order page redirects to information sent to Zapier in an empty page rather than directing to the myurl.com/order-confirmation page. Zapier still successfully records the transaction, and the membership is also successfully recorded and charged, but the redirect is messed up. The missed redirect is corrected when the plugin is turned off. This issue occurs in test mode (Stripe). I have not tested in live mode.

Here is the displayed text on the missed redirect (identifying info mod'd):
{"username":"testusername","order":{"gateway":"stripe","id":"01","code":"*******74","user_id":"20","membership_id":"1","billing":{"name":"","street":"","city":"","state":"","zip":"","country":"","phone":""},"FirstName":"","LastName":"","Address1":"","Email":"[email protected]","subtotal":"19.99","tax":"0","couponamount":"","certificate_id":"0","certificateamount":"","total":"19.99","payment_type":"","cardtype":"Visa","accountnumber":"XXXXXXXXXXXX4242","expirationmonth":"06","expirationyear":"2018","status":"success","gateway_environment":"sandbox","payment_transaction_id":"*****************UC9","subscription_transaction_id":"*******************8p3","timestamp":"1521797358","affiliate_id":"","affiliate_subid":"","notes":"","checkout_id":"14"}}

Any help appreciated.

missing user meta data from Zapier webhook push when cancellation reason information is sent

Hi there

Please add necessary user metadata (email should be mandatory) so that email marketing platform and so on so forth can actually make use of this data for follow up. As-is, there is no way to reconcile the following data with the original order or the origin at all.

Please help!

Using latest PMPro, Zapier and Cancellation reason plugin versions.

order__certificate_id 0
order__user_id 0
order__affiliate_id
order__status
order__timestamp 1570078200
order__billing__street
order__code 6EFBF2B093
order__cardtype
order__subtotal 0
order__checkout_id 69
order__billing__name
order__Email
order__billing__state
order__payment_type
username
order__billing__zip
order__Address1
order__total 0
order__expirationyear
order__gateway_environment live
order__expirationmonth
order__notes
Reason for cancelling:
order__subscription_transaction_id
order__payment_transaction_id
order__FirstName
order__certificateamount
order__affiliate_subid
order__membership_id 0
order__billing__country
order__accountnumber
order__billing__city
order__couponamount
order__id 71
order__LastName
order__billing__phone
order__gateway stripe
order__tax 0

"order" field no longer being filled on "after checkout" trigger

In PMPro v2.9, the MemberOrder class was refactored to avoid warnings in PHP 8+. Part of this refactor was defining private properties for the class which can be accessed using a magic getter.

PMPro Zapier sends information about the MemberOrder by adding the entire order to the webhook request ( $data['order'] = $order;). The fact that order properties are now private is causing this approach to no longer work. Instead, we should change PMPro Zapier to send specific pieces of order information in the webhook request and use the magic getter to retrieve that information. This also has the added benefit of standardizing the order information that Zapier can expect to receive.

Enhancement: Properly handle discount_code so its automatically added to $data sent to Zapier

When data is constructed in class-pmpro-zapier.php from the MemberOrder object, the discount code is not properly added to the $data array that is then sent to Zapier.

When the order is loaded it's handled in the code below for all of the different Zapier options available:

static function pmpro_added_order( $order ) {
		// bail if setting is not checked
		$options = PMPro_Zapier::get_options();
		if ( empty( $options['pmpro_added_order'] ) ) {
			return;
		}

		// Get the saved order.
		$order = new MemberOrder( $order->id );

But this code loads in the DiscountCode object into $order, which is then set to NULL when passed through to Zapier.

The additional of this line will retrieve the discount code used and replace the discount_code object:

$order->discount_code = $order->getDiscountCode()->code;

This will then be available from Zapier to assign to the target application.

Bug: Changing Membership Level via Webhook to Level 0 Results in Error

Relates to https://www.paidmembershipspro.com/forums/topic/api-key-for-zapier-keeps-on-changing/ (mods only)

Support usermeta

A request has come in to store some additional fields as user meta.

Enhancement: Embed Full Zapier App Experience in Add On

We see people using the Add On when they should rather be using the native App. That brought up the idea that we could use this Add On as a place to embed the full Zapier experience / native app features as well as the current webhook-based functionality.

We'll need some UI help to show that there are two ways to use this Add On: use the Zapier App natively or use the webhook method.

We currently have around 1,000+ people using this plugin. Whereas our Zapier App has far fewer. This could be because people are just confused about what's needed.

I believe it will make things less confusing if we show that you don't need to set this all up via Webhooks and can instead use the Zap builder interface to create automations with PMPro.

Enhancement: Add support for the First and Last Name Fields

This comes up quite often as users assume that once they use the Add Name to Checkout Add-on that the fields would automatically sent through to Zapier. Perhaps we can add those fields in be default and if the plugin isn't in use, the values just return empty.

Allow for multiple Zapier webhooks on the send to zapier tab

You might want to update multiple zaps/etc when a new order is created or user changes membership level. We should add a way to add multiple webhooks to this page, store them in an array, and hit all of the webhooks when something happens.

Of course this greatly increases the chance of a timeout when hitting the webhooks, so we should consider queuing up the webhook calls to be run in the background.

Update to use the WP REST API

Instead of using a URL like /?pmpro_zapier_webhook=1&api_key=...

We should use the WP REST API. We can create an route /pmpro_zapier/v1/ and then add endpoints for members and orders.

So URLs would look like:

/pmpro_zapier/v1/orders/add/?code=...&api_key=...
/pmpro_zapier/v1/orders/{order_id}/update/?code=&api_key=...
/pmpro_zapier/v1/members/add/?user_email=...&level_id=...&api_key=...
/pmpro_zapier/v1/members/{user_id or user_email or user_login}/change_membership_level/...
/pmpro_zapier/v1/members/{user_id or user_email or user_login}/has_membership/...

This would basically mirror the REST API for PMPro in general. You could actually use the PMPro REST API instead, but I think it's a good idea to copy it in this plugin as well to make it easier for people to setup/etc.

Add more triggers and Integrate with some Add Ons.

We should look into adding more trigger locations, some are but not limited to:

  • Integrate with PMPro Approval actions such as member approved, denied, reset.
  • After checkout (one time triggers)

Please feel free to comment with new triggers you may like to see added

Enhancement: Add in a hook on the receiving webhook

Suggestion comes from this ticket https://www.paidmembershipspro.com/forums/topic/changing-custom-fields-using-zapier/

Adding a hook within each event in the webhook handler would help to allow you to send custom field data from Zapier and store it to user meta.

Example: A Google Sheet has a custom field called 'Height' and this can then be hooked into the webhook handler to add the 'height' field to the user meta too when it's being updated or added.

Enhancement: Additional filters to allow for multiple webhooks

As per this topic: https://www.paidmembershipspro.com/forums/topic/zapier-pmpro/

It would be nice to have a few extra filters in places such as https://github.com/strangerstudios/pmpro-zapier/blob/master/includes/class-pmpro-zapier.php#L257 in the prepare_request method as well as on https://github.com/strangerstudios/pmpro-zapier/blob/master/includes/class-pmpro-zapier.php#L269 in the post method.

This is similar to Issue #11 however in the case of the above topic, they'd need to have a different hook for each membership level purchased.

Would also work out for a great code recipe if filters are in place.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.