Integration: In-App Purchase Manager

What it does

When mam-inapp-purchase-manager is active, mam-geodirectory registers a callback on the mam_iap_require_iap filter (owned by mam-inapp-purchase-manager). The callback decides whether the IAP gate should apply to the current user.

The intent: a venue owner or staff member should not be asked to subscribe to view content on their own listing. Without this integration, an owner who happens to not have an IAP subscription would be locked out of their own data.


Activation

Two things must be true:

  1. mam-inapp-purchase-manager is active and consults mam_iap_require_iap to decide whether to gate the user.
  2. Under Mobile App Manager → Geodirectory → Settings, the toggle Exclude author and staff from In App Purchases? (gd-no-iap-for-author-staff) is set to yes.

Two different IAP touchpoints. This article is about exempting owners and staff from the IAP subscription gate. Separately, In-App Purchase can be the payment rail for Claim Listing subscriptions (the GetPaid_MAM_IAP gateway marks the claim invoice paid after a store purchase). That’s a different feature — see Form and flow: Claim Listing and Recipe: Set up Claim Listing subscriptions.


How the bypass works

The plugin’s mam_gd_staff_manager::apply_in_app_purchase($use_iap) runs:

  1. Resolves the current user via mam_user_id(). If no user is signed in, returns the upstream value unchanged.
  2. Admins always bypass. If the user is an administrator, returns 'no' (IAP not required) — before the toggle or any listing lookup.
  3. Respects the toggle. If gd-no-iap-for-author-staff is not 'yes', returns the upstream value unchanged (no bypass).
  4. Owner check. Queries whether the user authors any GeoDirectory listing (a get_posts by author across all GD post types except gd_event). If they own at least one, returns 'no'.
  5. Accepted-staff check. Applies the mam_user_has_accepted_group_membership filter; if it returns true (the user has accepted staff/manager membership on a GD listing), returns 'no'.
  6. Otherwise returns the upstream value unchanged.

The function returns the string 'no' to bypass (not a boolean false), matching the mam_iap_require_iap value convention.

The mam_geodirectory_phone_data::inject_pending_invite_form() code also unsets inapp_is_required on the data array when a user has a pending invite — so users who are about to become staff are also exempted on app launch.


What the user experiences

  • An administrator, a user who authors any GD listing, or a user with accepted staff/manager membership on a GD listing opens the app and is not asked to subscribe (owners/staff only when the toggle is on).
  • A user with a pending staff invite is not asked to subscribe on the launch where the Manage Invites form is shown.
  • A user who is none of the above sees the standard IAP gate (controlled by mam-inapp-purchase-manager).

Things to watch for

  • The toggle gates the bypass. Setting gd-no-iap-for-author-staff to anything other than yes disables the owner/staff bypass (admins are still exempted first, before the toggle is consulted).
  • Owners are exempted by authorship. The owner check is a get_posts query by author across all non-event GD post types, so a listing author is exempted even if they were never enrolled as staff via the chat-manager invite system.
  • Accepted staff/managers are exempted via a filter. Staff membership is resolved through the mam_user_has_accepted_group_membership filter rather than by reading mam_staff_* user meta directly in this function.
  • Admins are always exempted by this integration. The administrator check runs first and returns 'no' before the toggle or any listing lookup.

Steps to enable

  1. Install and activate mam-inapp-purchase-manager.
  2. Set gd-no-iap-for-author-staff to yes under Settings.
  3. Verify a test listing author (or an accepted staff/manager on a GD listing) is not prompted to subscribe.
  4. Verify a test user with a pending invite is not prompted on the launch where the invite form appears.

Verification

This article was last verified against:

  • Plugin: mam-geodirectory v2.1.5
  • Plugin: mam-inapp-purchase-manager
  • Source: includes/mam_gd_staff_manager.phpapply_in_app_purchase()
  • Source: includes/mam_geodirectory_phone_data.phpinject_pending_invite_form()

Re-verify whenever the gd-no-iap-for-author-staff toggle handling changes, the owner/authorship or mam_user_has_accepted_group_membership checks in apply_in_app_purchase() change, the IAP plugin’s mam_iap_require_iap filter contract changes, or inject_pending_invite_form() stops unsetting inapp_is_required.


  • Plugin: mam-geodirectory
  • Recipe: Configure the GeoDirectory settings page
  • Form: Manage staff invitation
  • Form and flow: Claim Listing — In-App Purchase as a claim payment rail
  • Recipe: Set up Claim Listing subscriptions

Metadata

Field Value
Article type Plugin Overview
Plugin slug mam-geodirectory
Applies to plugin version 2.1.5+
Category Plugin Reference
Audience WordPress admin
Last verified 2026-05-01
Was this article helpful?
Contents

    Need Support?

    Can't find the answer you're looking for? Don't worry we're here to help!