Payment Processing in “Doula Course” Plugin

The current payment functionality of the “Doula Course” plugin is as follows.

A payment is typically initiated from one of three sources:

  1. Our public-facing website ( as a new monthly subscription.
  2. A recurring monthly subscription initialized by PayPal’s subscription service.
  3. A one-time payment made by our alumni to renew their certification.

In all actuality, there is no filters on any incoming payments made to our business’s PayPal account, so any form of payment can trigger our “ipn_relay” script which PayPal calls whenever a payment is made to our account.

The “ipn_relay” script does filter out only payments, meaning that any other IPN notices (such as new subscriptions, delays, suspension, cancellations, or anything else) are ignored.

Additional actions of the “ipn_relay” script are as follows:

  • A temporary IPN record is stored in the database. (IPN records older than two days are purged.)
  • A new user (and user_id) is created if no user is associated with the PayPal email address (PayPal email address is stored as user_meta field).
  • A transaction record is created based on the data sent from the IPN, which includes a user_id.
  • Emails receipts of the transaction are sent both to the user and to the administrator.

Note: several objects are created to attend to the details of the work of creating users, transactions, and emails.

Published by Brent Leavitt

Dad, Granddad, Co-owner at New Beginnings Childbirth Services, and a Social Entrepreneur.

Leave a comment

Your email address will not be published. Required fields are marked *